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

🐛 use custom startup for jdtls #749

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 minor fix
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
  • Loading branch information
pranavgaikwad committed Dec 13, 2024
commit 7c9264cfdcba8f276f4da0b7defe209e5e0e21af
Original file line number Diff line number Diff line change
@@ -349,27 +349,30 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide

jdtlsBasePath, err := filepath.Abs(filepath.Dir(filepath.Dir(lspServerPath)))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this works because everything is already configured to use the launcher.

In the future, we may have some sort of check if we ever want to change this

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

if err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("failed finding jdtls base path - %w", err)
}

sharedConfigPath, err := getSharedConfigPath(jdtlsBasePath)
if err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("failed to get shared config path - %w", err)
}

jarPath, err := findEquinoxLauncher(jdtlsBasePath)
if err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("failed to find equinox launcher - %w", err)
}

javaExec, err := getJavaExecutable(true)
if err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("failed getting java executable - %v", err)
}

jdtlsArgs := []string{
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Djava.net.useSystemProxies=true",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dosgi.checkConfiguration=true",
@@ -382,8 +385,9 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
"-jar", jarPath,
"-data", workspace,
"-Djava.net.useSystemProxies=true",
"-configuration", "./",
"-data", workspace,
}

if val, ok := config.ProviderSpecificConfig[JVM_MAX_MEM_INIT_OPTION].(string); ok && val != "" {