microsoft / microsoft/vscode-cpptools
Brace matching does not account for inactive regions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Issue Type: Bug
please make test.cpp file using following code
#undef x
int main()
{
int a=0, b=0,c=0;
#ifndef x
if(b==2){
if(a==0){
}
else
#else
if(c==1){
#endif
a=1;
}// wrong matching
return 0;
}// wrong machine
Observe wrong bracket pairing at commented places. "// wrong machine"
Extension version: 0.23.1
VS Code version: Code 1.34.0 (a622c65b2c713c890fcf4fbf07cf34049d5fe758, 2019-05-15T21:59:37.030Z)
OS version: Windows_NT x64 6.1.7601
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808) |
| GPU Status | 2d_canvas: enabled checker_imaging: disabled_off flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: unavailable_off surface_synchronization: enabled_on video_decode: enabled webgl: enabled webgl2: unavailable_off |
| Load (avg) | undefined |
| Memory (System) | 15.89GB (7.41GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by creating test.cpp with the preprocessor example in the report and checking the brace pairing around the inactive region. Trace the extension's brace-matching behavior for #ifndef, #else, and #endif; done means the braces are paired according to the active code paths rather than the inactive branch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100