-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathLibertyWorkspaceService.java
45 lines (38 loc) · 1.65 KB
/
LibertyWorkspaceService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*******************************************************************************
* Copyright (c) 2020, 2023 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package io.openliberty.tools.langserver;
import java.util.logging.Logger;
import org.eclipse.lsp4j.DidChangeConfigurationParams;
import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
import org.eclipse.lsp4j.FileEvent;
import org.eclipse.lsp4j.services.WorkspaceService;
public class LibertyWorkspaceService implements WorkspaceService {
private final LibertyLanguageServer libertyLanguageServer;
private static final Logger LOGGER = Logger.getLogger(LibertyWorkspaceService.class.getName());
public LibertyWorkspaceService(LibertyLanguageServer libertyls) {
this.libertyLanguageServer = libertyls;
}
@Override
public void didChangeConfiguration(DidChangeConfigurationParams params) {
libertyLanguageServer.updateSettings(params.getSettings());
}
@Override
public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) {
for (FileEvent change : params.getChanges()) {
String uri = change.getUri();
if (uri.endsWith(LibertyConfigFileManager.LIBERTY_PLUGIN_CONFIG_XML)) {
LibertyConfigFileManager.processLibertyPluginConfigXml(uri);
}
}
}
}