microsoft / microsoft/vscode-cpptools

Enable changing the file extension of files created when using the "Create Declaration / Definition"

Open
#10,970 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Create Declaration or Definition Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Discussed in https://github.com/microsoft/vscode-cpptools/discussions/10969

Originally posted by starball5 May 18, 2023
It seems (or maybe I'm wrong) that in c++ header files, using the "Create Declaration / Definition" context menu action on a declaration will always create definition files with ".cpp" as the file extension.

Is it possible to change that file extension to anything else? (Ex. ".cc" or ".cxx"?)


I tried looking through the source code and found the following code for the extension client that handles the server response, but it's not very enlightening into what the server side does.

https://github.com/microsoft/vscode-cpptools/blob/v1.15.4/Extension/src/LanguageServer/client.ts#L3519

I gave a few minutes of nm -nC, strings, objdump -SCd of my installed cpptools-srv binary, and then threw in the towel figuring I was out of my depth with those tools.

Also potentially loosely related: https://github.com/Microsoft/vscode-cpptools/issues/1341.

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 with Extension/src/LanguageServer/client.ts around line 3519 and read discussion #10969, then trace how the server handles the Create Declaration / Definition response. Done means users can choose an alternative definition-file extension such as .cc or .cxx instead of always receiving .cpp, with the behavior verified in the relevant extension workflow.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.