-
Notifications
You must be signed in to change notification settings - Fork 328
Native Language Server integration with PM #11880
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4ab1417
Native Language Server integration with PM
hubertp 61ce655
nit
hubertp c4d6873
Add missing reflect config
hubertp def1ea7
Ensure proper Context construction
hubertp 339493c
Add missing Akka entries in reflect-config
hubertp b6015e7
nit
hubertp cf8a3ed
Merge branch 'develop' into wip/hubert/11721-language-server-native
hubertp 96ae8c8
Partial revert
hubertp 8883d5c
Fix service registration
hubertp 60f8ffe
Merge branch 'develop' into wip/hubert/11721-language-server-native
hubertp 28650dd
Fix Base_Tests in native-image
hubertp cd0a8d8
Fix compilation issues
hubertp ebaf50c
Drop Truffle dependency
hubertp 08e1e4f
fmt
hubertp 5547b49
Merge branch 'develop' into wip/hubert/11721-language-server-native
hubertp 1588cec
Drop TruffleOptions dependency
hubertp 55f6623
Move NI config to LS resources
hubertp ea2f214
Remove automatically added module dependency
hubertp 6e8c05b
Move AOT Context-creation logic to factory
hubertp 3ce2577
PR review
hubertp e82bb61
Merge branch 'develop' into wip/hubert/11721-language-server-native
hubertp cadf616
Merge branch 'develop' into wip/hubert/11721-language-server-native
hubertp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import org.enso.logger.JulHandler; | ||
import org.enso.logging.config.LoggerSetup; | ||
import org.graalvm.polyglot.Context; | ||
import org.graalvm.polyglot.Engine; | ||
import org.graalvm.polyglot.HostAccess; | ||
import org.graalvm.polyglot.io.MessageTransport; | ||
import org.slf4j.event.Level; | ||
|
@@ -52,6 +53,7 @@ public final class ContextFactory { | |
private String checkForWarnings; | ||
private int warningsLimit = 100; | ||
private java.util.Map<String, String> options = new HashMap<>(); | ||
private java.util.Map<String, String> engineOptions = null; | ||
private boolean enableDebugServer; | ||
|
||
private ContextFactory() {} | ||
|
@@ -145,6 +147,11 @@ public ContextFactory options(Map<String, String> options) { | |
return this; | ||
} | ||
|
||
public ContextFactory engineOptions(Map<String, String> options) { | ||
this.engineOptions = options; | ||
return this; | ||
} | ||
|
||
public ContextFactory checkForWarnings(String fqnOfMethod) { | ||
this.checkForWarnings = fqnOfMethod; | ||
return this; | ||
|
@@ -189,9 +196,6 @@ public Context build() { | |
if (enableDebugServer) { | ||
builder.option(DebugServerInfo.ENABLE_OPTION, "true"); | ||
} | ||
if (messageTransport != null) { | ||
builder.serverTransport(messageTransport); | ||
} | ||
builder.option(RuntimeOptions.LOG_LEVEL, logLevelName); | ||
var logHandler = JulHandler.get(); | ||
var logLevels = LoggerSetup.get().getConfig().getLoggers(); | ||
|
@@ -228,6 +232,19 @@ public Context build() { | |
.allowCreateThread(true); | ||
} | ||
|
||
if (engineOptions != null) { | ||
// In AOT mode one must not use a shared engine; the latter causes issues when initializing | ||
// message transport - it is set to `null`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. I don't see a reason wny transport shouldn't work. Maybe it is a bug. Do we have a (small) reproducer that we could report to GraalVM guys and find out what they think? |
||
var eng = Engine.newBuilder().allowExperimentalOptions(true).options(engineOptions); | ||
|
||
if (messageTransport != null) { | ||
eng.serverTransport(messageTransport); | ||
} | ||
builder.engine(eng.build()); | ||
} else if (messageTransport != null) { | ||
builder.serverTransport(messageTransport); | ||
} | ||
|
||
var ctx = builder.build(); | ||
ContextInsightSetup.configureContext(ctx); | ||
return ctx; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.