Skip to content

Commit

Permalink
feat: update to lsp4mp 0.8.0 and quarkus-ls 0.15.0
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon authored and angelozerr committed Jun 30, 2023
1 parent 795b56e commit 561ae2d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
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) {
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);
}
}

0 comments on commit 561ae2d

Please sign in to comment.