delete document-related symbols if java file gets deleted

This commit is contained in:
Martin Lippert
2018-01-11 15:10:19 +01:00
parent f29ac415c2
commit 1e6f9a25f4
3 changed files with 12 additions and 2 deletions

View File

@@ -189,6 +189,8 @@ public class BootJavaLanguageServer extends SimpleLanguageServer {
RegistrationParams registrationParams = new RegistrationParams(Collections.singletonList(registration));
getClient().registerCapability(registrationParams);
this.indexer.serverInitialized();
// TODO: due to a missing message from lsp4e this "initialized" is not called in
// the LSP4E case
// if this gets fixed, the code should move here (from "initialize" above)

View File

@@ -140,6 +140,13 @@ public class SpringIndexer {
}
}
public void serverInitialized() {
List<String> globPattern = Arrays.asList("**/*.java");
server.getWorkspaceService().getFileObserver().onFileDeleted(globPattern, (file) -> {
deleteDocument(new TextDocumentIdentifier(file).getUri());
});
}
public CompletableFuture<Void> initialize(Collection<WorkspaceFolder> workspaceRoots) {
synchronized(this) {
try {