Lines 1300-1303
Link Here
|
1300 |
"}", |
1300 |
"}", |
1301 |
result.context); |
1301 |
result.context); |
1302 |
} |
1302 |
} |
|
|
1303 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274557 |
1304 |
public void test0041() throws JavaModelException { |
1305 |
this.workingCopies = new ICompilationUnit[2]; |
1306 |
this.workingCopies[0] = getWorkingCopy( |
1307 |
"/Completion/src3/test/X.java", |
1308 |
"package test;\n" + |
1309 |
"public class X {\n" + |
1310 |
" @TestAnnot(value=\"\")\n" + |
1311 |
" public int field = 0;\n" + |
1312 |
"}"); |
1313 |
|
1314 |
this.workingCopies[1] = getWorkingCopy( |
1315 |
"/Completion/src3/test/TestAnnot.java", |
1316 |
"package test;\n" + |
1317 |
"public @interface X {\n" + |
1318 |
" String value();\n" + |
1319 |
"}"); |
1320 |
|
1321 |
String str = this.workingCopies[0].getSource(); |
1322 |
int tokenStart = str.lastIndexOf("\"\""); |
1323 |
int tokenEnd = tokenStart + "\"\"".length() - 1; |
1324 |
int cursorLocation = str.lastIndexOf("value=\"") + "value=\"".length(); |
1325 |
|
1326 |
CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation); |
1327 |
|
1328 |
assertResults( |
1329 |
"completion offset="+(cursorLocation)+"\n" + |
1330 |
"completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" + |
1331 |
"completion token=\"\"\n" + |
1332 |
"completion token kind=TOKEN_KIND_STRING_LITERAL\n" + |
1333 |
"expectedTypesSignatures=null\n" + |
1334 |
"expectedTypesKeys=null\n" + |
1335 |
"completion token location=UNKNOWN", |
1336 |
result.context); |
1337 |
} |
1338 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=274557 |
1339 |
public void test0042() throws JavaModelException { |
1340 |
this.workingCopies = new ICompilationUnit[2]; |
1341 |
this.workingCopies[0] = getWorkingCopy( |
1342 |
"/Completion/src3/test/X.java", |
1343 |
"package test;\n" + |
1344 |
"public class X {\n" + |
1345 |
" @TestAnnot(\"\")\n" + |
1346 |
" public int field = 0;\n" + |
1347 |
"}"); |
1348 |
|
1349 |
this.workingCopies[1] = getWorkingCopy( |
1350 |
"/Completion/src3/test/TestAnnot.java", |
1351 |
"package test;\n" + |
1352 |
"public @interface X {\n" + |
1353 |
" String value();\n" + |
1354 |
"}"); |
1355 |
|
1356 |
String str = this.workingCopies[0].getSource(); |
1357 |
int tokenStart = str.lastIndexOf("\"\""); |
1358 |
int tokenEnd = tokenStart + "\"\"".length() - 1; |
1359 |
int cursorLocation = str.lastIndexOf("@TestAnnot(\"") + "@TestAnnot(\"".length(); |
1360 |
|
1361 |
CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation); |
1362 |
|
1363 |
assertResults( |
1364 |
"completion offset="+(cursorLocation)+"\n" + |
1365 |
"completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" + |
1366 |
"completion token=\"\"\n" + |
1367 |
"completion token kind=TOKEN_KIND_STRING_LITERAL\n" + |
1368 |
"expectedTypesSignatures=null\n" + |
1369 |
"expectedTypesKeys=null\n" + |
1370 |
"completion token location=UNKNOWN", |
1371 |
result.context); |
1372 |
} |
1303 |
} |
1373 |
} |