@@ -25,18 +25,15 @@ import com.intellij.lang.parameterInfo.CreateParameterInfoContext
2525import com.intellij.lang.typescript.compiler.TypeScriptService
2626import com.intellij.lang.typescript.compiler.languageService.TypeScriptLanguageServiceUtil
2727import com.intellij.lang.typescript.compiler.languageService.codeFixes.TypeScriptSuppressByCommentFix
28- import com.intellij.lang.typescript.compiler.languageService.protocol.commands.response.TypeScriptQuickInfoResponse
2928import com.intellij.lang.typescript.lsp.BaseLspTypeScriptService
3029import com.intellij.lang.typescript.lsp.LspAnnotationError
3130import com.intellij.openapi.diagnostic.Logger
3231import com.intellij.openapi.editor.Document
3332import com.intellij.openapi.project.Project
3433import com.intellij.openapi.util.TextRange
35- import com.intellij.openapi.util.text.HtmlBuilder
3634import com.intellij.openapi.vfs.VfsUtil
3735import com.intellij.openapi.vfs.VirtualFile
3836import com.intellij.platform.lsp.api.LspServerManager
39- import com.intellij.platform.lsp.impl.LspServerImpl
4037import com.intellij.platform.lsp.impl.highlighting.DiagnosticAndQuickFixes
4138import com.intellij.psi.PsiElement
4239import com.intellij.psi.PsiFile
@@ -47,7 +44,6 @@ import com.intellij.ui.EditorNotifications
4744import com.intellij.util.containers.toMutableSmartList
4845import org.eclipse.lsp4j.CompletionItem
4946import org.eclipse.lsp4j.DiagnosticSeverity
50- import org.eclipse.lsp4j.MarkupContent
5147import java.net.URL
5248import java.util.concurrent.CompletableFuture
5349import java.util.concurrent.CompletableFuture.completedFuture
@@ -88,18 +84,6 @@ class GlintTypeScriptService(project: Project) : BaseLspTypeScriptService(projec
8884
8985 override val name = " Glint TypeScript LSP"
9086
91- override fun isServiceCreated () = withServer { isRunning || isMalfunctioned } ? : false
92-
93- override fun showStatusBar () = withServer { isServiceCreated() } ? : false
94-
95- override fun getStatusText () = withServer {
96- when {
97- isRunning -> " Glint TypeScript LSP"
98- isMalfunctioned -> " Glint LSP ⚠"
99- else -> " ..."
100- }
101- }
102-
10387 override fun getCompletionMergeStrategy (parameters : CompletionParameters , file : PsiFile , context : PsiElement ): TypeScriptService .CompletionMergeStrategy {
10488 return TypeScriptLanguageServiceUtil .getCompletionMergeStrategy(parameters, file, context)
10589 }
@@ -156,7 +140,7 @@ class GlintTypeScriptService(project: Project) : BaseLspTypeScriptService(projec
156140 elem = DelegateElement (elem, element, document)
157141 }
158142
159- val links = withServer { requestExecutor.getElementDefinitions(element.originalVirtualFile!! , (elem as PsiElement ).textOffset) }
143+ val links = getServer()?. requestExecutor? .getElementDefinitions(element.originalVirtualFile!! , (elem as PsiElement ).textOffset)
160144 val psiManager = PsiManager .getInstance(project)
161145 return links?.map {
162146 val vFile = VfsUtil .findFileByURL(URL (it.targetUri))
@@ -202,11 +186,11 @@ class GlintTypeScriptService(project: Project) : BaseLspTypeScriptService(projec
202186 file.fileType is JavaScriptFileType
203187}
204188
205- class GlintCompletionEntry (internal val item : CompletionItem ) : TypeScriptService.CompletionEntry {
189+ class GlintCompletionEntry (internal val item : CompletionItem ) : TypeScriptService.CompletionEntryBase() {
206190 override val name: String get() = item.label
207191 val detail: String? get() = item.detail
208192
209- override fun intoLookupElement () = LookupElementBuilder .create(item.label)
193+ override fun createLookupElement () = LookupElementBuilder .create(item.label)
210194 .withTypeText(item.detail, true )
211195 .withInsertHandler(JSInsertHandler .DEFAULT )
212196}
0 commit comments