microsoft / microsoft/vscode-cpptools

Feature Request: Add a setting to allow source files to be discerned from header files

Open
#10,915 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

There are various scenarios in which cpptools will try to discern if a file is a source file or a header file. For example:

  • include graph generation - to determine whether a file should be a source node or header node in the graph.
  • TU creation - to determine if a header file is requested, and, if so, determine a source file to create the TU with instead.
  • code analysis - When a save operation is performed on a source file, code analysis for that file is canceled, to ensure clang-tidy doesn't keep it open/locked. When a header file is saved, all code analysis operations are canceled, as any one of them might be keeping the header open/locked.
  • include auto-complete - to determining if a file should be included in the list, or to determine if the includes cache needs to be cleared/updated.
  • Goto-def, to determine if a candidate is a source or header candidate.
  • (various other places)

This issue tracks adding a setting to allow the user to customize what file extensions (or wildcard patterns, to match files.associations) are considered headers vs. sources, rather than hard-coding these associations.

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

Start by tracing the existing source-versus-header decisions used by include graph generation, translation-unit creation, code analysis, include auto-complete, and Go to Definition. Define the setting's extension or wildcard behavior and verify that each listed workflow respects it instead of relying on hard-coded associations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.