mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[lsp] IJPL-189555 Introduce LSP-backed highlight usages (document highlights) feature
Merge-request: IJ-MR-176039 Merged-by: Vladimir Goncharov <vladimir.goncharov@jetbrains.com> GitOrigin-RevId: 118f6df4d2dd490fc60af2afe6547dc71865a0e5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cbd3c3b600
commit
e228f691bb
+4
-1
@@ -250,7 +250,10 @@ class IdentifierHighlightingComputer(
|
||||
|
||||
private fun findTarget(editor: Editor, file: PsiFile, myCaretOffset: Int): PsiElement? {
|
||||
val offset = TargetElementUtil.adjustOffset(file, editor.getDocument(), myCaretOffset)
|
||||
return file.findElementAt(offset)
|
||||
val psiElement = file.findElementAt(offset)
|
||||
// LSP has an edge case when it tries to highlight a file with no (finegrained) PSI, where the only PSI element is the whole file.
|
||||
// In this situation we wouldn't want to cache the whole file as an underlying identifier
|
||||
return if (psiElement != null && psiElement.textRange == file.textRange) null else psiElement
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user