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

[性能优化建议:] 希望只对.ahk扩展名的文件判断版本。 #576

Closed PythonYunfei closed 2 months ago

PythonYunfei commented 2 months ago

希望启动时只对.ahk扩展名的文件判断版本。 .ahk1文件必定是指V1版本,.ahk2.ah2文件必定是指V2版本。因为它们扩展名本身已经表达了用户的版本意向;不需要插件再次进行版本判断,最多只需要插件在对应版本的文件下(V2文件) 进行错误诊断。 所以希望插件作版本判断时,默认只判断.ahk文件,其他不判断。 或者为版本判断专门设一个支持的扩展名列表,用于自定义。(这个貌似不那么需要,一般都只判断.ahk文件,可忽略)

RaptorX commented 2 months ago

You can already do that:

settings.json

"files.associations": {
        "*.ahk": "ahk2",
        "*.ahk1": "ahk1",
        "*.ahk2": "ahk2",
        "*.json": "jsonc"
},
mark-wiemer commented 2 months ago

AHK++ has this built-in :)

PythonYunfei commented 2 months ago

You can already do that:

settings.json

"files.associations": {
      "*.ahk": "ahk2",
      "*.ahk1": "ahk1",
      "*.ahk2": "ahk2",
      "*.json": "jsonc"
},

image

I already have that. But "version switch" will always work for not only *.ahk but also *.ahk2. The list above is for common highlights etc. but not for "version switch". I only expect *.ahk of the list which share the same extension name between the two versions, to work for "version switch" specifically.
To reduce the unnecessary work of the "version switch".