Search in sources :

Example 1 with DidCloseTextDocumentParams

use of org.eclipse.lsp4j.DidCloseTextDocumentParams in project sonarlint-core by SonarSource.

the class ServerMainTest method cleanDiagnosticsOnClose.

@Test
public void cleanDiagnosticsOnClose() throws Exception {
    String uri = getUri("foo.js");
    lsProxy.getTextDocumentService().didClose(new DidCloseTextDocumentParams(new TextDocumentIdentifier(uri)));
    assertThat(waitForDiagnostics(uri)).isEmpty();
}
Also used : TextDocumentIdentifier(org.eclipse.lsp4j.TextDocumentIdentifier) VersionedTextDocumentIdentifier(org.eclipse.lsp4j.VersionedTextDocumentIdentifier) DidCloseTextDocumentParams(org.eclipse.lsp4j.DidCloseTextDocumentParams) Test(org.junit.Test)

Example 2 with DidCloseTextDocumentParams

use of org.eclipse.lsp4j.DidCloseTextDocumentParams in project xtext-core by eclipse.

the class AbstractLanguageServerTest method close.

protected void close(final String fileUri) {
    DidCloseTextDocumentParams _didCloseTextDocumentParams = new DidCloseTextDocumentParams();
    final Procedure1<DidCloseTextDocumentParams> _function = (DidCloseTextDocumentParams it) -> {
        TextDocumentIdentifier _textDocumentIdentifier = new TextDocumentIdentifier(fileUri);
        it.setTextDocument(_textDocumentIdentifier);
    };
    DidCloseTextDocumentParams _doubleArrow = ObjectExtensions.<DidCloseTextDocumentParams>operator_doubleArrow(_didCloseTextDocumentParams, _function);
    this.languageServer.didClose(_doubleArrow);
}
Also used : TextDocumentIdentifier(org.eclipse.lsp4j.TextDocumentIdentifier) DidCloseTextDocumentParams(org.eclipse.lsp4j.DidCloseTextDocumentParams)

Example 3 with DidCloseTextDocumentParams

use of org.eclipse.lsp4j.DidCloseTextDocumentParams in project eclipse.jdt.ls by eclipse.

the class DocumentLifeCycleHandlerTest method closeDocument.

private void closeDocument(ICompilationUnit cu) {
    DidCloseTextDocumentParams closeParms = new DidCloseTextDocumentParams();
    TextDocumentIdentifier textDocument = new TextDocumentIdentifier();
    textDocument.setUri(JDTUtils.toURI(cu));
    closeParms.setTextDocument(textDocument);
    lifeCycleHandler.didClose(closeParms);
}
Also used : TextDocumentIdentifier(org.eclipse.lsp4j.TextDocumentIdentifier) VersionedTextDocumentIdentifier(org.eclipse.lsp4j.VersionedTextDocumentIdentifier) DidCloseTextDocumentParams(org.eclipse.lsp4j.DidCloseTextDocumentParams)

Aggregations

DidCloseTextDocumentParams (org.eclipse.lsp4j.DidCloseTextDocumentParams)3 TextDocumentIdentifier (org.eclipse.lsp4j.TextDocumentIdentifier)3 VersionedTextDocumentIdentifier (org.eclipse.lsp4j.VersionedTextDocumentIdentifier)2 Test (org.junit.Test)1