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
216 stars 21 forks source link

No suggestions when next to character #120

Closed RaptorX closed 2 years ago

RaptorX commented 2 years ago

Issue Type: Bug

Situation

Sometimes I typed a command and later I decide to wrap it with another command:

RegexReplace(var,"string") ; started with this and I decided to outputdebug it
Outputdebug RegexReplace(var,"string") ; like this

In other lexers I just simply press home, start typing and press Ctrl+Space to get suggestions. like this:

image

The above image is from the Autohotkey-Plus-Plus extension for v1

Result

I get no suggestions

image

I am forced to always type a space before getting suggestions.

Notes

This doesnt happen if I do the same but with symbols instead of word characters as shown here:

image

Extension version: 1.4.4 VS Code version: Code 1.69.1 (b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a, 2022-07-12T08:21:24.514Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz (4 x 3198)| |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
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)|31.91GB (21.55GB free)| |Process Argv|D:\\Cloud\\RaptorX\\OneDrive\\Desktop\\Word Obj.ahk --crash-reporter-id 1eed22db-bc5c-446b-a877-f742be520d0c| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonvspyt551cf:30345471 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 vsclangdc:30486549 ```
thqby commented 2 years ago

This is not a bug. The trigger mechanism of code snippets and completions is different. Code snippets can always trigger, but completion is not.

Currently, it can only be entered in . or # is forced to trigger completion, and it also is triggered when a word begins to be input. It is impossible to set every character as a trigger. After all, there are many characters that can be used as symbol names.

RaptorX commented 2 years ago

This is not a bug. The trigger mechanism of code snippets and completions is different. Code snippets can always trigger, but completion is not.

Currently, it can only be entered in . or # is forced to trigger completion, and it also is triggered when a word begins to be input. It is impossible to set every character as a trigger. After all, there are many characters that can be used as symbol names.

How can the other plugin do it then? is it using a different approach?

thqby commented 2 years ago

These plugins have code snippets for built-in functions, and you can try to reproduce using user-defined functions.

RaptorX commented 2 years ago

These plugins have code snippets for built-in functions, and you can try to reproduce using user-defined functions.

image

I get suggestions with user-defined functions and typing right next to a text character.

Using this plugin https://github.com/mark-wiemer/vscode-autohotkey-plus-plus

thqby commented 2 years ago

Sorry, I misunderstood, you meant CTRL+space to trigger

RaptorX commented 2 years ago

In other lexers I just simply press home, start typing and press Ctrl+Space to get suggestions. like this:

Yes, thats right. When typing right next to a word you can force suggestions by pressing CTRL + Space but your plugging returns nothing as shown in the OP.