forked from eclipse-lsp4j/lsp4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Infinite completionItem/resolve when documentation for completion
returns nothing Fixes eclipse-lsp4j#182 Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
9c6b341
commit 3fc3d44
Showing
10 changed files
with
298 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/redhat/devtools/lsp4ij/features/completion/CompletionData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.features.completion; | ||
|
||
import com.redhat.devtools.lsp4ij.LanguageServerItem; | ||
import org.eclipse.lsp4j.CompletionItem; | ||
import org.eclipse.lsp4j.CompletionList; | ||
import org.eclipse.lsp4j.jsonrpc.messages.Either; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* LSP completion data. | ||
* | ||
* @param completion the LSP completion result | ||
* @param languageServer the language server which has created the completion result. | ||
*/ | ||
record CompletionData(@NotNull Either<List<CompletionItem>, CompletionList> completion, | ||
@NotNull LanguageServerItem languageServer) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/redhat/devtools/lsp4ij/features/completion/LSPCompletionParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, | ||
* and is available at https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.features.completion; | ||
|
||
import org.eclipse.lsp4j.CompletionParams; | ||
import org.eclipse.lsp4j.Position; | ||
import org.eclipse.lsp4j.TextDocumentIdentifier; | ||
|
||
/** | ||
* LSP completion parameters which hosts the offset where completion has been triggered. | ||
*/ | ||
public class LSPCompletionParams extends CompletionParams { | ||
|
||
// Use transient to avoid serializing the fields when GSON will be processed | ||
private transient final int offset; | ||
|
||
public LSPCompletionParams(TextDocumentIdentifier textDocument, Position position, int offset) { | ||
super.setTextDocument(textDocument); | ||
super.setPosition(position); | ||
this.offset = offset; | ||
} | ||
|
||
public int getOffset() { | ||
return offset; | ||
} | ||
} |
Oops, something went wrong.