thqby / vscode-autohotkey2-lsp

Autohotkey v2 Language Support using vscode-lsp.
https://marketplace.visualstudio.com/items?itemName=thqby.vscode-autohotkey2-lsp
GNU Lesser General Public License v3.0
215 stars 21 forks source link

Find Definitition for instance method fails in certain conditions but works in others #610

Open RaptorX opened 2 weeks ago

RaptorX commented 2 weeks ago

Type: Bug

Expected

When hitting F12 or using the context menu Go to Definition the extension should take you to the method definition

Result

This works in certain circumstances but not others. If file1 contains a call to the method AND the extension loaded the symbols things work as expected.

The key point here is that file1 MUST contain a call to the method (not only the definition, seems like)

If any of those conditions are not met, the extension does not jump to the definition when using F12 or the context menu.

Here is a video that shows a simple situation.

https://github.com/user-attachments/assets/ed1f7289-4858-4f60-9f0c-240bcf84d2c9


Extension version: 2.5.3 VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700KF (20 x 3610)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|31.84GB (17.05GB free)| |Process Argv|G:\\Jeff_B\\Prospect Finder --crash-reporter-id 3e042e59-cb22-4371-968a-6f3e35abe666| |Screen Reader|yes| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 jg8ic977:31013176 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 wkspc-ranged-t:31125599 cf971741:31144450 autoexpandse:31146404 notype1:31150297 5fd0e150:31146321 ```
PythonYunfei commented 1 week ago

@thqby

翻译成中文:

类型:bug

• 创建file1,包含一个类和一个实例方法
• 创建file2,包含file1并调用实例方法
• 让扩展加载符号

预期结果

当按F12键或使用上下文菜单中的"转到定义"选项时,扩展应该带你到方法定义处

实际结果

这在某些情况下有效,但在其他情况下无效。
如果file1包含对该方法的调用,并且扩展加载了符号,那么一切都按预期工作。

这里的关键点是file1必须包含对该方法的调用(看起来不仅仅是定义)

如果这些条件中的任何一个不满足,当使用F12或上下文菜单时,扩展不会跳转到定义。

这里有一个视频展示了一个简单的情况。