-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: HTML completion / autoclose is broken when offset is inside a Qute
section (#787) Fixes #787 Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
2496768
commit ab7e83f
Showing
48 changed files
with
2,026 additions
and
258 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
15 changes: 15 additions & 0 deletions
15
...va/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSPCompletionConfidence.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,15 @@ | ||
package com.redhat.devtools.intellij.lsp4ij.operations.completion; | ||
|
||
import com.intellij.codeInsight.completion.CompletionConfidence; | ||
import com.intellij.psi.PsiElement; | ||
import com.intellij.psi.PsiFile; | ||
import com.intellij.util.ThreeState; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class LSPCompletionConfidence extends CompletionConfidence { | ||
|
||
@Override | ||
public @NotNull ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) { | ||
return ThreeState.NO; | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
...java/com/redhat/devtools/intellij/lsp4ij/operations/highlight/LSPHighlightPsiElement.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,84 @@ | ||
package com.redhat.devtools.intellij.lsp4ij.operations.highlight; | ||
|
||
import com.intellij.lang.ASTNode; | ||
import com.intellij.lang.Language; | ||
import com.intellij.openapi.editor.Document; | ||
import com.intellij.openapi.util.NlsSafe; | ||
import com.intellij.openapi.util.TextRange; | ||
import com.intellij.psi.PsiElement; | ||
import com.intellij.psi.impl.PsiElementBase; | ||
import com.redhat.devtools.intellij.lsp4ij.LSPIJUtils; | ||
import org.eclipse.lsp4j.DocumentHighlight; | ||
import org.eclipse.lsp4j.DocumentHighlightKind; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class LSPHighlightPsiElement extends PsiElementBase { | ||
|
||
private final TextRange textRange; | ||
private final DocumentHighlightKind kind; | ||
|
||
public LSPHighlightPsiElement(TextRange textRange, DocumentHighlightKind kind) { | ||
this.textRange = textRange; | ||
this.kind = kind; | ||
} | ||
|
||
public DocumentHighlightKind getKind() { | ||
return kind; | ||
} | ||
|
||
@Override | ||
public @NotNull Language getLanguage() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public PsiElement @NotNull [] getChildren() { | ||
return new PsiElement[0]; | ||
} | ||
|
||
@Override | ||
public PsiElement getParent() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public TextRange getTextRange() { | ||
return textRange; | ||
} | ||
|
||
@Override | ||
public int getStartOffsetInParent() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getTextLength() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public @Nullable PsiElement findElementAt(int offset) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int getTextOffset() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public @NlsSafe String getText() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public char @NotNull [] textToCharArray() { | ||
return new char[0]; | ||
} | ||
|
||
@Override | ||
public ASTNode getNode() { | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.