Commit f07d944
Egor/zed extension (#2044)
Fixes #932
### Changes:
- Embed playground server in the language server (LSP).
- Allows support for any editor that supports LSP protocol.
- Modify `language_server/server.rs` to launch the server on first
available localhost starting at port `3030`. If `3030` is taken will try
`3031` etc.
- Sends events on every LSP `did_change`
- Selects function on function ctrl + hover
- Code actions for opening playground in browser
- Create a new zed extension under `engine/zed` which packages the new
embedded playground via LSP
- **Embedding structure:** Wasm language runtime -> fiddle frontend ->
baml-cli (LSP) -> zed-extension -> Wasm extension package.
- Syntax highlighting partially implemented using the existing
tree-sitter implementation
- Added connection status for playground frontend on connection lost
### Known Issues:
- Syntax highlighting is not fully implemented:
- Jinja highlighting does not work
- Incorrect field and type highlighting
### Notes:
- May be useful to batch updates from LSP to not spam frontend
- Entire frontend is now embedded in LSP increasing file size
- Local baml version handling is currently not implemented
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Embed playground server in language server for LSP support and add Zed
extension for packaging, with partial syntax highlighting and connection
status indicator.
>
> - **Behavior**:
> - Embed playground server in `language_server` to support any
LSP-compatible editor.
> - Launches on first available localhost port starting at `3030`.
> - Sends events on LSP `did_change`, supports function selection on
hover, and code actions for opening playground.
> - **Zed Extension**:
> - New extension under `engine/zed` packages embedded playground via
LSP.
> - Embedding structure: Wasm language runtime -> fiddle frontend ->
baml-cli (LSP) -> zed-extension -> Wasm extension package.
> - Partial syntax highlighting using tree-sitter.
> - **Playground Frontend**:
> - Added connection status indicator for connection loss.
> - **Known Issues**:
> - Incomplete syntax highlighting: Jinja and incorrect field/type
highlighting.
> - Local baml version handling not implemented.
> - **Misc**:
> - Added `build.sh` script in `language_server/scripts` for building
web-panel.
> - Updated `Cargo.toml` and `Cargo.lock` for new dependencies and
configurations.
>
> <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 7cc5efb. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->
---------
Co-authored-by: hellovai <vbv@boundaryml.com>
Co-authored-by: Greg Hale <imalsogreg@gmail.com>
Co-authored-by: Rahul Tiwari <jprrahultiwari@gmail.com>
Co-authored-by: aaronvg <aaron@boundaryml.com>
Co-authored-by: Sam Lijin <sam@boundaryml.com>
Co-authored-by: Chris Watts <chris@boundaryml.com>
Co-authored-by: Antonio Sarosi <sarosiantonio@gmail.com>1 parent 2af60c3 commit f07d944
32 files changed
Lines changed: 1590 additions & 118 deletions
File tree
- .github/workflows
- engine
- cli
- language_server
- scripts
- src
- playground
- server
- api
- notifications
- requests
- session
- zed
- languages/baml
- src
- typescript/playground-common/src/baml_wasm_web
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| |||
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
| |||
130 | 155 | | |
131 | 156 | | |
132 | 157 | | |
| 158 | + | |
133 | 159 | | |
134 | 160 | | |
135 | 161 | | |
| |||
162 | 188 | | |
163 | 189 | | |
164 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
165 | 194 | | |
166 | 195 | | |
167 | 196 | | |
168 | 197 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
| |||
193 | 207 | | |
194 | 208 | | |
195 | 209 | | |
| 210 | + | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
199 | 217 | | |
200 | 218 | | |
201 | 219 | | |
| |||
0 commit comments