I'm not familiar with all of the Zen specific methods in that class. For working with JSON outside the Zen framework though (for example, in REST APIs), new code should use Dynamic Objects.
- Log in to post comments
I'm not familiar with all of the Zen specific methods in that class. For working with JSON outside the Zen framework though (for example, in REST APIs), new code should use Dynamic Objects.
@Alin Soare
What "auto-formatting" are you referring to? Can you provide before and after screenshots showing what gets changed on save?
@Evgeniy Potapov You can use Dynamic Objects for working with JSON data
@Lukas Dolezal
VS Code's View Other command supports jumping to the same line in the INT routine, but that support requires an InterSystems server with Atelier API version 4 or above (Cache 2018.1.6+, IRIS 2019.1.2+, 2020.1.1+, 2021.1+). If you're not using one of those versions then the location mapping won't work.
An important detail about the independent Studio is that it is installed in its own directory, so it won't be uninstalled when you upgrade/add/remove IRIS instances on your system. Also, since the 2024.1 Studio is forward-compatible, you won't need to update it every time a new IRIS version is released.
There is an open feature request for automatic indentation support, but that doesn't include adding newlines: https://github.com/intersystems/language-server/issues/293
You can use your second example above, then copy the content into a new %Stream.GlobalBinary:
Do strm.Rewind()
Set o = {}, o.strm = strm, strm2 = o.%Get("strm",,"stream>base64")
Set strm3 = ##class(%Stream.GlobalBinary).%New()
Do strm3.CopyFrom(strm2)@Marcel den Ouden
I've opened a pull request that fixes your issue. You can download and install the vsix found here to test fix if you'd like.
@Daniel Bertozzi
You can do the following:
Do ..%SetStatusCode(##class(%CSP.REST).#HTTP401UNAUTHORIZED)@Richard Rayburn
There isn't an equivalent to the Inspector's Storage editor in VS Code yet. That's on our roadmap but we don't have an ETA for it yet due to design challenges. You will have to edit the Storage block directly in the class's text. There is hover documentation and code completion support for Storage blocks in VS Code, which Studio did not have:


I hope you find this helpful.
@Kevin Kindschuh
If you're using client-side editing (files on your local file system controlled by GIT directly), you can export HL7 schemas from the InterSystems Explorer view. They will be in the "Other" section:
.png)
Since this issue can't be reproduced by you on another server, or by me with a fresh install of your adhoc, I think it's highly unlikely that there's a product defect. I think this is an issue with that specific instance only. The WRC should be able to help you investigate this further.
I tried to reproduce your issue with your exact server version and I couldn't get the error to occur. Do you remember when this started happening? Does debugging work when you connect to other instances?
Yes, that is very helpful. The <COMMAND> error is coming from a line that calls "Do <debug_target>", which in this case is "##class(prosthetic.ProstheticResourceTest).RunTests()". Does running "Set a = "##class(prosthetic.ProstheticResourceTest).RunTests()" Do @a" work from the terminal in that namespace or do you see the same <COMMAND>?
Thanks for the information @Daniel.Raderstrong. Can you please run the troubleshooting steps found in the docs and post the contents of the trace global here? That will help me identify the cause of your issue.
@Daniel Raderstrong
How are you running the debugger? What version of the vscode-objectscript extension do you have and what's the $ZV of your server?
@Evan Gabhart
No, you can't import .rtn files and we have no plans to add that. Other than the SMP, you can use the VS Code integrated terminal to open an IRS terminal, or the WebSocket Terminal to import the .rtn files. I would recommend using a different format for your exports though, like XML or UDL.
Thanks for the screenshots. I've never seen that happen before. I just booted up my windows machine and tried to reproduce that behavior but couldn't. If you delete the src/index.csp file and then save src/goerke/index.csp, does src/index.csp re-appear? Do you see any errors or messages in the ObjectScript Output channel?
I'm not sure what you mean by "it recreates the file in the root directory of the namespace". Can you post a screenshot? Also, can you describe in more detail what you're trying to test? We will be able to give better advice with more context.
@Daniel Goerke
What learning course/training steps are you following? Do you mean to be creating CSP files? CSP files need to be stored inside a web application so they can be served by the web server. They can't be created as standalone files without that context. Therefore, you need to have the CSP file in folders that tell VS Code what web application it goes it. For example, if you want to create mypage.csp in web application /csp/user, the path to the file inside your local workspace should be something like src/csp/user/mypage.csp. You may also find it easier to edit web application files directly on your IRIS server using server-side editing.
Thanks for your feedback! In response, I've submitted Pull Request #1311 which removes the comment-continuation feature for ObjectScript comments (it's still enabled for class description /// comments). It also adds auto-closing of C-style block comments (e.g. typing /* automatically adds */ after the cursor). You can try this out by downloading and installing the latest beta version of the vscode-objectscript extension from GitHub, which can be found here.
@Evgeny Shvarov This should work:
Do ##class(%Studio.General).GetWebServerPort(,,,.url) Write url,"csp/sys/UtilHome.csp" Kill url@Norman W. Freeman
If you upgrade to version 2023.3 or newer, you can use ##class(%RoutineMgr).OutOfDateDocuments() to check all documents in a namespace. You can use the various arguments to filter the documents that are checked (for example, to only check classes).
Hi @Mathew Rimmington, thanks for following up with your solution! That is a creative way to solve the problem and I encourage you to submit your code as a Pull Request to the vscode-objectscript extension. It is a community tool so we would happy to include your code if it improves your experience. The contributing guide can be found here.
Hi @Mathew Rimmington, this exact question was asked in a GitHub discussion a few weeks ago. To summarize my answer there, this isn't easy to add because the text that gets added on enter (besides indentation) is static. It acn't be generated from the regular expression used to match the previous line, so I couldn't dynamically add the correct number of dots. My recommendation is to use modern brace syntax instead of legacy dot syntax.
@Nicki Vallentgoed
You can convert the HttpResponse.Data into a %DynamicObject without using an intermediate stream:
Set jsonob = ##class(%DynamicObject).%FromJSON(httprequest.HttpResponse.Data)@Evgeny Shvarov
You can't use macros in a terminal so that's probably the cause.
@Joseph Griffen
ZWrite is going to output the internal format of the %Status value, which isn't that easy to parse visually. $SYSTEM.Status.DisplayError() will output the status text to the current device in a more readable format.
USER>Write ##class(%Atelier.v1.Utils.General).ValidateDocName("project.prj",.sc)
0
USER>ZWrite sc
sc="0 "_$lb($lb(16006,"project.prj",,,,,,,,$lb(,"USER",$lb("e^ValidateDocName+33^%apiSRC^2","e^ValidateDocName+1^%Atelier.v1.Utils.General.1^1","e^^^0"))))/* ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER] */
USER>Do $SYSTEM.Status.DisplayError(sc)
ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER]If you need to store the status text in a variable you can use $SYSTEM.Status.GetErrorText().
Sorry, I see that now! Have you checked your server connection information and made sure you have the correct host, port username and password?