xulion / scope4code

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

Do not override "Go to Definition (F12)" with cscope find #55

Closed zxbuaa closed 4 years ago

zxbuaa commented 4 years ago

From the document it seems this extension will override vscode builtin commands such as below

Cscope: Find this C symbol (same as "Find all references").
Cscope: Find this function definition (same as "Find definition").

But I found it is not exactly the case. e.g. "Find All References" still go with original Clang based search (very slow of course). This is fine since I can still use "Cscope:*" commands to search with cscope database. However, there is one exception "Go To Definition (F12)", apparently it is replaced with cscope based search. In many cases this is not ideal since the original builtin command is more accurate, cscope however, will list all symbols from all files with the same name.

Please keep the extension introduced commands separately with the builtin commands.

PS: my version vscode 1.47.3 scope4code v0.1.4

xulion commented 4 years ago

Thanks for the feedback Xiaobo.

I'm not exactly sure how the priority of reference provider works. But the extension does work if you disable the default tag engine.

I have below settings in my preference: "C_Cpp.autocomplete": "Disabled", "C_Cpp.intelliSenseEngine": "Disabled", "C_Cpp.intelliSenseEngineFallback": "Disabled",

zxbuaa commented 4 years ago

To me disabling autocomplete and intelliSense is huge regression. I don't understand why the extension and the builtin search will interference with each other, ideally they should be totally independent.

xulion commented 4 years ago

From vscode help: "Multiple providers can be registered for a language. In that case providers are asked in parallel and the results are merged.". So unless you disable C_CPP provider it would run it and it's slow. You might keep auto complete enabled but it's based on the same engine so I'm not sure if it works or not.

Anyway this is my setting for your reference. You can try different combination to see which one works for you best.