microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

There is no any hints when using "#" #3927

Open JasonLeeCn opened 5 years ago

JasonLeeCn commented 5 years ago

Issue Type: Bug

The IntelliSense may stop working when the code (.c, .h) using "#".

Eg.:

Have function "test_a", macro "m_EnTestA".

int main() {

if m_EnTestA / No hints when start input 'm' /

endif

test_a(m_EnTestA); / have hints when start input 't' or 'm' / return 0; }

define ... / No hints when start input 't' or 'm' /

Extension version: 0.24.0 VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:59:35.033Z) OS version: Windows_NT x64 10.0.16299

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.66GB (3.98GB free)| |Process Argv| |Screen Reader|no| |VM|0%|
michelleangela commented 5 years ago

It doesn't look like auto-complete is supported for # . I tried the following and only got a hint outside the #. Visual Studio does the same.

#define HELLO 1

int main()
{

#if HELLO // no hints for input 'H'
    HELLO // hint when typing here
#endif 

    return 0;
}
michelleangela commented 5 years ago

Correction, IntelliSense on Visual Studio does support completion for #if via manually invoking completion with Ctrl+Space bar.

On VS Code however, if show completion via Ctrl+Space bar is done it only shows suggestions for the available preprocessor keyboards but not custom defined ones.

omerbguclu commented 4 years ago

How many upvotes needs the rethink this issue? I will find it :)

sean-mcmanus commented 4 years ago

@omerbguclu The more votes the better. Over 20 would be good: see https://github.com/Microsoft/vscode-cpptools/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A%22Language+Service%22

KermanX commented 3 years ago

inject gramma also has difficulty with whole statement begins with "#" because it has no name