Skip to content

Commit a89ceb6

Browse files
authored
fix(jetbrains): use the production-facing LSP installer logic (#2275)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Switches `BamlLanguageServer` initialization to use production command line setup instead of local debugging. > > - **Behavior**: > - In `BamlLanguageServer`, switches from local debugging command line to production command line setup. > - Uses `baml-cli` from `.baml/jetbrains` directory based on platform and architecture. > - **Code Changes**: > - Comments out local debugging command line setup in `BamlLanguageServer.kt`. > - Uncomments production command line setup logic in `BamlLanguageServer.kt`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for c06d9e7. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 5aa9995 commit a89ceb6

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎jetbrains/src/main/kotlin/com/boundaryml/jetbrains_ext/BamlLanguageServer.kt‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ class BamlLanguageServer(private val project: Project) : OSProcessStreamConnecti
1010

1111
init {
1212
// UNCOMMENT FOR DEBUGGING LOCALLY
13-
val commandLine = GeneralCommandLine(
14-
Path.of(System.getProperty("user.home"),
15-
"/Documents/boundary/baml-main/baml/engine/target/debug", "baml-cli").toString(), "lsp")
16-
super.setCommandLine(commandLine)
17-
18-
// val cacheDir = Path.of(System.getProperty("user.home"), ".baml/jetbrains")
19-
// val version = Files.readString(cacheDir.resolve("baml-cli-installed.txt")).trim()
20-
//
21-
// val (arch, platform, _) = BamlLanguageServerInstaller.getPlatformTriple()
22-
// val exe = if (platform == "pc-windows-msvc") "baml-cli.exe" else "baml-cli"
23-
// val cli = cacheDir.resolve("baml-cli-$version-$arch-$platform").resolve(exe)
24-
//
25-
// super.setCommandLine(GeneralCommandLine(cli.toString(), "lsp"))
13+
// val commandLine = GeneralCommandLine(
14+
// Path.of(System.getProperty("user.home"),
15+
// "/Documents/boundary/baml-main/baml/engine/target/debug", "baml-cli").toString(), "lsp")
16+
// super.setCommandLine(commandLine)
17+
18+
val cacheDir = Path.of(System.getProperty("user.home"), ".baml/jetbrains")
19+
val version = Files.readString(cacheDir.resolve("baml-cli-installed.txt")).trim()
20+
21+
val (arch, platform, _) = BamlLanguageServerInstaller.getPlatformTriple()
22+
val exe = if (platform == "pc-windows-msvc") "baml-cli.exe" else "baml-cli"
23+
val cli = cacheDir.resolve("baml-cli-$version-$arch-$platform").resolve(exe)
24+
25+
super.setCommandLine(GeneralCommandLine(cli.toString(), "lsp"))
2626

2727
}
2828

0 commit comments

Comments
 (0)