VS Code extension PoC#85
Conversation
|
Would you mind updating this against main? I did a bunch of work to expose better context, and the individual problems now expose a location that you should be able to use. |
Editors and the language server need to validate an unsaved buffer, but `validate_spec` only takes a path and reads the file itself. Factor the parse + `SourceContext` construction out of `load` into `load_str`, and expose `validate_spec_str(content, filename)` as the content twin of `validate_spec` (no I/O, so it never reports `Io`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Re-add the editor tooling on top of the current spec/meta/data validation API. A new `data-dict-lsp` crate wraps the core validator in a `tower-lsp` server: it publishes live spec squiggles from `validate_spec_str` as you type, and a `data-dict.validateData` command compares each table against its parquet `source` via `validate_data`. Every failure is already a `Problem` carrying its severity, code, and 0-based location, so mapping to LSP diagnostics is a single path. The CLI gains a hidden `lsp` subcommand (behind an `lsp` feature) that serves over stdio; the VS Code extension in `editors/vscode` spawns `data-dict lsp` and speaks standard LSP. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8fe8b5b to
4d188ef
Compare
Done. |
|
You'll probably want to merge these for easier testing: |
|
Now merged those, and updated the examples here. Thanks! |
|
This looks good! I'd suggest we merge and then iterate on the errors:
Then can you take a look at autocomplete? Maybe start with Can we add a button somewhere to make the data validation more obvious? |
|
We should also bundle the cli in the extension like air, quarto etc, posit-dev/air#504, since I think that's a useful distribution mechanism. |

data-dict.yamlfiles. (Or you can configure a glob to live validate.)We'll need to improve some of the error locations, because e.g. a missing top-level tag currently marks the whole document, which is ok for a cli error, but does not look good in the live validation.