类org.eclipse.lsp4j.DidChangeWorkspaceFoldersParams源码实例Demo

下面列出了怎么用org.eclipse.lsp4j.DidChangeWorkspaceFoldersParams的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: intellij-quarkus   文件: LanguageServerWrapper.java
private synchronized void unwatchProject(@Nonnull Module project) {
    this.allWatchedProjects.remove(project);
    // TODO? disconnect resources?
    if (supportsWorkspaceFolderCapability()) {
        WorkspaceFoldersChangeEvent event = new WorkspaceFoldersChangeEvent();
        event.getRemoved().add(LSPIJUtils.toWorkspaceFolder(project));
        DidChangeWorkspaceFoldersParams params = new DidChangeWorkspaceFoldersParams();
        params.setEvent(event);
        this.languageServer.getWorkspaceService().didChangeWorkspaceFolders(params);
    }
}
 
源代码2 项目: MSPaintIDE   文件: DefaultLanguageServerWrapper.java
public DefaultLanguageServerWrapper(StartupLogic startupLogic, LSP lsp, String serverPath, List<String> lspArgs, BiConsumer<LanguageServerWrapper, File> workspaceInit) {
    this.documentManager = new DefaultDocumentManager(this, startupLogic);
    this.startupLogic = startupLogic;
    this.fileWatchManager = startupLogic.getFileWatchManager();
    this.lsp = lsp;
    this.serverPath = () -> serverPath;
    this.lspArgs = lspArgs;
    this.workspaceInit = workspaceInit;

    if (!lsp.usesWorkspaces()) return;
    this.workspaces.addListener((ListChangeListener<WorkspaceFolder>) change -> {
        var added = new ArrayList<WorkspaceFolder>();
        var removed = new ArrayList<WorkspaceFolder>();

        while (change.next()) {
            added.addAll(change.getAddedSubList());
            removed.addAll(change.getRemoved());
        }

        LOGGER.info("Adding: {}  Removing: {}", added, removed);

        this.languageServer.getWorkspaceService().didChangeWorkspaceFolders(
                new DidChangeWorkspaceFoldersParams(
                        new WorkspaceFoldersChangeEvent(
                                added,
                                removed)));
    });
}
 
源代码3 项目: xtext-core   文件: LanguageServerImpl.java
/**
 * @since 2.21
 */
@Override
public void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {
	requestManager.runWrite(() -> {
		workspaceManager.didChangeWorkspaceFolders(params, CancelIndicator.NullImpl);
		return null;
	}, (a, b) -> null);
}
 
源代码4 项目: xtext-core   文件: WorkspaceManager.java
/**
 * Updates the workspace folders and refreshes the workspace.
 * 
 * @since 2.21
 */
public void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params, CancelIndicator cancelIndicator) {
	WorkspaceFoldersChangeEvent event = params.getEvent();
	Map<String, WorkspaceFolder> uri2workspaceFolder = new HashMap<>();
	workspaceFolders.forEach(it -> uri2workspaceFolder.put(it.getUri(), it));
	event.getRemoved().forEach(it -> uri2workspaceFolder.remove(it.getUri()));
	event.getAdded().forEach(it -> {
		if (!uri2workspaceFolder.containsKey(it.getUri())) 
			uri2workspaceFolder.put(it.getUri(), it);
	});
	this.workspaceFolders = new ArrayList<>(uri2workspaceFolder.values());
	refreshWorkspaceConfig(cancelIndicator);
}
 
源代码5 项目: eclipse.jdt.ls   文件: JDTLanguageServer.java
@Override
public void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {
	logInfo(">> java/didChangeWorkspaceFolders");
	WorkspaceFolderChangeHandler handler = new WorkspaceFolderChangeHandler(pm, preferenceManager);
	handler.update(params);
}
 
源代码6 项目: eclipse.jdt.ls   文件: SyntaxLanguageServer.java
@Override
public void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {
	logInfo(">> java/didChangeWorkspaceFolders");
	WorkspaceFolderChangeHandler handler = new WorkspaceFolderChangeHandler(projectsManager, preferenceManager);
	handler.update(params);
}
 
源代码7 项目: lsp4j   文件: WorkspaceService.java
/**
 * The workspace/didChangeWorkspaceFolders notification is sent from the client
 * to the server to inform the server about workspace folder configuration changes.
 * The notification is sent by default if both ServerCapabilities/workspaceFolders
 * and ClientCapabilities/workspace/workspaceFolders are true; or if the server has
 * registered to receive this notification it first.
 */
@JsonNotification
default void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params) {}
 
 类所在包
 类方法
 同包方法