Search in sources :

Example 1 with IdeTestLanguageClient

use of org.eclipse.n4js.ide.tests.helper.client.IdeTestLanguageClient in project n4js by eclipse.

the class AccessControlTest method compile.

/**
 * Compiles the projects generated into the path at {@link #FIXTURE_ROOT}, which in this test case the projects
 * representing the currently tested scenario and returns the generated issues.
 *
 * @return the generated issues
 */
private static Collection<Issue> compile() {
    IdeTestLanguageClient languageClient = testLspManager.getLanguageClient();
    languageClient.clearIssues();
    testLspManager.cleanBuildAndWait();
    IssueToDiagnosticConverter converter = new IssueToDiagnosticConverter();
    List<Issue> issues = new ArrayList<>();
    for (Map.Entry<FileURI, Diagnostic> uriDiagnostic : languageClient.getIssues().entries()) {
        FileURI uri = uriDiagnostic.getKey();
        Diagnostic diagnostic = uriDiagnostic.getValue();
        issues.add(converter.toIssue(uri.toURI(), diagnostic, Optional.absent()));
    }
    return issues;
}
Also used : IdeTestLanguageClient(org.eclipse.n4js.ide.tests.helper.client.IdeTestLanguageClient) FileURI(org.eclipse.n4js.workspace.locations.FileURI) Issue(org.eclipse.xtext.validation.Issue) ArrayList(java.util.ArrayList) Diagnostic(org.eclipse.lsp4j.Diagnostic) IssueToDiagnosticConverter(org.eclipse.n4js.xtext.ide.server.issues.IssueToDiagnosticConverter) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Diagnostic (org.eclipse.lsp4j.Diagnostic)1 IdeTestLanguageClient (org.eclipse.n4js.ide.tests.helper.client.IdeTestLanguageClient)1 FileURI (org.eclipse.n4js.workspace.locations.FileURI)1 IssueToDiagnosticConverter (org.eclipse.n4js.xtext.ide.server.issues.IssueToDiagnosticConverter)1 Issue (org.eclipse.xtext.validation.Issue)1