Skip to content

Commit 467f00c

Browse files
committed
add model to args
fix an issue with starting glint
1 parent d8381a9 commit 467f00c

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
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.15
6+
- improvement: add @model lookup for controllers
7+
58
## 2022.2.14
69
- improvement: better lookup for related files of templates and controller
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.14"
16+
version = "2022.2.15"
1717

1818
// Configure project's dependencies
1919
repositories {

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import com.intellij.javascript.nodejs.interpreter.NodeJsInterpreterRef
88
import com.intellij.javascript.nodejs.reference.NodeModuleManager
99
import com.intellij.lsp.*
1010
import com.intellij.openapi.Disposable
11+
import com.intellij.openapi.application.Application
12+
import com.intellij.openapi.application.ApplicationManager
1113
import com.intellij.openapi.components.Service
1214
import com.intellij.openapi.project.Project
1315
import com.intellij.openapi.project.guessProjectDir
@@ -59,14 +61,17 @@ class GlintLspServerDescriptor(private val myProject: Project) : LspServerDescri
5961
.withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
6062
.withWorkDirectory(workDirectory)
6163

62-
val glintPkg = NodeModuleManager.getInstance(project).collectVisibleNodeModules(workingDir).find { it.name == "@glint/core" }?.virtualFile
63-
?: throw RuntimeException("glint is not installed")
64-
val file = glintPkg.findFileByRelativePath("bin/glint-language-server.js")
65-
?: throw RuntimeException("glint lsp was not found")
66-
//commandLine.addParameter("--inspect")
67-
commandLine.addParameter(file.path)
68-
commandLine.addParameter("--stdio")
69-
commandLine.addParameter("--clientProcessId=" + OSProcessUtil.getCurrentProcessId().toString())
64+
ApplicationManager.getApplication().runReadAction {
65+
val glintPkg = NodeModuleManager.getInstance(project).collectVisibleNodeModules(workingDir).find { it.name == "@glint/core" }?.virtualFile
66+
?: throw RuntimeException("glint is not installed")
67+
val file = glintPkg.findFileByRelativePath("bin/glint-language-server.js")
68+
?: throw RuntimeException("glint lsp was not found")
69+
//commandLine.addParameter("--inspect")
70+
commandLine.addParameter(file.path)
71+
commandLine.addParameter("--stdio")
72+
commandLine.addParameter("--clientProcessId=" + OSProcessUtil.getCurrentProcessId().toString())
73+
}
74+
7075

7176
NodeCommandLineConfigurator
7277
.find(NodeJsInterpreterRef.createProjectRef().resolve(project)!!)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ class HbsLocalCompletion : CompletionProvider<CompletionParameters>() {
300300
resolve(parameters.position.parent.prevSibling?.prevSibling, result)
301301
val items = languageService.getService(element.originalVirtualFile!!)?.updateAndGetCompletionItems(element.originalVirtualFile!!, parameters)?.get() ?: arrayListOf()
302302
result.addAllElements(items.map { it.intoLookupElement() })
303+
return
303304
}
304305

305306
if (element.parent is HbData) {

0 commit comments

Comments
 (0)