microsoft / microsoft/vscode-cpptools
Support ${relativeFileDirname} in c_cpp_properties.json
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Type: LanguageService
Describe the bug
- OS and Version: Windows 10
- VS Code Version: 1.45.1
- C/C++ Extension Version: 0.28.2
- Other extensions you installed (and if the issue persists after disabling them): N/A
- Does this issue involve using SSH remote to run the extension on a remote machine?: No
VSCode supports ${relativeFileDirname} in launch.json and tasks.json. See here. I would like to have support for this variable in c_cpp_properties.json. I have a module testing framework that generates mocked functions and places them in mock_defaults.h. Each test has its own version of this header. When the test is open in the editor cpp_tools should grab ${relativeFileDirname} and use it for that translation units include paths.
Ex c_cpp_properties.json:
{
"configurations": [
{
"defines": [
"${default}"
],
"includePath": [
"${default}",
"${workspaceFolder:System Code}/bin/mod/${relativeFileDirname}"
],
"intelliSenseMode": "msvc-x64",
"name": "Win32"
}
],
"version": 4
}
Expected behavior
The above config should allow each translation unit (i.e. module test in my case) to use a path unique to itself.
For expample,
${workspaceFolder} = c/code/dev
${fileDirname} = c/code/dev/tests/path/to/test
${relativeFileDirname} = tests/path/to/test
final include path = c/code/dev/bin/mod/tests/path/to/test
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal comportamento dell’espansione delle variabili in c_cpp_properties.json e confrontalo con il supporto documentato per le variabili in launch.json e tasks.json. Usa la configurazione di esempio e i valori dei percorsi presenti in questa issue per verificare che ${relativeFileDirname} venga risolto per unità di traduzione e produca il percorso di inclusione previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100