Skip to content

Commit

Permalink
Cannot open any css file with the generic editor eclipse#752
Browse files Browse the repository at this point in the history
  • Loading branch information
vrubezhny committed Aug 10, 2023
1 parent 401d10c commit 5cf318f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Red Hat Inc. and others.
* Copyright (c) 2017, 2023 Red Hat Inc. and others.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -255,7 +255,7 @@ private static boolean isOffsetInRange(int offset, Range range, IDocument docume
public void dispose() {
preferences.removePreferenceChangeListener(this);
this.outlineViewer.dispose();
if (textEditorViewer != null) {
if (textEditorViewer != null && editorSelectionChangedListener != null) {
editorSelectionChangedListener.uninstall(textEditorViewer.getSelectionProvider());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,18 @@ public static final class OutlineViewerInput {
public OutlineViewerInput(IDocument document, @NonNull LanguageServerWrapper wrapper, @Nullable ITextEditor textEditor) {
this.document = document;
IPath path = LSPEclipseUtils.toPath(document);
TextDocumentIdentifier docIdentifier = LSPEclipseUtils.toTextDocumentIdentifier(document);
if (path == null) {
documentFile = null;
URI uri;
// Set the documentURI if valid URI for LSs that use custom protocols e.g. jdt://
try {
uri = new URI(docIdentifier.getUri());
} catch (URISyntaxException e) {
uri = null;
URI uri = null;
URI docUri = LSPEclipseUtils.toUri(document);
if (docUri != null) {
TextDocumentIdentifier docIdentifier = LSPEclipseUtils.toTextDocumentIdentifier(docUri);
// Set the documentURI if valid URI for LSs that use custom protocols e.g. jdt://
try {
uri = new URI(docIdentifier.getUri());
} catch (URISyntaxException e) {
// Ignore
}
}
documentURI = uri;
} else {
Expand Down

0 comments on commit 5cf318f

Please sign in to comment.