helsmy / vscode-autohotkey

A simple Autohotkey language server with some advanced features
https://marketplace.visualstudio.com/items?itemName=helsmy.ahk-simple-ls
GNU Lesser General Public License v3.0
7 stars 3 forks source link

Add Autocomplete Path for #Include #3

Open CzarOfScripts opened 2 years ago

CzarOfScripts commented 2 years ago

Add Path Autocomplete for #Include, it is very missing. Thank you for your work.

helsmy commented 2 years ago

I will try make it working. However, the first goal for version 0.8 is to parse AHKv1 as accurate as possible, other features may not be enough steady cross version.

helsmy commented 2 years ago

And Path Autocompletion for #Include is fired by character / and <. So make sure type either of them even for files in the some folder for example #Include ./somename… and you will see path completions.

CzarOfScripts commented 2 years ago

The thing is that my folder path is usually specified directly, and it doesn't work for this path 'D:/AutoHotKey/library/'.

helsmy commented 2 years ago

I will make this work in next version

CzarOfScripts commented 2 years ago

Great, it works, but I ran into a problem. When hovering with pressed Alt, for all works transition to the file, but does not work for "extraFunc" and "SAMP", although the files exist. And the functions are not parsed from it. Perhaps because the files are large? In "extraFunc" 990 lines of code, in "SAMP" more than 3000.

image

helsmy commented 2 years ago

It may be not. Someone tested this extension on files over 10000 lines and it parse files fast enough. Try open extraFunc.ahk or SAMP.ahk see if the outline is provided for the file, and if not, it counters some wrong on parsing. Try the following step:

  1. delete some lines of code
  2. check the outline
  3. if outline appears, that block of code caused the problem.
  4. post it here, I will try to fix that Thanks for you hard working
CzarOfScripts commented 2 years ago

"outline"? What do you mean? It's hard for me to understand the translation, is that what you mean? If so, everything works in the file where it is declared.

image

CzarOfScripts commented 2 years ago

Oh... I see what you mean, yes, it works. image

helsmy commented 2 years ago

Em, it's werid. Since outline works, the file is parsed without problem. 图片 Could you open blank vscode and open the file including extraFunc.ahk and SAMP.ahk, then post the output of Autohotkey Simple Support.

CzarOfScripts commented 2 years ago

Please tell me how to open this panel. And I had a hunch, these files use functions that are in other files, that is, when you run one of these files, an error will pop up that some function is missing. Could this be the case?

CzarOfScripts commented 2 years ago

image

helsmy commented 2 years ago

If the file is the first ahk file, It seems that SAMP.ahk is not able to be load. I will try to reproduce the bug and found out what casued it.

CzarOfScripts commented 2 years ago

In the screenshot above, I opened the file in which:

#Include D:/AutoHotKey/library/extraFunc.ahk
#Include D:/AutoHotKey/library/codeProtect.ahk
#Include D:/AutoHotKey/library/Objects/objectClone.ahk
#Include D:/AutoHotKey/library/Objects/objectMerge.ahk
#Include D:/AutoHotKey/library/Others/regExMatchAll.ahk
#Include D:/AutoHotKey/library/Class/Clipboard.ahk
CzarOfScripts commented 2 years ago

When I hover over a file name with "alt" pressed, for some reason the content from another file is displayed, and not the first line. The code takes from the file "extraFunc", from which the functions for "auto complete code" were not parsed, and now they are parsed, but they seem to be taken from the last incorrectly defined inlude, even though the tooltip says that the function is from "extraFunc".

UPD: And yes. Consequently, hints for the "Array" class are not shown.

image

image

image

helsmy commented 2 years ago

The feature go-to-defination, that press alt and hover on something,for now is only support "ahk code" not for the path or file name. So, extension can find anything in code. But, in this case there maybe some errors for that I will try to find it