From 1b2213c20fc273a6124b370fe066202f59e9adad Mon Sep 17 00:00:00 2001 From: yonip23 Date: Wed, 15 Feb 2023 18:30:20 +0200 Subject: [PATCH 1/3] WIP --- build.gradle | 2 +- .../inline/InlineCompletionHandler.java | 9 +++ .../inline/TabnineDocumentListener.java | 5 ++ src/main/java/com/tabnine/psi/LocationLink.kt | 9 +++ .../tabnine/psi/resolver/ImportsResolver.kt | 68 +++++++++++++++++++ .../psi/resolver/JavaImportsResolver.kt | 9 +++ .../psi/resolver/JavaScriptImportsResolver.kt | 9 +++ .../tabnine/psi/resolver/ResolverFactory.kt | 19 ++++++ .../psi/resolver/TypeScriptImportsResolver.kt | 9 +++ src/main/resources/META-INF/plugin.xml | 4 ++ 10 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/tabnine/psi/LocationLink.kt create mode 100644 src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt create mode 100644 src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt create mode 100644 src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt create mode 100644 src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt create mode 100644 src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt diff --git a/build.gradle b/build.gradle index 80c81bc98..a638e2940 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ test { intellij { version = '2019.3' - type = 'IC' + type = 'IU' updateSinceUntilBuild = false } diff --git a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java index 3f8fc6bdb..f13fee43b 100644 --- a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java +++ b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java @@ -8,6 +8,8 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; import com.intellij.util.ObjectUtils; import com.tabnine.balloon.FirstSuggestionHintTooltip; import com.tabnine.binary.BinaryRequestFacade; @@ -34,6 +36,11 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; + +import com.tabnine.psi.resolver.ImportsResolver; +import com.tabnine.psi.LocationLink; +import com.tabnine.psi.resolver.ImportsResolverKt; +import com.tabnine.psi.resolver.ResolverFactoryKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -62,6 +69,8 @@ public void retrieveAndShowCompletion( @Nullable TabNineCompletion lastShownSuggestion, @NotNull String userInput, @NotNull CompletionAdjustment completionAdjustment) { + List links = ImportsResolverKt.resolveImportsLinks(editor); + Logger.getInstance(getClass()).warn("links: " + links); Integer tabSize = GraphicsUtilsKt.getTabSize(editor); ObjectUtils.doIfNotNull(lastFetchInBackgroundTask, task -> task.cancel(false)); diff --git a/src/main/java/com/tabnine/inline/TabnineDocumentListener.java b/src/main/java/com/tabnine/inline/TabnineDocumentListener.java index c74dfe5e5..1763c36a1 100644 --- a/src/main/java/com/tabnine/inline/TabnineDocumentListener.java +++ b/src/main/java/com/tabnine/inline/TabnineDocumentListener.java @@ -8,12 +8,17 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorKind; import com.intellij.openapi.editor.event.BulkAwareDocumentListener; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.wm.IdeFocusManager; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiReference; import com.tabnine.binary.requests.notifications.shown.SuggestionDroppedReason; import com.tabnine.capabilities.SuggestionsModeService; import com.tabnine.general.CompletionsEventSender; diff --git a/src/main/java/com/tabnine/psi/LocationLink.kt b/src/main/java/com/tabnine/psi/LocationLink.kt new file mode 100644 index 000000000..750bc74aa --- /dev/null +++ b/src/main/java/com/tabnine/psi/LocationLink.kt @@ -0,0 +1,9 @@ +package com.tabnine.psi + +import java.net.URI + +data class Position(val line: Int, val column: Int) + +data class Range(val start: Position, val end: Position) + +data class LocationLink(val targetUri: URI, val targetRange: Range) diff --git a/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt b/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt new file mode 100644 index 000000000..2d765b3ba --- /dev/null +++ b/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt @@ -0,0 +1,68 @@ +package com.tabnine.psi.resolver + +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiDocumentManager +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiFile +import com.tabnine.psi.LocationLink +import com.tabnine.psi.Position +import com.tabnine.psi.Range +import java.net.URI + +abstract class ImportsResolver { + abstract fun potentialElementsPredicate(element: PsiElement): Boolean + + fun resolveImportsLinks(psiFile: PsiFile): List { + return psiFile?.children + ?.filter { potentialElementsPredicate(it) } + ?.flatMap { resolveImportReference(it) } ?: emptyList() + } +} + +fun resolveImportsLinks(editor: Editor): List { + val psiFile = editor.project?.let { PsiDocumentManager.getInstance(it).getPsiFile(editor.document) } ?: return emptyList() + val resolver = getResolver(psiFile) ?: return emptyList() + return resolver.resolveImportsLinks(psiFile) +} + +private fun resolveImportReference(element: PsiElement): List { + element.reference?.let { + it.resolve()?.let { r -> + if (!(r.isValid && r.isWritable)) return emptyList() + val filePath = r.containingFile?.virtualFile?.url?.let { file -> URI.create(file) } ?: return emptyList() + val range = r.textRange ?: return emptyList() + val text = r.containingFile?.text ?: return emptyList() + val linesLengths = linesAccumulativeLengths(text) + val startPos = toLogicalPosition(linesLengths, range.startOffset) ?: return emptyList() + val endPos = toLogicalPosition(linesLengths, range.endOffset) ?: return emptyList() + + return listOf(LocationLink(filePath, Range(startPos, endPos))) + } + } + + return element.children?.flatMap { resolveImportReference(it) } ?: emptyList() +} + +private fun toLogicalPosition(linesLengths: List, offset: Int): Position? { + val line = linesLengths.indexOfFirst { it >= offset } + if (line == -1) { + return null + } + if (line == 0) { + return Position(0, offset) + } + val column = offset - 1 - linesLengths[line - 1] + return Position(line, column) +} + +private fun linesAccumulativeLengths(text: String): List { + val linesLengths = mutableListOf() + var index = text.indexOf('\n') + while (index != -1) { + linesLengths.add(index) + val nextIndex = text.indexOf('\n', index + 1) + index = nextIndex + } + linesLengths.add(text.length) + return linesLengths +} diff --git a/src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt b/src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt new file mode 100644 index 000000000..c70d63597 --- /dev/null +++ b/src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt @@ -0,0 +1,9 @@ +package com.tabnine.psi.resolver + +import com.intellij.psi.PsiElement + +class JavaImportsResolver : ImportsResolver() { + override fun potentialElementsPredicate(element: PsiElement): Boolean { + return element.text.contains("import") + } +} diff --git a/src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt b/src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt new file mode 100644 index 000000000..57395f6f1 --- /dev/null +++ b/src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt @@ -0,0 +1,9 @@ +package com.tabnine.psi.resolver + +import com.intellij.psi.PsiElement + +class JavaScriptImportsResolver : ImportsResolver() { + override fun potentialElementsPredicate(element: PsiElement): Boolean { + return element.text.contains("import") + } +} diff --git a/src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt b/src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt new file mode 100644 index 000000000..40133f73f --- /dev/null +++ b/src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt @@ -0,0 +1,19 @@ +package com.tabnine.psi.resolver + +import com.intellij.lang.Language +import com.intellij.psi.PsiFile + +fun getResolver(psiFile: PsiFile): ImportsResolver? { + return when (psiFile.language) { + Language.findLanguageByID("JAVA") -> { + JavaImportsResolver() + } + Language.findLanguageByID("TypeScript") -> { + TypeScriptImportsResolver() + } + Language.findLanguageByID("ECMAScript 6") -> { + JavaScriptImportsResolver() + } + else -> null + } +} diff --git a/src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt b/src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt new file mode 100644 index 000000000..879f1d53b --- /dev/null +++ b/src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt @@ -0,0 +1,9 @@ +package com.tabnine.psi.resolver + +import com.intellij.psi.PsiElement + +class TypeScriptImportsResolver : ImportsResolver() { + override fun potentialElementsPredicate(element: PsiElement): Boolean { + return element.text.contains("import") + } +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 8403797b5..069e8c58d 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -109,6 +109,10 @@ com.intellij.modules.lang + + + + From 3761cdd6cacc466b3f091227eb8b3302bafcf645 Mon Sep 17 00:00:00 2001 From: yonip23 Date: Wed, 15 Feb 2023 23:02:49 +0200 Subject: [PATCH 2/3] WIP --- .../inline/InlineCompletionHandler.java | 12 ++-- .../psi/importsResolver/ImportsResolver.kt | 69 +++++++++++++++++++ .../JavaImportsResolver.kt | 2 +- .../JavaScriptImportsResolver.kt | 2 +- .../ResolverFactory.kt | 4 +- .../TypeScriptImportsResolver.kt | 2 +- .../tabnine/psi/resolver/ImportsResolver.kt | 68 ------------------ 7 files changed, 79 insertions(+), 80 deletions(-) create mode 100644 src/main/java/com/tabnine/psi/importsResolver/ImportsResolver.kt rename src/main/java/com/tabnine/psi/{resolver => importsResolver}/JavaImportsResolver.kt (84%) rename src/main/java/com/tabnine/psi/{resolver => importsResolver}/JavaScriptImportsResolver.kt (84%) rename src/main/java/com/tabnine/psi/{resolver => importsResolver}/ResolverFactory.kt (81%) rename src/main/java/com/tabnine/psi/{resolver => importsResolver}/TypeScriptImportsResolver.kt (84%) delete mode 100644 src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt diff --git a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java index f13fee43b..4dcb717db 100644 --- a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java +++ b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java @@ -8,8 +8,6 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.psi.PsiDocumentManager; -import com.intellij.psi.PsiFile; import com.intellij.util.ObjectUtils; import com.tabnine.balloon.FirstSuggestionHintTooltip; import com.tabnine.binary.BinaryRequestFacade; @@ -37,10 +35,8 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import com.tabnine.psi.resolver.ImportsResolver; import com.tabnine.psi.LocationLink; -import com.tabnine.psi.resolver.ImportsResolverKt; -import com.tabnine.psi.resolver.ResolverFactoryKt; +import com.tabnine.psi.importsResolver.ImportsResolverKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -69,8 +65,10 @@ public void retrieveAndShowCompletion( @Nullable TabNineCompletion lastShownSuggestion, @NotNull String userInput, @NotNull CompletionAdjustment completionAdjustment) { - List links = ImportsResolverKt.resolveImportsLinks(editor); - Logger.getInstance(getClass()).warn("links: " + links); + long start = System.currentTimeMillis(); + List links = ImportsResolverKt.resolveImportsLinksInFile(editor); + long end = System.currentTimeMillis(); + Logger.getInstance(getClass()).warn("took " + (end - start) + "ms - links: " + links); Integer tabSize = GraphicsUtilsKt.getTabSize(editor); ObjectUtils.doIfNotNull(lastFetchInBackgroundTask, task -> task.cancel(false)); diff --git a/src/main/java/com/tabnine/psi/importsResolver/ImportsResolver.kt b/src/main/java/com/tabnine/psi/importsResolver/ImportsResolver.kt new file mode 100644 index 000000000..8a75eac58 --- /dev/null +++ b/src/main/java/com/tabnine/psi/importsResolver/ImportsResolver.kt @@ -0,0 +1,69 @@ +package com.tabnine.psi.importsResolver + +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiDocumentManager +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiFile +import com.tabnine.psi.LocationLink +import com.tabnine.psi.Position +import com.tabnine.psi.Range +import java.net.URI + +abstract class ImportsResolver { + abstract fun potentialElementsPredicate(element: PsiElement): Boolean + + fun resolveImportsLinksInFile(psiFile: PsiFile): List { + return psiFile.children + ?.filter { potentialElementsPredicate(it) } + ?.flatMap { resolveImportReference(it) } ?: emptyList() + } +} + +fun resolveImportsLinksInFile(editor: Editor): List { + val psiFile = editor.project + ?.let { PsiDocumentManager.getInstance(it).getPsiFile(editor.document) } + ?: return emptyList() + val resolver = getImportsResolver(psiFile) ?: return emptyList() + return resolver.resolveImportsLinksInFile(psiFile) +} + +private fun resolveImportReference(element: PsiElement): List { + val referee = element.reference?.resolve() + ?: return element.children?.flatMap { resolveImportReference(it) } ?: emptyList() + + if (!(referee.isValid && referee.isWritable)) return emptyList() + val filePath = referee.containingFile?.virtualFile?.url?.let(URI::create) ?: return emptyList() + val range = referee.textRange ?: return emptyList() + val text = referee.containingFile?.text ?: return emptyList() + val linesAccumulativeLengths = linesAccumulativeLengths(text) + + val startPos = toLogicalPosition(linesAccumulativeLengths, range.startOffset) ?: return emptyList() + val endPos = toLogicalPosition(linesAccumulativeLengths, range.endOffset) ?: return emptyList() + + return listOf(LocationLink(filePath, Range(startPos, endPos))) +} + +private fun toLogicalPosition(linesAccumulativeLengths: List, offset: Int): Position? { + val line = linesAccumulativeLengths.indexOfFirst { it >= offset } + + if (line == -1) return null + if (line == 0) return Position(0, offset) + + val column = offset - 1 - linesAccumulativeLengths[line - 1] + return Position(line, column) +} + +private fun linesAccumulativeLengths(text: String): List { + val linesAccumulativeLengths = mutableListOf() + var index = text.indexOf('\n') + + while (index != -1) { + linesAccumulativeLengths.add(index) + val nextIndex = text.indexOf('\n', index + 1) + index = nextIndex + } + + linesAccumulativeLengths.add(text.length) + + return linesAccumulativeLengths +} diff --git a/src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt b/src/main/java/com/tabnine/psi/importsResolver/JavaImportsResolver.kt similarity index 84% rename from src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt rename to src/main/java/com/tabnine/psi/importsResolver/JavaImportsResolver.kt index c70d63597..ded3d4d04 100644 --- a/src/main/java/com/tabnine/psi/resolver/JavaImportsResolver.kt +++ b/src/main/java/com/tabnine/psi/importsResolver/JavaImportsResolver.kt @@ -1,4 +1,4 @@ -package com.tabnine.psi.resolver +package com.tabnine.psi.importsResolver import com.intellij.psi.PsiElement diff --git a/src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt b/src/main/java/com/tabnine/psi/importsResolver/JavaScriptImportsResolver.kt similarity index 84% rename from src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt rename to src/main/java/com/tabnine/psi/importsResolver/JavaScriptImportsResolver.kt index 57395f6f1..673c99aa8 100644 --- a/src/main/java/com/tabnine/psi/resolver/JavaScriptImportsResolver.kt +++ b/src/main/java/com/tabnine/psi/importsResolver/JavaScriptImportsResolver.kt @@ -1,4 +1,4 @@ -package com.tabnine.psi.resolver +package com.tabnine.psi.importsResolver import com.intellij.psi.PsiElement diff --git a/src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt b/src/main/java/com/tabnine/psi/importsResolver/ResolverFactory.kt similarity index 81% rename from src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt rename to src/main/java/com/tabnine/psi/importsResolver/ResolverFactory.kt index 40133f73f..c3056f3cd 100644 --- a/src/main/java/com/tabnine/psi/resolver/ResolverFactory.kt +++ b/src/main/java/com/tabnine/psi/importsResolver/ResolverFactory.kt @@ -1,9 +1,9 @@ -package com.tabnine.psi.resolver +package com.tabnine.psi.importsResolver import com.intellij.lang.Language import com.intellij.psi.PsiFile -fun getResolver(psiFile: PsiFile): ImportsResolver? { +fun getImportsResolver(psiFile: PsiFile): ImportsResolver? { return when (psiFile.language) { Language.findLanguageByID("JAVA") -> { JavaImportsResolver() diff --git a/src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt b/src/main/java/com/tabnine/psi/importsResolver/TypeScriptImportsResolver.kt similarity index 84% rename from src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt rename to src/main/java/com/tabnine/psi/importsResolver/TypeScriptImportsResolver.kt index 879f1d53b..e02b061d1 100644 --- a/src/main/java/com/tabnine/psi/resolver/TypeScriptImportsResolver.kt +++ b/src/main/java/com/tabnine/psi/importsResolver/TypeScriptImportsResolver.kt @@ -1,4 +1,4 @@ -package com.tabnine.psi.resolver +package com.tabnine.psi.importsResolver import com.intellij.psi.PsiElement diff --git a/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt b/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt deleted file mode 100644 index 2d765b3ba..000000000 --- a/src/main/java/com/tabnine/psi/resolver/ImportsResolver.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.tabnine.psi.resolver - -import com.intellij.openapi.editor.Editor -import com.intellij.psi.PsiDocumentManager -import com.intellij.psi.PsiElement -import com.intellij.psi.PsiFile -import com.tabnine.psi.LocationLink -import com.tabnine.psi.Position -import com.tabnine.psi.Range -import java.net.URI - -abstract class ImportsResolver { - abstract fun potentialElementsPredicate(element: PsiElement): Boolean - - fun resolveImportsLinks(psiFile: PsiFile): List { - return psiFile?.children - ?.filter { potentialElementsPredicate(it) } - ?.flatMap { resolveImportReference(it) } ?: emptyList() - } -} - -fun resolveImportsLinks(editor: Editor): List { - val psiFile = editor.project?.let { PsiDocumentManager.getInstance(it).getPsiFile(editor.document) } ?: return emptyList() - val resolver = getResolver(psiFile) ?: return emptyList() - return resolver.resolveImportsLinks(psiFile) -} - -private fun resolveImportReference(element: PsiElement): List { - element.reference?.let { - it.resolve()?.let { r -> - if (!(r.isValid && r.isWritable)) return emptyList() - val filePath = r.containingFile?.virtualFile?.url?.let { file -> URI.create(file) } ?: return emptyList() - val range = r.textRange ?: return emptyList() - val text = r.containingFile?.text ?: return emptyList() - val linesLengths = linesAccumulativeLengths(text) - val startPos = toLogicalPosition(linesLengths, range.startOffset) ?: return emptyList() - val endPos = toLogicalPosition(linesLengths, range.endOffset) ?: return emptyList() - - return listOf(LocationLink(filePath, Range(startPos, endPos))) - } - } - - return element.children?.flatMap { resolveImportReference(it) } ?: emptyList() -} - -private fun toLogicalPosition(linesLengths: List, offset: Int): Position? { - val line = linesLengths.indexOfFirst { it >= offset } - if (line == -1) { - return null - } - if (line == 0) { - return Position(0, offset) - } - val column = offset - 1 - linesLengths[line - 1] - return Position(line, column) -} - -private fun linesAccumulativeLengths(text: String): List { - val linesLengths = mutableListOf() - var index = text.indexOf('\n') - while (index != -1) { - linesLengths.add(index) - val nextIndex = text.indexOf('\n', index + 1) - index = nextIndex - } - linesLengths.add(text.length) - return linesLengths -} From 7c68a49b9dc286b1a0d7e804124fa2c1bfb15c82 Mon Sep 17 00:00:00 2001 From: yonip23 Date: Wed, 15 Feb 2023 23:06:47 +0200 Subject: [PATCH 3/3] format --- .../java/com/tabnine/inline/InlineCompletionHandler.java | 5 ++--- .../java/com/tabnine/inline/TabnineDocumentListener.java | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java index 4dcb717db..f34b9b8f9 100644 --- a/src/main/java/com/tabnine/inline/InlineCompletionHandler.java +++ b/src/main/java/com/tabnine/inline/InlineCompletionHandler.java @@ -27,6 +27,8 @@ import com.tabnine.intellij.completions.CompletionUtils; import com.tabnine.prediction.CompletionFacade; import com.tabnine.prediction.TabNineCompletion; +import com.tabnine.psi.LocationLink; +import com.tabnine.psi.importsResolver.ImportsResolverKt; import java.util.Collections; import java.util.List; import java.util.Map; @@ -34,9 +36,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import com.tabnine.psi.LocationLink; -import com.tabnine.psi.importsResolver.ImportsResolverKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/tabnine/inline/TabnineDocumentListener.java b/src/main/java/com/tabnine/inline/TabnineDocumentListener.java index 1763c36a1..c74dfe5e5 100644 --- a/src/main/java/com/tabnine/inline/TabnineDocumentListener.java +++ b/src/main/java/com/tabnine/inline/TabnineDocumentListener.java @@ -8,17 +8,12 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorKind; import com.intellij.openapi.editor.event.BulkAwareDocumentListener; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.wm.IdeFocusManager; -import com.intellij.psi.PsiDocumentManager; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiReference; import com.tabnine.binary.requests.notifications.shown.SuggestionDroppedReason; import com.tabnine.capabilities.SuggestionsModeService; import com.tabnine.general.CompletionsEventSender;