@@ -13,6 +13,7 @@ import com.emberjs.index.EmberNameIndex
1313import com.emberjs.resolver.EmberName
1414import com.emberjs.utils.EmberUtils
1515import com.emberjs.utils.ifTrue
16+ import com.intellij.extapi.psi.PsiFileBase
1617import com.intellij.formatting.*
1718import com.intellij.formatting.templateLanguages.DataLanguageBlockWrapper
1819import com.intellij.lang.*
@@ -25,9 +26,11 @@ import com.intellij.lang.javascript.*
2526import com.intellij.lang.javascript.config.JSImportResolveContext
2627import com.intellij.lang.javascript.dialects.ECMA6ParserDefinition
2728import com.intellij.lang.javascript.dialects.TypeScriptParserDefinition
29+ import com.intellij.lang.javascript.ecmascript6.TypeScriptAnnotatingVisitor
2830import com.intellij.lang.javascript.editing.JavascriptCommenter
2931import com.intellij.lang.javascript.formatter.JavascriptFormattingModelBuilder
3032import com.intellij.lang.javascript.highlighting.JSHighlighter
33+ import com.intellij.lang.javascript.highlighting.JSSemanticHighlightingVisitor
3134import com.intellij.lang.javascript.index.IndexedFileTypeProvider
3235import com.intellij.lang.javascript.modules.JSImportCandidateDescriptor
3336import com.intellij.lang.javascript.modules.JSImportPlaceInfo
@@ -41,6 +44,9 @@ import com.intellij.lang.javascript.psi.*
4144import com.intellij.lang.javascript.psi.ecmal4.JSClass
4245import com.intellij.lang.javascript.psi.impl.JSFileImpl
4346import com.intellij.lang.javascript.types.JSFileElementType
47+ import com.intellij.lang.javascript.validation.JSAnnotatingVisitor
48+ import com.intellij.lang.javascript.validation.JSAnnotator
49+ import com.intellij.lang.javascript.validation.TypeScriptKeywordHighlighterVisitor
4450import com.intellij.lang.typescript.tsconfig.*
4551import com.intellij.lang.xml.XMLLanguage
4652import com.intellij.lang.xml.XmlFormattingModel
@@ -49,7 +55,6 @@ import com.intellij.lexer.Lexer
4955import com.intellij.lexer.LookAheadLexer
5056import com.intellij.openapi.editor.Document
5157import com.intellij.openapi.editor.Editor
52- import com.intellij.openapi.editor.actions.lists.TrailingComma
5358import com.intellij.openapi.editor.colors.EditorColorsScheme
5459import com.intellij.openapi.editor.ex.util.LayerDescriptor
5560import com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter
@@ -58,6 +63,7 @@ import com.intellij.openapi.fileTypes.*
5863import com.intellij.openapi.project.Project
5964import com.intellij.openapi.util.IconLoader
6065import com.intellij.openapi.util.Key
66+ import com.intellij.openapi.util.Pair
6167import com.intellij.openapi.util.TextRange
6268import com.intellij.openapi.util.text.StringUtil
6369import com.intellij.openapi.vfs.VirtualFile
@@ -72,14 +78,19 @@ import com.intellij.psi.formatter.xml.XmlFormattingPolicy
7278import com.intellij.psi.formatter.xml.XmlTagBlock
7379import com.intellij.psi.html.HtmlTag
7480import com.intellij.psi.impl.source.PsiFileImpl
81+ import com.intellij.psi.impl.source.StubbedSpine
7582import com.intellij.psi.impl.source.html.HtmlDocumentImpl
7683import com.intellij.psi.impl.source.html.HtmlFileImpl
7784import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference
85+ import com.intellij.psi.impl.source.tree.FileElement
7886import com.intellij.psi.impl.source.tree.LeafElement
7987import com.intellij.psi.impl.source.tree.PsiWhiteSpaceImpl
8088import com.intellij.psi.search.FilenameIndex
8189import com.intellij.psi.search.GlobalSearchScope
8290import com.intellij.psi.search.ProjectScope
91+ import com.intellij.psi.stubs.LanguageStubDescriptor
92+ import com.intellij.psi.stubs.StubElement
93+ import com.intellij.psi.stubs.StubTree
8394import com.intellij.psi.templateLanguages.*
8495import com.intellij.psi.tree.IElementType
8596import com.intellij.psi.tree.IFileElementType
@@ -89,6 +100,7 @@ import com.intellij.refactoring.suggested.endOffset
89100import com.intellij.refactoring.suggested.startOffset
90101import com.intellij.util.Processor
91102import com.intellij.xml.template.formatter.AbstractXmlTemplateFormattingModelBuilder
103+ import org.jetbrains.annotations.Unmodifiable
92104import java.util.function.Predicate
93105import javax.swing.Icon
94106
@@ -99,6 +111,7 @@ val JS: JSLanguageDialect = JavaScriptSupportLoader.ECMA_SCRIPT_6
99111
100112open class GtsLanguage (val lang : JSLanguageDialect = TS , id : String =" Gts" ) : Language(lang, id) {
101113 public var fileElementType: JSFileElementType ? = null
114+
102115 override fun <T : Any ?> getUserData (key : Key <T >): T ? {
103116 if (key.toString() == " js.file.element.type" ) {
104117 return fileElementType as T ?
@@ -114,7 +127,7 @@ open class GtsLanguage(val lang: JSLanguageDialect = TS, id: String ="Gts") : La
114127 }
115128
116129 companion object {
117- val INSTANCE = GtsLanguage ()
130+ val INSTANCE = GtsLanguage (TS )
118131 }
119132}
120133
@@ -135,8 +148,6 @@ class GtsFile(viewProvider: FileViewProvider?, val isJS: Boolean =false)
135148 override fun toString (): String {
136149 return " GTS File"
137150 }
138-
139-
140151}
141152
142153
@@ -397,6 +408,9 @@ class GtsFileType : LanguageFileType(GtsLanguage.INSTANCE) {
397408 if (other == TypeScriptFileType ) {
398409 return true
399410 }
411+ if (other == JavaScriptFileType ) {
412+ return true
413+ }
400414 return super .equals(other)
401415 }
402416
0 commit comments