Skip to content

Debugging instructions simplified - #24

Merged
jtulach merged 1 commit into
apache:masterfrom
jtulach:DebugInvokesCode
Oct 6, 2026
Merged

jtulach merged 1 commit into
apache:masterfrom
jtulach:DebugInvokesCode

Conversation

@jtulach

@jtulach jtulach commented Feb 4, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Motivation

vscode$ npm run nbcode
  • shall be everything one needs to debug Java running in code
    • the code is started with fresh data and extension directories
    • as such it should be isolated enough from any personal setup
  • I am able to install enso.vsix into the started code instance and then debug both
  • I am debugging from NetBeans IDE attaching to port 8000

@dbalek

dbalek commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Is there any chance to change the debug port if necessary? I saw it is hard coded in the sources now.

@jtulach

jtulach commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

Is there any chance to change the debug port if necessary? I saw it is hard coded in the sources now.

  • thanks for review, Dušane
  • one change of this PR is that debugging is on by default when doing npm run nbcode
    • OK?
    • if so, we need default port - is 8000 OK?
  • if you want to change the port, then we need a way to take action
    • right now the action is go to the src/nbcode.ts and change the code, btw.
    • should such an action be npm run nbcode port=7777?
    • or it should be port=7777 npm run nbcode?
    • or do you propose something else?

@dbalek

dbalek commented Feb 6, 2026

Copy link
Copy Markdown
Contributor
* one change of this PR is that debugging is on by default when doing `npm run nbcode`
  * OK?
  * if so, we need default port - is 8000 OK?

To have debugging on by default when running npm run nbcode is OK for me together with using 8000 as the default port.

* if you want to change the port, then we need a way to take action
  
  * right now the action is go to the `src/nbcode.ts` and change the code, btw.
  * should such an action be `npm run nbcode port=7777`?
  * or it should be `port=7777 npm run nbcode`?
  * or do you propose something else?

Either of the proposed solutions should be IMHO better than the necessity to modify the extension's sources to start debugging on a non-default port.

@jtulach

jtulach commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

To have debugging on by default when running npm run nbcode is OK for me together with using 8000 as the default port.
Either ... solutions ... better than the necessity to modify the extension's sources to start debugging on a non-default port.

Done in e2b450b

@jtulach

jtulach commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author
  • thanks for the review.
  • test-vscode-ext is failing and will also need a fix

@MartinBalin

Copy link
Copy Markdown
Contributor

Will fix the JDK17 test to use 21 after the release. It is caused by the fact that I've changes netbeans submodule in master to commit in NB master where 21 is already required

@jtulach

jtulach commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

Will fix the JDK17 test to use 21 after the release. It is caused by the fact that I've changes netbeans submodule in master to commit in NB master where 21 is already required

OK, so it may not be problem of this PR at the end. Good. I locally tried:

netbeans-vscode$ export JAVA_HOME=~/bin/graalvm-jdk-25.0.1+8.1/
netbeans-vscode$ env "netbeans.extra.options=-J-Dnetbeans.logger.console=true" ant test-vscode-ext

and that succeeds OK. I guess I can them merge, right @MartinBalin?

@jtulach
jtulach force-pushed the DebugInvokesCode branch 3 times, most recently from 67abe46 to aa81c83 Compare April 25, 2026 05:53
@MartinBalin
MartinBalin self-requested a review October 5, 2026 17:12
Comment thread vscode/src/extension.ts Outdated
if (isJavaSupportEnabled()) {
extras.push('--direct-disable', 'org.netbeans.modules.nbcode.integration.java');
let ownArgs = process.env.netbeans_args;
if (!ownArgs) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra arguments prevent the language server from starting.

The documented command npm run nbcode -- -J-Dnetbeans.extra.dirs=/path/to/extension sets netbeans_args, which skips both --start-java-language-server and --start-java-debug-adapter-server. VS Code waits for a connection that NetBeans never initiates. Extra JVM arguments should be appended while retaining the server startup arguments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra JVM arguments should be appended while retaining the server startup arguments.

$ cd /tmp/enso
/tmp/enso$ unzip enso4vscode-1.50.78.vsix
$ cd /netbeans-vscode/vscode
netbeans-vscode/vscode$ npm run nbcode -- -J-Dnetbeans.extra.dirs=/tmp/enso/extension/nbcode/enso4igv/

the /tmp/enso/extension/nbcode/enso4igv/ contains NetBeans cluster with one module. That module gets loaded by the VSCode extension:

org.enso.tools.enso4igv [1.51 1.51-20260325 202603251503]

Comment thread vscode/src/nbcode.ts
Comment thread vscode/src/nbcode.ts Outdated
Comment thread vscode/src/extension.ts Outdated
@MartinBalin

Copy link
Copy Markdown
Contributor

After I've seen you added some changes I rerun the review. Some comments left... thank you for working on this Jardo.

@jtulach

jtulach commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

After I've seen you added some changes I rerun the review. Some comments left... thank you for working on this Jardo.

The pleasure is all mine. It is an interesting intellectual challenge with such a deep reviews you provide!

@jtulach
jtulach requested a review from eppleton October 6, 2026 08:25
Comment thread vscode/src/nbcode.ts Outdated
@MartinBalin

Copy link
Copy Markdown
Contributor

Rerun of review on update PR branch revealed 2 things.

@jtulach

jtulach commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Squashed from 74b3144 to 3790f16 - will merge if it stays green.

@jtulach
jtulach merged commit 815ae8a into apache:master Oct 6, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants