There was an error while loading. Please reload this page.
1 parent 536ab9b commit 46bec01Copy full SHA for 46bec01
1 file changed
language-server/src/main/java/com/as3mxml/vscode/utils/LanguageServerCompilerUtils.java
@@ -286,9 +286,16 @@ private static Optional<Path> getFilePath(URI uri) {
286
|| uri.getAuthority() != null
287
|| uri.getPort() != -1) {
288
return Optional.empty();
289
- } else {
290
- return Optional.of(Paths.get(uri));
291
}
+ Path parsedPath = null;
+ try {
292
+ parsedPath = Paths.get(uri);
293
+ } catch (Exception e) {
294
+ // we explicitly detect several invalid parts of the URI above, but
295
+ // there might be some that we missed, so better to be safe.
296
+ return Optional.empty();
297
+ }
298
+ return Optional.of(parsedPath);
299
300
301
public static CompletionItemKind getCompletionItemKindFromDefinition(IDefinition definition) {
0 commit comments