Skip to content

Commit 53ed604

Browse files
committed
need to notify glint about ts/js files
1 parent 467f00c commit 53ed604

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changelog
44
===============================================================================
5+
## 2022.2.16
6+
- fix: need to notify glint about ts/js files
7+
58
## 2022.2.15
69
- improvement: add @model lookup for controllers
710

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313

1414

1515
group = "com.emberjs"
16-
version = "2022.2.15"
16+
version = "2022.2.16"
1717

1818
// Configure project's dependencies
1919
repositories {

src/main/kotlin/com/emberjs/glint/GlintLanguageService.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import java.util.stream.Stream
4545

4646
class GlintLanguageServiceProvider(val project: Project) : JSLanguageServiceProvider {
4747

48-
override fun isHighlightingCandidate(file: VirtualFile) = file.fileType is HbFileType
48+
override fun isHighlightingCandidate(file: VirtualFile) = file.fileType is HbFileType || file.fileType is JavaScriptFileType || file.fileType is TypeScriptFileType
4949

5050
override fun getService(file: VirtualFile) = allServices.firstOrNull()
5151

@@ -160,7 +160,9 @@ class GlintTypeScriptService(private val project: Project) : TypeScriptService,
160160
.filter { vFile -> !openFiles.contains(vFile) && isAcceptable(vFile) }
161161
}
162162

163-
override fun canHighlight(file: PsiFile) = file.fileType is HbFileType
163+
override fun canHighlight(file: PsiFile) = file.fileType is HbFileType ||
164+
file.fileType is TypeScriptFileType ||
165+
file.fileType is JavaScriptFileType
164166

165167
override fun isAcceptable(file: VirtualFile) = file.fileType is HbFileType ||
166168
file.fileType is TypeScriptFileType ||

src/main/kotlin/com/emberjs/hbs/linter/ember-template-lint/TemplateLintExternalAnnotator.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import com.emberjs.icons.EmberIcons
66
import com.emberjs.utils.originalVirtualFile
77
import com.intellij.lang.annotation.AnnotationHolder
88
import com.intellij.lang.annotation.HighlightSeverity
9+
import com.intellij.lang.javascript.JavaScriptFileType
10+
import com.intellij.lang.javascript.TypeScriptFileType
911
import com.intellij.lang.javascript.linter.*
1012
import com.intellij.openapi.editor.Editor
1113
import com.intellij.openapi.project.Project
@@ -36,7 +38,7 @@ class TemplateLintExternalAnnotator(onTheFly: Boolean = true) : JSLinterExternal
3638
}
3739

3840
override fun acceptPsiFile(file: PsiFile): Boolean {
39-
return file is HbPsiFile
41+
return file is HbPsiFile || file.fileType is TypeScriptFileType || file.fileType is JavaScriptFileType
4042
}
4143

4244
override fun annotate(input: JSLinterInput<TemplateLintState>): JSLinterAnnotationResult? {

0 commit comments

Comments
 (0)