Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging doesn't work with iris version 2024.2 #1437

Closed
syonip opened this issue Sep 30, 2024 · 15 comments
Closed

Debugging doesn't work with iris version 2024.2 #1437

syonip opened this issue Sep 30, 2024 · 15 comments

Comments

@syonip
Copy link

syonip commented Sep 30, 2024

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:


"intersystems.servers": {

        "iris": {

            "webServer": {

                "scheme": "http",

                "host": "localhost",

                "port": 80

            },

            "username": "superuser"

        }

    },

Editing and compiling ObjectScript is working:
image

I checked the vscode devtools and saw an error every time I click debug:
image

Thanks.

$ZV: IRIS for Windows (x86-64) 2024.2 (Build 247U) Tue Jul 16 2024 09:57:03 EDT

@gjsjohnmurray
Copy link
Contributor

Please see https://docs.intersystems.com/iris20242/csp/docbook/DocBook.UI.Page.cls?KEY=GIEMISC_wstroubleshoot#GIEMISC_wstroubleshoot_iis_vscode

My guess is that your local IIS doesn't yet support WebSockets.

@syonip
Copy link
Author

syonip commented Sep 30, 2024

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

@gjsjohnmurray
Copy link
Contributor

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?

@gjsjohnmurray
Copy link
Contributor

@syonip
Copy link
Author

syonip commented Oct 1, 2024

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?

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:
image

This is what I see in devtools view:
image

@isc-bsaviano
Copy link
Contributor

@syonip I wasn't able to reproduce this issue. Are you still experiencing it?

@syonip
Copy link
Author

syonip commented Oct 11, 2024

@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?

@isc-bsaviano
Copy link
Contributor

@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?

@syonip
Copy link
Author

syonip commented Oct 14, 2024

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
    }
}

@isc-bsaviano
Copy link
Contributor

@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.

@syonip
Copy link
Author

syonip commented Oct 16, 2024

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 syonip closed this as completed Oct 16, 2024
@isc-bsaviano
Copy link
Contributor

@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.

@syonip
Copy link
Author

syonip commented Oct 18, 2024

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

@isc-bsaviano
Copy link
Contributor

@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 (#1401).

@syonip
Copy link
Author

syonip commented Oct 19, 2024

I implemented your suggestions and it's working perfectly from local git-tracked folder, including debugging.
This is quite an improvement, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants