Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Massive Refactor and Rewrite #211

Merged
merged 15 commits into from
Mar 26, 2022
Merged

feat: Massive Refactor and Rewrite #211

merged 15 commits into from
Mar 26, 2022

Conversation

tamasfe
Copy link
Owner

@tamasfe tamasfe commented Feb 6, 2022

One of the reasons why I always kept postponing patches and updates in this project was the fact that it was pretty hard to maintain. When I originally wrote most of it, I barely had time and just wanted to get features out ASAP.

The Even Better TOML has recently passed the 100K installs mark, I felt that some cleanup and care was long overdue.

This PR is pretty much a rewrite and/or a major refactor of Taplo with the only exception of the parser, which I would love to rewrite as well but I'm already pushing my time-limits.

Features

  • Rewrite of the DOM, it now uses a reference-counted implementation where each node is cheap to clone and to juggle around.
  • Rewrite of the CLI as well, it is now a first-class citizen not just something quickly thrown together.
  • Integration of jsonschema, most (all?) JSON Schema features are now supported and the limitations of the current implementation are non-existent.
  • Support of schema store catalog and schemas
  • The shared code between the CLI and the language server is now properly extracted into taplo-common, so the CLI and the LSP are no longer out of sync.
  • The external environment is now abstracted away into a trait, so both the LSP and the CLI should run pretty much anywhere with minimal plumbing
  • tracing is used for all logging
  • Refactor and workspace support in the LSP
  • All toml-test tests now pass
  • Proper benchmarks via criterion (the new DOM is slightly slower initially due to allocations, but not too much)
  • Completions and hover in the LSP (the building blocks are there, but the cursor queries require some plumbing)
  • The LSP is part of the CLI as well, and the VSCode extension works with it, WASM bindings are yet to be reimplemented
  • Flexible configuration options in the LSP
  • Proper directives in TOML files (e.g. schema)

Breaking Changes

Probably a lot, but here are a few notable ones:

  • The DOM API is completely different, although migration should be rather easy.
  • Chrono feature has been removed, it can be reintroduced later though if needed.
  • As with the DOM layout, error types have also changed.
  • Date types are now separate syntax-kinds.
  • Even though we had no MSRV policy, I clearly used 1.58 features during the rewrite
  • The Even Better Toml vscode extension also gets a facelift with some configuration options changed

Merging this PR should:

@tamasfe tamasfe merged commit a3f6664 into master Mar 26, 2022
@tamasfe tamasfe deleted the next branch March 26, 2022 22:20
syphar added a commit to syphar/nvim-lspconfig that referenced this pull request Mar 27, 2022
taplo was refactored and taplo-lsp was merge into taplo-cli.

tamasfe/taplo#211
syphar added a commit to syphar/nvim-lspconfig that referenced this pull request Mar 27, 2022
taplo was refactored and taplo-lsp was merge into taplo-cli.

see also tamasfe/taplo#211
syphar added a commit to syphar/nvim-lspconfig that referenced this pull request Mar 27, 2022
taplo was refactored and taplo-lsp was merge into taplo-cli.

see also tamasfe/taplo#211
This was referenced Mar 27, 2022
syphar added a commit to syphar/nvim-lspconfig that referenced this pull request Apr 5, 2022
taplo was refactored and taplo-lsp was merge into taplo-cli.

see also tamasfe/taplo#211
tamasfe pushed a commit that referenced this pull request Oct 7, 2022
This env's use was removed in #211, so the build script is unnecessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment