diff --git a/org.eclipse.lsp4e/META-INF/MANIFEST.MF b/org.eclipse.lsp4e/META-INF/MANIFEST.MF index 722e35ebc..1168ef015 100644 --- a/org.eclipse.lsp4e/META-INF/MANIFEST.MF +++ b/org.eclipse.lsp4e/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Language Server Protocol client for Eclipse IDE (Incubation) Bundle-SymbolicName: org.eclipse.lsp4e;singleton:=true -Bundle-Version: 0.19.12.qualifier +Bundle-Version: 0.19.13.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-21 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0", org.eclipse.equinox.common;bundle-version="3.8.0", diff --git a/org.eclipse.lsp4e/pom.xml b/org.eclipse.lsp4e/pom.xml index d369028eb..00bc8584b 100644 --- a/org.eclipse.lsp4e/pom.xml +++ b/org.eclipse.lsp4e/pom.xml @@ -10,7 +10,7 @@ org.eclipse.lsp4e eclipse-plugin - 0.19.12-SNAPSHOT + 0.19.13-SNAPSHOT diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java index 4a8360400..9905e114d 100644 --- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java +++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java @@ -31,6 +31,7 @@ import java.io.OutputStream; import java.lang.reflect.Method; import java.net.URI; +import java.nio.file.FileSystemNotFoundException; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; @@ -432,12 +433,15 @@ public static CallHierarchyPrepareParams toCallHierarchyPrepareParams(int offset } public static @Nullable String getFileName(URI uri) { + final java.nio.file.Path path; try { - return java.nio.file.Path.of(uri).getFileName().toString(); - } catch (Exception e) { + path = java.nio.file.Path.of(uri); + } catch (IllegalArgumentException | FileSystemNotFoundException e) { LanguageServerPlugin.logWarning("Failed to parse file name from URI " + uri, e); //$NON-NLS-1$ + return null; } - return null; + java.nio.file.Path fileName = path.getFileName(); + return fileName == null ? null : fileName.toString(); } public static int toEclipseMarkerSeverity(@Nullable DiagnosticSeverity lspSeverity) {