Merge branch 'master' of github.com:spring-projects/sts4

This commit is contained in:
Kris De Volder
2017-07-26 10:58:25 -07:00
4 changed files with 29 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
},
"main": "./dist/index",
"dependencies": {
"atom-languageclient": "0.1.3",
"atom-languageclient": "https://github.com/atom/atom-languageclient#master",
"decompress": "^4.2.0",
"portfinder": "^1.0.13",
"remote-file-size": "^3.0.3",

View File

@@ -43,6 +43,7 @@ class ManifestYamlLanguageClient extends JarLanguageClient {
launchVmArgs(version) {
return [
'-Dlsp.yaml.completions.errors.disable=true',
'-Xdebug',
'-agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n',
'-Dorg.slf4j.simpleLogger.logFile=manifest-yaml.log',

View File

@@ -201,7 +201,11 @@ public class YTypeAssistContext extends AbstractYamlAssistContext {
try {
values = typeUtil.getHintValues(type, getSchemaContext());
} catch (Exception e) {
return ImmutableList.of(completionFactory().errorMessage(query, getMessage(e)));
if (!Boolean.getBoolean("lsp.yaml.completions.errors.disable")) {
return ImmutableList.of(completionFactory().errorMessage(query, getMessage(e)));
} else {
Log.warn(query, e);
}
}
if (values!=null) {
ArrayList<ICompletionProposal> completions = new ArrayList<>();

View File

@@ -24,7 +24,6 @@ import org.eclipse.lsp4j.CompletionItem;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.ide.vscode.commons.cloudfoundry.client.CFBuildpack;
@@ -52,6 +51,7 @@ public class ManifestYamlEditorTest {
LanguageId.CF_MANIFEST
);
harness.intialize(null);
System.setProperty("lsp.yaml.completions.errors.disable", "false");
}
@Test public void testReconcileCatchesParseError() throws Exception {
@@ -1143,6 +1143,27 @@ public class ManifestYamlEditorTest {
}
@Test
public void servicesContentAssistWhenNotLoggedIn_ErrorProposalsDisabled() throws Exception {
System.setProperty("lsp.yaml.completions.errors.disable", "true");
reset(cloudfoundry.defaultParamsProvider);
when(cloudfoundry.defaultParamsProvider.getParams()).thenThrow(new NoTargetsException("No Cloudfoundry Targets: Please login"));
String textBefore =
"applications:\n" +
"- name: foo\n" +
" services:\n" +
" - <*>";
Editor editor = harness.newEditor(
textBefore
);
//Applying the single completion should do nothing in the editor:
assertEquals(0, editor.assertCompletions().size());
}
@Test
public void servicesContentAssistShowErrorMessageWhenNotLoggedIn_nonEmptyQueryString() throws Exception {
reset(cloudfoundry.defaultParamsProvider);