File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/main/kotlin/com/emberjs/glint Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,14 @@ import java.util.concurrent.Future
5252import java.util.stream.Stream
5353
5454class GlintLanguageServiceProvider (val project : Project ) : JSLanguageServiceProvider {
55+ val descriptor = getGlintDescriptor(project)
5556
5657 override fun isHighlightingCandidate (file : VirtualFile ) = file.fileType is HbFileType || file.fileType is JavaScriptFileType || file.fileType is TypeScriptFileType || file.fileType is GtsFileType
5758
58- override fun getService (file : VirtualFile ) = allServices.firstOrNull()
59+ override fun getService (file : VirtualFile ) = if (descriptor.isAvailable(file)) GlintTypeScriptService .getInstance(project) else null
5960
6061 override val allServices: List <GlintTypeScriptService >
61- get() = if (EmberUtils .isEnabledEmberProject(project )) listOf (GlintTypeScriptService .getInstance(project)) else emptyList()
62+ get() = if (descriptor.isAvailable( null )) listOf (GlintTypeScriptService .getInstance(project)) else emptyList()
6263}
6364
6465
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class GlintLspServerDescriptor(private val myProject: Project) : LspServerDescri
9898 return true
9999 }
100100
101- fun isAvailable (vfile : VirtualFile ): Boolean {
101+ fun isAvailable (vfile : VirtualFile ? ): Boolean {
102102 val config = GlintConfiguration .getInstance(myProject)
103103 val pkg = config.getPackage()
104104 val path = pkg.`package`.constantPackage?.systemIndependentPath
You can’t perform that action at this time.
0 commit comments