diff --git a/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target b/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target index 610c28d757..36715b70d8 100644 --- a/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target +++ b/org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target @@ -31,7 +31,7 @@ - + diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java index f563d7371b..b1d44debb1 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java @@ -1189,6 +1189,31 @@ public void testSnippet_if2() throws JavaModelException { assertTrue(items.size() > 1); } + // https://github.com/eclipse/eclipse.jdt.ls/issues/1811 + @Test + public void testSnippet_multiline_string() throws JavaModelException { + //@formatter:off + ICompilationUnit unit = getWorkingCopy( + "src/org/sample/Test.java", + "package org.sample;\n" + + "public class Test {\n" + + " public void test () {\n" + + " String foo = \"\"\"\n" + + " test1\n" + + " test2\n" + + " test3\n" + + " \"\"\".;\n" + + " }\n" + + "}" + ); + //@formatter:on + int[] loc = findCompletionLocation(unit, "\"."); + CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight(); + assertNotNull(list); + List items = new ArrayList<>(list.getItems()); + assertTrue(items.size() > 0); + } + @Test public void testSnippet_ifelse() throws JavaModelException { //@formatter:off