Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

WIP: integration tests #23

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

nixel2007
Copy link
Member

Goals:

  • start a TestServer language server
  • Send initialize request to langserver
  • Open files (with requests through LSP)
  • Fire completion event and check the results predefined in TestServer

return CompletableFuture.completedFuture(Collections.singletonList(new TextEdit(this.range0, "Formatted")));
}

public void didOpen(DidOpenTextDocumentParams params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.


public CompletableFuture<List<? extends Location>> references(ReferenceParams params) {
String uri = params.getTextDocument().getUri();
return uri.contains("test1")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define a constant instead of duplicating this literal "test1" 6 times.

public CompletableFuture<List<? extends SymbolInformation>> symbol(WorkspaceSymbolParams params) {
SymbolInformation[] symbols = new SymbolInformation[]{
new SymbolInformation("SymbA", SymbolKind.Class, new Location(this.uris.get(0), this.ranges[4])),
new SymbolInformation("SymbB", SymbolKind.Enum, new Location(this.uris.get(0), this.ranges[2]))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define a constant instead of duplicating this literal "SymbB" 3 times.


public CompletableFuture<List<? extends SymbolInformation>> symbol(WorkspaceSymbolParams params) {
SymbolInformation[] symbols = new SymbolInformation[]{
new SymbolInformation("SymbA", SymbolKind.Class, new Location(this.uris.get(0), this.ranges[4])),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define a constant instead of duplicating this literal "SymbA" 3 times.

return CompletableFuture.completedFuture(new WorkspaceEdit(changes));
}

public CompletableFuture<List<? extends TextEdit>> formatting(DocumentFormattingParams params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove usage of generic wildcard type.

return CompletableFuture.completedFuture(Collections.singletonList(new TextEdit(range, StringUtils.repeat("f", length))));
}

public CompletableFuture<List<? extends Command>> codeAction(CodeActionParams params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove usage of generic wildcard type.

LanguageServer.super.initialized();
}

public CompletableFuture<List<? extends TextEdit>> rangeFormatting(DocumentRangeFormattingParams params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove usage of generic wildcard type.

return CompletableFuture.completedFuture(Either.forRight(new CompletionList(Arrays.asList(completionItems))));
}

public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove usage of generic wildcard type.

this.client.logMessage(new MessageParams(MessageType.Info, "DidSave"));
}

public CompletableFuture<List<? extends Location>> definition(TextDocumentPositionParams position) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove usage of generic wildcard type.

@codeclimate
Copy link

codeclimate bot commented Nov 17, 2018

Code Climate has analyzed commit 13133a1 and detected 107 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 4
Style 80
Clarity 16
Bug Risk 4

Note: there are 17 critical issues.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 0.2% (0.0% change).

View more on Code Climate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant