-
Notifications
You must be signed in to change notification settings - Fork 323
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
ContextFactory reused to initialize language-server context #10670
Conversation
...server/src/main/java/org/enso/languageserver/boot/resource/TruffleContextInitialization.java
Show resolved
Hide resolved
.options(options); | ||
|
||
if (inspect) { | ||
options.put("inspect", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that when one uses --inspect
and hit Debug.breakpoint
statement we actually hit the breakpoint twice. Once in Chrome Dev Tools and once in REPL. I believe it is better to have just a single debugger running. As such I am proposing to disable debug server when --inspect
option is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definitely makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
.allowAllAccess(true) | ||
.allowHostAccess(new HostAccessFactory().allWithTypeMapping()) | ||
.option(RuntimeOptions.PROJECT_ROOT, pkg.root.getCanonicalPath) | ||
.option("js.foreign-object-prototype", "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option is no longer needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what that option is good for?
In any case, it is not used by CLI. I see two PRs that refer to that option:
There were no failed tests when the option was removed, so it is not essential for any use-case we test for.
Pull Request Description
Move
ContextFactory
to common module, so it is also available inlanguage-server
module and can be used there as well. As a result the initialization of experimental Espresso support is now unified. Otherwise this PR is just a refactoring except a single change: when using--inspect
and--run
hittingStandard.Base.Runtime.Debug.breakpoint
statement, the debugger stops in Chrome Dev Tools, as the internal debug server is disabled.Checklist
Scala,
Java,