microsoft / microsoft/vscode-cpptools

Auto-detect C++ type on extensionless headers based on the first line

Open
#4,323 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: LanguageService

Auto-detect C++ type on extensionless headers based on the first line

  • OS and Version: Any
  • VS Code Version: 1.38.1
  • C/C++ Extension Version: Version 0.25.1

To Reproduce

  1. Open up any file lacking an extension
  2. Observe how it is not syntax colored without human intervention

Expected behavior

Standard C++ library and some open source libraries use extensionless headers.
Other editors (including viewer of github) are able to recognize that by scanning the first line of the header that embeds a - C++ - string in the comment.

Example: https://github.com/llvm-mirror/libcxx/blob/master/include/vector

Here are other examples of the first line of the extensionless files from several popular open source projects:

// -*- C++ -*-

or

//===- some description ---*- C++ -*-==//

Related issue on vscode

https://github.com/Microsoft/vscode/issues/23873

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Start by reproducing the behavior with an extensionless header, then review the related VS Code issue and the C/C++ extension's language-service handling for file types. Done means recognizing the shown first-line C++ markers and applying C++ syntax coloring without manual intervention.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.