Skip to content

Commit dad19ae

Browse files
authored
fix missing args for components in hbs (#286)
* fix glint when manually configured * fix missing completions for component args in hbs
1 parent 73c460f commit dad19ae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class GlintLspServerDescriptor(private val myProject: Project) : LspServerDescri
139139

140140
fun getGlintVersion(): String? {
141141
val workingDir = lastDir!!
142-
val workDirectory = VfsUtilCore.virtualToIoFile(workingDir)
143142
var path = workingDir.findFileByRelativePath("node_modules/@glint/core/package.json") ?: return null
144143
return PackageJsonData.getOrCreate(path).version?.rawVersion
145144
}
@@ -152,7 +151,7 @@ class GlintLspServerDescriptor(private val myProject: Project) : LspServerDescri
152151
val pkg = config.getPackage()
153152
val pkgPath = pkg.`package`.constantPackage?.systemIndependentPath
154153
if (pkgPath != null && File(pkgPath).exists()) {
155-
path = File(pkgPath).parentFile.parentFile.path
154+
path = File(pkgPath).parentFile.parentFile.parentFile.path
156155
}
157156
path = path.replace("\\", "/")
158157
this.isWsl = false

src/main/kotlin/com/emberjs/hbs/TagReferencesProvider.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ fun toAttributeReference(target: XmlAttribute): PsiReference? {
199199
if (name.length == 1) {
200200
return null
201201
}
202+
if (!name.contains("|")) {
203+
return null
204+
}
202205
var range = TextRange(0, name.length)
203206
if (name.startsWith("|")) {
204207
range = TextRange(1, range.endOffset)

0 commit comments

Comments
 (0)