-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: infinite indexing / intellisense blocked (#102)
* chore: Refactor Biome CLI integration and streamline process handling Removed obsolete action, listener, and extension files and refactored the Biome CLI processing and document management to improve efficiency and maintainability. Introduced new process command builder classes for better process handling, and replaced Kotlin coroutines for non-blocking execution and simplified error handling. Updated settings and actions-on-save to align with the new architecture.
- Loading branch information
1 parent
43ad101
commit 2bfccaf
Showing
25 changed files
with
437 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 38 additions & 63 deletions
101
src/main/kotlin/com/github/biomejs/intellijbiome/BiomeStdinRunner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/com/github/biomejs/intellijbiome/BiomeTargetRun.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.biomejs.intellijbiome | ||
|
||
import com.github.biomejs.intellijbiome.extensions.isNodeScript | ||
import com.intellij.execution.ExecutionException | ||
import com.intellij.javascript.nodejs.interpreter.NodeJsInterpreterManager | ||
import com.intellij.javascript.nodejs.interpreter.local.NodeJsLocalInterpreter | ||
import com.intellij.javascript.nodejs.interpreter.wsl.WslNodeInterpreter | ||
import com.intellij.lang.javascript.JavaScriptBundle | ||
import com.intellij.openapi.project.Project | ||
import java.io.File | ||
|
||
class BiomeTargetRunBuilder(val project: Project) { | ||
fun getBuilder( | ||
executable: String, | ||
): ProcessCommandBuilder { | ||
if (executable.isEmpty()) { | ||
throw ExecutionException(BiomeBundle.message("biome.language.server.not.found")) | ||
} | ||
|
||
val executableFile = File(executable) | ||
|
||
val builder: ProcessCommandBuilder = if (executableFile.isFile && executableFile.isNodeScript()) { | ||
val interpreter = NodeJsInterpreterManager.getInstance(project).interpreter | ||
if (interpreter !is NodeJsLocalInterpreter && interpreter !is WslNodeInterpreter) { | ||
throw ExecutionException(JavaScriptBundle.message("lsp.interpreter.error")) | ||
} | ||
NodeProcessCommandBuilder(project, interpreter) | ||
} else { | ||
GeneralProcessCommandBuilder() | ||
} | ||
|
||
return builder.setExecutable(executable).setWorkingDirectory(project.basePath).setCharset(Charsets.UTF_8) | ||
} | ||
} |
Oops, something went wrong.