Serpen / VBS-VSCode

VSCode VBScript language extension
https://marketplace.visualstudio.com/items?itemName=Serpen.vbsvscode
MIT License
24 stars 11 forks source link

Include own definitions #28

Closed Benik3 closed 3 years ago

Benik3 commented 3 years ago

Hello.
Very nice extension for VScode, I just started to test it, but I stuck on own definitions of methods/functions etc. which is very important feature for me.
I tried to make language specific settings with including source fire, but still the Sub is not offered by intellisense.
Any suggestion?
Thank you obrazek obrazek

Serpen commented 3 years ago

Could you please try to set your settings.json just to :

{
    "vbs.includes": ["c:\\test_VSC.vbs"]
}

I don't know where "[VBScript]" comes from, the extension uses "VBS" as language identifier. Did you do this settings manually or via gui?

Benik3 commented 3 years ago

The [VBScript] should stand for the language for which is the setting applied. If I try just "vbs.includes": ["c:\test_VSC.vbs"] I got error "array expected"

Serpen commented 3 years ago

as far as i know, there is no language "VBScript" in VSCode, unless you use another VBScript Extension. Could you please check if I have another extension and configuring this setting only for this other extension instead of for this extension?

Setting language specific variables is only supported for indention, etc. which comes vscode and not from an extension, as far as i know.

Benik3 commented 3 years ago

It's true that I have installed VBScript by Adrfka and VBScript symbols by Andreas. I disabled both extension but maybe it left this here.
I set it through GUI: https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
I have latest VSCode and Win10 1903, I will test more on Monday :)

Serpen commented 3 years ago

This isn't per GUI, you typed it manually. And you must configure the setting for the extension not for the language. The links shows only samples of editor config items, like mentioned earlier.

Please try to use the Settings Editor (or the syntax provided from it) https://code.visualstudio.com/docs/getstarted/settings#_settings-editor grafik

Benik3 commented 3 years ago

I see, I just tested it on another PC with clean install of VScode and just yours extension and it works OK now, thank you! :)

Serpen commented 3 years ago

okay, nice to hear that it works, but should also work with those other two extensions.

Benik3 commented 3 years ago

With VBscript extension ( I think) I had problem that I saw double declaration of function in Intellisense.
Anyway is possible to write documentation for return of function? I tried

<return>
Serpen commented 3 years ago

No there is currently no support for that, since vbs is generally untyped. It would be just an additional comment, so try to write it like this:

' Does something, returns int
function getInt(str)

end Function

grafik (the double declarations in my screenshot indeed come from two installed vbs extensions)

However i'm thinking about a pseudo type system #16, especially if the extension is going to support other VB dialects as well #6. Leave a comment in #16 about your wish/idea how to support return comments. But currently this is not on my roadmap.

Benik3 commented 3 years ago

No problem, I just asked to be sure :)
Yeah VBScript "doesn't have" types, but I just wanted to write somewhere what the value of the return mean.
BTW I saw that you have all the functions declared manually in the GlobalDefinition file. Isn't possible to use VBA/VB6 dll for this? I don't have experience with this so I'm just thinking how to make it with less work :)