xulion / scope4code

cscope support for visual studio code
MIT License
21 stars 8 forks source link

follow link file:line ignores line number with remote-ssh #63

Open ymartineau opened 3 years ago

ymartineau commented 3 years ago

hi,

This issue has already been open here https://github.com/microsoft/vscode-remote-release/issues/4801 as recommended by support, I also open it here:

Please also file this issue on the extension. They can investigate to make sure that they are sending the right range and check whether vscode is ignoring it in this scenario.

Below the original ticket description:

Steps to Reproduce:

  1. install scope4code extension
  2. generate cscope database "Cscope: Build database"
  3. on a symbol, run: "Cscope: Find this C symbol", it opens a new tab with list of symbols with /absolute/path/file:line format:

All references found for symbol: "processAbc": /a/b/c:.cpp:93 bool processAbc(void * foo, bar_t bar) /a/b/d:.cpp:7 bla::processAbc(we, ze, resp);

  1. ctrl+click or "follow link" on the file, it opens the file but not at the right line number.

Does this issue occur when you try this locally?: No (tested "locally" on a linux VM with a vnc connection and the vscode client on this linux VM, and tested on windows host locally) Does this issue occur when you try this locally and all extensions are disabled?: not tested (I don't know how I could test)

Please forgive me if the issue is not reported on the right repository. I'm really new to vscode. I suppose the line and numbers are provided to some kind of vscode API, so I wanted to debug the value provided from the scope4code extension, I found the following lines:

https://github.com/xulion/scope4code/blob/master/src/FindResultDoc.ts#L22

that look interesting (I may be looking at the wrong place...), but I don't know how to debug those statements. Is there some kind of "trace tool" of the api between extensions and vscode itself that would eventually run without building nor debugging the extension itself?

Thank you,

yohann

xulion commented 3 years ago

Yohann,

thanks for providing all the detailed informtion. I'm aware of the issue but I haven't get time to investigate it yet. The code you are looking at shall be https://github.com/xulion/scope4code/blob/master/src/FindResultDoc.ts#L25 The code is pretty simple and straight forward. It generate and URL in file:///path#line which just like above link. As the whole vs code is based on browser so ctrl+click will navigate to the URL.

However when you are connect via SSH the vscode will alter the URL (file -> ssh I believe). And in that process the line number is gone. I still believe this is a vscode issue but I might be able to put this in the setting so you can set the extension to remote mode and the code can generate ssh url instead of local file url.