Intellisense and code completion in VS code objectscript
When I'm writing code in Intersystems Studio code completion is different than in VS Code. It would be greate if VS Code would react the same way on code completion .. This happens is studio
When I do this in VS Code it doesn't show the object but it shows ?? all possible items ??
Product version: IRIS 2022.1
Do things improve if you rewrite your first line to be this?
Yes it does improve.. but its a lot of work to dim every object in my code...
It's not a big difference between Studio and VS Code - ObjectScript here. Studio automatically does the #dim for you when you do a %New() or %OpenId(), and VS Code - ObjectScript doesn't. But #dim is still necessary in both IDEs for referenced or returned objects:
Perhaps worth noting that you can combine Joel's "#dim" and "set" lines into a single one if you wish. See https://docs.intersystems.com/iris20222/csp/docbook/DocBook.UI.Page.cls?...
True. I personally am not a fan of using #dim in any way other than:
#dim variable as objectclassname
because it makes it clear that #dim provides code completion for object variables, which is the functionality I care about. Yes, I know it also provides variable documentation for developers who are used to declaring datatypes in other languages
The other documented options:
#dim variable as objectclassname = initialvalue
(ok, but I prefer #dim followed by set)#dim variable = initialvalue
(there's no reason to use #dim to do what set does)#dim variable as non-objectclassname
(this is documentation only; no code completion is provided)#dim variable as list/array of objectclassname
(again, documentation only; no code completion)@Rob Schoenmakers @Joel Solon
I just released InterSystems Language Server version 2.2.0, which provides intellisense for variables created by %New(), %Open() or %OpenId(). VS Code should auto-update it for you.
💡 This question is considered a Key Question. More details here.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue