microsoft / microsoft/vscode-cpptools

${fileDirname} not working as a predefined variable

Open
#6,025 20 comments 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Issue Type: Bug

First time reporting an issue here so pardon if I do something wrong.

I don't know how to reproduce the bug because I don't really know what caused it or if it was already there in the first place.

So I tried to setup my VSCode for C projects with MinGW on windows and tried to use the ${fileDirname} to set it up on the c_cpp_properties.json.

But it doesn't show as a path and it only shows as ${fileDirname} in C/C++ Configurations UI and it reports that "Cannot find: ${fileDirname}".

Extension version: 0.29.0
VS Code version: Code 1.48.1 (3dd905126b34dcd4de81fa624eb3a8cbe7485f13, 2020-08-19T17:12:13.244Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz (4 x 2304)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 3.84GB (0.54GB free)
Process Argv
Screen Reader no
VM 0%

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 c_cpp_properties.json and the C/C++ Configurations UI on the reported Windows and VS Code setup, checking how ${fileDirname} is handled. Reproduce the literal-variable display and the “Cannot find” report; done when the variable resolves to a path in the UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.