microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.96k stars 29.18k forks source link

Can not navigate to the indicated line of source code of C++ #150140

Closed gongweixue closed 2 years ago

gongweixue commented 2 years ago

Issue Type: Bug

compile a src file with g++, when the compiler report a warning info, with the file name and the line num, you press ctrl button and click the file name with the line num on the console, the cursor just jumps to the file, but not located at the correct line(placing the cursor at the first line, seems can not found the line by the line num). The error also happens when i am using C or makefile.

VS Code version: Code 1.67.1 (da15b6fd3ef856477bf6f4fb29ba1b7af717770d, 2022-05-06T12:37:03.389Z) OS version: Windows_NT x64 10.0.17134 Restricted Mode: No Remote OS version: Linux x64 4.15.0-142-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.74GB (8.64GB free)| |Process Argv|--crash-reporter-id 9446a355-8d76-4b46-b960-21c40b454e28| |Screen Reader|no| |VM|67%| |Item|Value| |---|---| |Remote|SSH: 10.65.47.221| |OS|Linux x64 4.15.0-142-generic| |CPUs|Intel(R) Xeon(R) Gold 5122 CPU @ 3.60GHz (8 x 1200)| |Memory (System)|31.12GB (26.42GB free)| |VM|0%|
Extensions (33) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.6.0 language-gas-x86|bas|0.0.2 arm|dan|1.7.4 better-cpp-syntax|jef|1.15.13 kconfig|luv|1.0.3 jupyter-keymap|ms-|1.0.0 remote-containers|ms-|0.234.0 remote-ssh|ms-|0.80.0 remote-ssh-edit|ms-|0.80.0 remote-wsl|ms-|0.66.3 devicetree|plo|0.1.1 linkerscript|Zix|1.0.2 project-manager|ale|12.6.0 code-gnu-global|aus|0.2.2 language-gas-x86|bas|0.0.2 doxdocgen|csc|1.4.0 vscode-office|cwe|2.5.4 arm|dan|1.7.4 xml|Dot|2.5.1 gitlens|eam|12.0.6 better-cpp-syntax|jef|1.15.13 kconfig|luv|1.0.3 python|ms-|2022.6.2 jupyter|ms-|2022.4.1021342353 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 cpptools|ms-|1.9.8 cpptools-extension-pack|ms-|1.2.0 vscode-cmake-lite|num|0.1.0 devicetree|plo|0.1.1 gnu-mapfiles|tro|1.1.0 cmake|twx|0.0.17 linkerscript|Zix|1.0.2 (4 theme extensions excluded)
vscodenpa commented 2 years ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.67.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

gongweixue commented 2 years ago

Version: 1.67.2 (user setup) Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 Date: 2022-05-17T18:15:52.058Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.17134

I had used the latest version for now, but the issue still exists.

IllusionMH commented 2 years ago

You should at least provide examples of file path with line/column, because if there are spaces it might not be supported.

gongweixue commented 2 years ago
>> Compiling arbi_thread.c
arbi_thread.c: In function ‘arbi_thread_entry’:
arbi_thread.c:38:13: error: expected ‘;’ before ‘break’
             break;
             ^

I delete ';' to let compiler show the diagnostic info in the terminal window. Then click 'arbi_thread.c:38:13', it opens the file, and the cursor is at the first line and first char location. The file name is too ordinary.

gongweixue commented 2 years ago

no re-produced