Commit 7cc7197
authored
feat: don't crash LSP when there are errors resolving the workspace (#6257)
# Description
## Problem
Before this PR, LSP would crash for assumed workspaces (when we can't
find a Nargo.toml) or when there were errors in the Nargo.toml.
## Summary
Now LSP doesn't crash in the above cases:
- for assumed workspaces we don't crash (we used to not crash but I made
some changes in the past that broke this)
- for errors in Nargo.toml we now output to STDERR, so you can see the
error in the output. This is what Rust Analyzer does, except that they
also have a "rust-analyzer" thing at the bottom that becomes yellow when
there's an error... I didn't implement this (it probably requires some
code on the extension side) but I think if something doesn't work you'd
check the logs or ask, and it's worse if it crashes.
## Additional Context
## Documentation
Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.1 parent e13f617 commit 7cc7197
1 file changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
276 | 280 | | |
277 | 281 | | |
278 | 282 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
291 | 304 | | |
292 | 305 | | |
293 | 306 | | |
294 | | - | |
295 | | - | |
| 307 | + | |
296 | 308 | | |
297 | 309 | | |
298 | 310 | | |
| |||
309 | 321 | | |
310 | 322 | | |
311 | 323 | | |
312 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
313 | 329 | | |
314 | 330 | | |
315 | 331 | | |
| |||
0 commit comments