use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class PrepareRenameTest method testPrepareRenameFqn_missing_file_null.
@Test
public void testPrepareRenameFqn_missing_file_null() throws Exception {
String uri = uriExtensions.toUriString(new File("missing." + fileExtension).toURI().normalize());
initializeWithPrepareSupport();
PrepareRenameParams params = new PrepareRenameParams(new TextDocumentIdentifier(uri), new Position(2, 5));
Assert.assertNull(languageServer.prepareRename(params).get());
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class PrepareRenameTest method testPrepareRenameFqn_end_null.
@Test
public void testPrepareRenameFqn_end_null() throws Exception {
String model = "package foo.bar {\n" + " type A {\n" + " foo.bar.MyType bar\n" + " }\n" + " type MyType { }\n" + "}\n";
initialize();
String uri = writeFile("my-type-valid.testlang", model);
PrepareRenameParams params = new PrepareRenameParams(new TextDocumentIdentifier(uri), new Position(2, 18));
Assert.assertNull(languageServer.prepareRename(params).get());
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class PrepareRenameTest method testPrepareRenameFqn_before_nok.
@Test
public void testPrepareRenameFqn_before_nok() throws Exception {
String model = "package foo.bar {\n" + " type A {\n" + " foo.bar.MyType bar\n" + " }\n" + " type MyType { }\n" + "}\n";
initializeWithPrepareSupport();
String uri = writeFile("my-type-valid.testlang", model);
PrepareRenameParams params = new PrepareRenameParams(new TextDocumentIdentifier(uri), new Position(2, 11));
Assert.assertNull(languageServer.prepareRename(params).get());
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class PrepareRenameTest method testRenameFqn_invalid_null.
@Test
public void testRenameFqn_invalid_null() throws Exception {
String model = "package foo.bar {\n" + " type A {\n" + " foo.bar.MyType bar\n" + " }\n" + " type MyType { }\n" + "}\n";
String uri = writeFile("my-type-invalid.testlang", model);
initializeWithPrepareSupport();
RenameParams params = new RenameParams(new TextDocumentIdentifier(uri), new Position(2, 5), "Does not matter");
Assert.assertNull(languageServer.rename(params).get());
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class RenamePositionTest method testBeyondEndOfFile.
@Test
public void testBeyondEndOfFile() {
String model = "type Test";
renameAndFail(model, new Position(0, model.length() + 1), "Invalid document position");
}
Aggregations