Search in sources :

Example 1 with WorkspaceFoldersChangeEvent

use of org.eclipse.lsp4j.WorkspaceFoldersChangeEvent in project sts4 by spring-projects.

the class SimpleWorkspaceService method didChangeWorkspaceFolders.

@Override
public synchronized void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {
    WorkspaceFoldersChangeEvent evt = params.getEvent();
    boolean changed = false;
    for (WorkspaceFolder r : evt.getAdded()) {
        workspaceRoots.add(r);
        changed = true;
    }
    for (WorkspaceFolder r : evt.getRemoved()) {
        workspaceRoots.remove(r);
        changed = true;
    }
    if (changed) {
        workspaceFolderListeners.fire(params);
    }
}
Also used : WorkspaceFoldersChangeEvent(org.eclipse.lsp4j.WorkspaceFoldersChangeEvent) WorkspaceFolder(org.eclipse.lsp4j.WorkspaceFolder)

Aggregations

WorkspaceFolder (org.eclipse.lsp4j.WorkspaceFolder)1 WorkspaceFoldersChangeEvent (org.eclipse.lsp4j.WorkspaceFoldersChangeEvent)1