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

希望添加选项:在不清楚变量内容时不显示警告。 #578

Closed PythonYunfei closed 1 month ago

PythonYunfei commented 1 month ago

image image

图片中的代码是可以正常运行的。xx变量的内容是一个VarRef实例,符合VarSetStrCapacity()的要求。但插件仍然对变量xx显示警告。 故希望可以:消除此类警告、或者添加选项消除此类警告。(建议后者)

RaptorX commented 1 month ago

When you hover over it it explains what the warning is about: image

While VarSetStrCapacity(varName) "works" that form is deprecated and its there for backwards compatibility as far as i remember.

The recomended is VarSetStrCapacity(&varName) note the &.

Per the documentation you mentioned: image

If he decides to remove that i hope that is as an option/setting. I think we should keep warnings about deprecated syntax.

I would agree that the hover tip should be explicit about the fact that the syntax is actually deprecated though.

thqby commented 1 month ago
/** @type {VarRef} */
v := ''
VarSetStrCapacity(v)
PythonYunfei commented 1 month ago

/* @type {VarRef} /

This is a feasible idea.