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

feat: update to lsp4mp 0.8.0 and quarkus-ls 0.15.0 #986

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ projectVersion=1.21.1-SNAPSHOT
jetBrainsToken=invalid
jetBrainsChannel=stable
quarkusVersion=3.1.2.Final
lsp4mpVersion=0.7.1
quarkusLsVersion=0.14.1
lsp4mpVersion=0.8.0
quarkusLsVersion=0.15.0
kotlin.stdlib.default.dependency = false
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vfs.VirtualFile;
import com.redhat.devtools.intellij.lsp4ij.server.StreamConnectionProvider;
import org.eclipse.lsp4j.ServerCapabilities;
import org.eclipse.lsp4j.TextDocumentIdentifier;
import org.eclipse.lsp4j.services.LanguageServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -586,6 +588,8 @@ public CompletableFuture<List<Pair<LanguageServerWrapper, LanguageServer>>> getL
res.add(new Pair(wrapper, server));
}
})).toArray(CompletableFuture[]::new)).thenApply(theVoid -> res);
} catch (final ProcessCanceledException cancellation) {
throw cancellation;
} catch (final Exception e) {
LOGGER.warn(e.getLocalizedMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public ProjectLabelInfoEntry getProjectLabelInfo(MicroProfileJavaProjectLabelsPa
try {
VirtualFile file = utils.findFile(params.getUri());
if (file == null) {
// The uri doesn't belong to an Eclipse project
// The uri doesn't belong to an IDEA project
return ProjectLabelInfoEntry.EMPTY_PROJECT_INFO;
}
Module module = utils.getModule(file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public CompletableFuture<ProjectLabelInfoEntry> getJavaProjectLabels(MicroProfil
return runAsBackground("Computing Java projects labels", monitor -> ProjectLabelManager.getInstance().getProjectLabelInfo(javaParams, PsiUtilsLSImpl.getInstance(getProject())));
}

@Override
public CompletableFuture<List<ProjectLabelInfoEntry>> getAllJavaProjectLabels() {
return runAsBackground("Computing All Java projects labels", monitor -> ProjectLabelManager.getInstance().getProjectLabelInfo(PsiUtilsLSImpl.getInstance(getProject())));
}

@Override
public CompletableFuture<JavaFileInfo> getJavaFileInfo(MicroProfileJavaFileInfoParams javaParams) {
return runAsBackground("Computing Java file info", monitor -> PropertiesManagerForJava.getInstance().fileInfo(javaParams, PsiUtilsLSImpl.getInstance(getProject())));
Expand Down Expand Up @@ -185,4 +190,21 @@ public CompletableFuture<CodeAction> resolveCodeAction(CodeAction unresolved) {
return (CodeAction) PropertiesManagerForJava.getInstance().resolveCodeAction(unresolved, PsiUtilsLSImpl.getInstance(getProject()));
});
}

@Override
public CompletableFuture<JavaCursorContextResult> getJavaCursorContext(MicroProfileJavaCompletionParams params) {
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 method is not used in MP LS, let's keep like this, but I think we should remove it,see eclipse/lsp4mp#408

return runAsBackground("Computing Java Cursor context", monitor -> PropertiesManagerForJava.getInstance().javaCursorContext(params, PsiUtilsLSImpl.getInstance(getProject())));
}

@Override
public CompletableFuture<List<SymbolInformation>> getJavaWorkspaceSymbols(String projectUri) {
//Workspace symbols not supported yet https://github.com/redhat-developer/intellij-quarkus/issues/808
return CompletableFuture.completedFuture(null);
}

@Override
public CompletableFuture<String> getPropertyDocumentation(MicroProfilePropertyDocumentationParams params) {
// Requires porting https://github.com/eclipse/lsp4mp/issues/321 / https://github.com/eclipse/lsp4mp/pull/329
return CompletableFuture.completedFuture(null);
}
}
Loading