added missing pieces to register boot ls for general xml file usage and get notified for changes to xml files
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
contentType="org.eclipse.jdt.core.javaSource"
|
||||
id="org.eclipse.languageserver.languages.springboot">
|
||||
</contentTypeMapping>
|
||||
<contentTypeMapping
|
||||
contentType="org.eclipse.core.runtime.xml"
|
||||
id="org.eclipse.languageserver.languages.springboot">
|
||||
</contentTypeMapping>
|
||||
<contentTypeMapping
|
||||
contentType="org.springframework.boot.ide.properties.application.properties"
|
||||
id="org.eclipse.languageserver.languages.springboot"
|
||||
|
||||
@@ -120,6 +120,7 @@ public class DelegatingStreamConnectionProvider implements StreamConnectionProvi
|
||||
// Add resource listener
|
||||
ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceListener = new ResourceListener(languageServer, Arrays.asList(
|
||||
FileSystems.getDefault().getPathMatcher("glob:**/pom.xml"),
|
||||
FileSystems.getDefault().getPathMatcher("glob:**/*.xml"),
|
||||
FileSystems.getDefault().getPathMatcher("glob:**/*.gradle"),
|
||||
FileSystems.getDefault().getPathMatcher("glob:**/*.java"),
|
||||
FileSystems.getDefault().getPathMatcher("glob:**/*.json"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2017, 2018 Pivotal, Inc.
|
||||
* Copyright (c) 2017, 2019 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -190,8 +190,17 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static void addBootRangeHighlightSupport(IEditorPart editor, ISourceViewer sourceViewer) {
|
||||
if (editor instanceof AbstractDecoratedTextEditor) {
|
||||
addBootRangeHighlightSupport((AbstractDecoratedTextEditor)editor, sourceViewer);
|
||||
}
|
||||
// else if () {
|
||||
// // TODO: XML multi page editor handling for highlight support of XML source editor
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static void addBootRangeHighlightSupport(AbstractDecoratedTextEditor editor, ISourceViewer sourceViewer) {
|
||||
try {
|
||||
Field f = AbstractDecoratedTextEditor.class.getDeclaredField("fSourceViewerDecorationSupport");
|
||||
f.setAccessible(true);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.commons.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
@@ -152,6 +152,9 @@ public class SpringSymbolIndex {
|
||||
getWorkspaceService().getFileObserver().onFileCreated(globPattern, (file) -> {
|
||||
createDocument(new TextDocumentIdentifier(file).getUri());
|
||||
});
|
||||
getWorkspaceService().getFileObserver().onFileChanged(globPattern, (file) -> {
|
||||
updateDocument(new TextDocumentIdentifier(file).getUri(), null);
|
||||
});
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
@@ -259,6 +262,10 @@ public class SpringSymbolIndex {
|
||||
Optional<IJavaProject> maybeProject = projectFinder.find(new TextDocumentIdentifier(docURI));
|
||||
if (maybeProject.isPresent()) {
|
||||
try {
|
||||
if (content == null) {
|
||||
content = FileUtils.readFileToString(new File(new URI(docURI)));
|
||||
}
|
||||
|
||||
UpdateItem updateItem = new UpdateItem(maybeProject.get(), docURI, content, indexer);
|
||||
futures.add(CompletableFuture.runAsync(updateItem, this.updateQueue));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user