Closed syonip closed 1 month ago
My guess is that your local IIS doesn't yet support WebSockets.
Thanks @gjsjohnmurray your guess was correct! Now I'm able to debug but it doesn't stop on breakpoints, and showing the following error:
Unable to read file 'isfs://iris2:user/core/System/Utils/GraphicsUtilsPython/Wrapper.cls' (TypeError: Cannot read properties of undefined (reading 'toUpperCase'))
Thanks again
How does the server name iris2
in that message relate to the iris
server shown in your earlier screenshots?
Are you able to debug a simple HelloWorld.mac routine?
How does the server name
iris2
in that message relate to theiris
server shown in your earlier screenshots?Are you able to debug a simple HelloWorld.mac routine?
The name iris2 is from a previous configuration I was testing, but I since removed it from the workspace.
Just tried a simple mac test and the same behaviour: the code runs but breakpoint is not hit:
This is what I see in devtools view:
@syonip I wasn't able to reproduce this issue. Are you still experiencing it?
@syonip I wasn't able to reproduce this issue. Are you still experiencing it?
Yes, the debugger runs the code but breakpoints are not hit. Any other logs I can check?
@syonip Since I can't reproduce this, I think this is caused my some sort of configuration error. Are you using a code-workspace file? If so, can you send it to me? Also, how are you opening the files that you're trying to debug?
Yes, here is the code-workspace.json:
{
"folders": [
{
"path": ".."
},
{
"name": "iris:USER",
"uri": "isfs://iris:user/"
}
],
"settings": {
"workbench.colorTheme": "Default Light+"
}
}
and here is settings.json:
{
"objectscript.conn": {
"server": "iris",
"ns": "USER",
"active": true
}
}
@syonip Thanks, that what I thought the workspace would be. I think this is caused by you having the breakpoint set in the file in one workspace folder, but debugging in the other. I strongly recommend you do not mix server-side and client-side folders in one workspace to avoid confusions like this. You can also easily overwrite your changes by having two "sources of truth". You should open just your local folder as the workspace instead of using a .code-workspace
file and use the InterSystems Explorer to view server code that is not in your local folder.
Thanks @isc-bsaviano, I opened the folder without workspace and now debugging is working. Although once I try to edit a server file it seems another workspace is created automatically. The only difference with the newly created workspace file is that the path is "." instead of ".." in the old one.
{
"folders": [
{
"path": "."
},
{
"name": "iris:USER",
"uri": "isfs://iris:user/"
}
],
"settings": {}
}
I still don't fully understand how to work with a local git-tracked version of the files, but debugging is working so thanks again.
@syonip I'm glad your debugging is working, but I'd still like to help clear up your confusion. Are you trying to edit code directly on the server like Studio (server-side editing), or are you trying to edit code on your local file system (client-side editing)? If the former, you should only have folders with an isfs
uri in your workspace. If the latter, you should only have local folders in your workspace. This will help you avoid getting changes lost due to using both paradigms at once.
Optimally, I would like to work with local files as these can be tracked by git. I think this would be an improvement over the current server-editing mode of work. Is there a mode where all editing and debugging can be done exclusively on client, even as the code is compiled on the IRIS server? I think this is what I was trying to configure
@syonip Yes, that's supported! All you have to do is open your local folder in VS Code. You don't need a .code-workspace
file. The objectscript.conn
config that you already have in your .vscode/settings.json
will be the server connection that's used. When you save an ObjectScript file, it will be synced to the server. The server will be used for answering intellisense questions (hover, go to definition etc). You can use the "Explorer" view in the InterSystems tab to view files on the server that may not be in your local folder. Files opened from there will not be editable. Note that we have some enhancements coming in this area (https://github.com/intersystems-community/vscode-objectscript/pull/1401).
I implemented your suggestions and it's working perfectly from local git-tracked folder, including debugging. This is quite an improvement, thanks!
Hello,
I'm trying to debug objectscript ClassMethods in VSCode, but nothing happens when clicking the Debug button over the ClassMethod.
This was working with previous versions - tested with IRIS 2020.
This is the server configuration:
Editing and compiling ObjectScript is working:
I checked the vscode devtools and saw an error every time I click debug:
Thanks.
$ZV: IRIS for Windows (x86-64) 2024.2 (Build 247U) Tue Jul 16 2024 09:57:03 EDT