use of org.eclipse.lsp4j.DidChangeConfigurationParams in project sts4 by spring-projects.
the class ManifestYamlLanguageServerTest method changeCfClientParams.
@Test
public void changeCfClientParams() throws Exception {
MockCloudfoundry cloudfoundry = new MockCloudfoundry();
ManifestYamlLanguageServer manifestYamlLanguageServer = new ManifestYamlLanguageServer(cloudfoundry.factory, cloudfoundry.defaultParamsProvider);
LanguageServerHarness harness = new LanguageServerHarness(() -> manifestYamlLanguageServer, LanguageId.CF_MANIFEST);
harness.intialize(null);
assertEquals(1, manifestYamlLanguageServer.getCfClientConfig().getClientParamsProvider().getParams().size());
assertEquals(Arrays.asList("test.io"), manifestYamlLanguageServer.getCfTargets());
DidChangeConfigurationParams params = new DidChangeConfigurationParams();
JsonParser parser = new JsonParser();
params.setSettings(parser.parse(new InputStreamReader(getClass().getResourceAsStream("/cf-targets1.json"))));
manifestYamlLanguageServer.getWorkspaceService().didChangeConfiguration(params);
assertEquals(3, manifestYamlLanguageServer.getCfClientConfig().getClientParamsProvider().getParams().size());
assertEquals(Arrays.asList("test.io", "api.system.demo-gcp.springapps.io", "api.run.pivotal.io"), manifestYamlLanguageServer.getCfTargets());
}
Aggregations