General Recommendations: Should I Use Tree-sitter as the AST for the LSP I am developing?

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Visual Studio Code

    Visual Studio Code

    I guess this reference might be useful for you: once vscode tried to adopt treesitter for their markdown language service https://github.com/microsoft/vscode/pull/152829, and it was finally closed because of the bad performance result.

  • markdown-oxide

    Let's record your consciousness! Bring your own text editor! Implemented as a language server compatible with any text editor, Markdown-Oxide is attempting to be the best PKM system for software enthusiasts.

    I have been setting up tree-sitter with rust bindings, and, with a few modifications, the performance is pretty good (for and LSP). The code is here code (the testing stats are linked in the readme)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • rayon

    Rayon: A data parallelism library for Rust

    Sequentially, generating tree-sitter AST for each file and querying for the links of each file takes around 2.3 seconds. However, I randomly remembered this crate rayon, and I decided to test it. It ended up improving the performance (just by changing 2 lines of code) to 200-300ms by parallelizing the iterators and tree-sitter queries. MAJOR.

  • vscode-langservers-extracted

    vscode-langservers bin collection.

    Here is https://github.com/hrsh7th/vscode-langservers-extracted wrapping the service into a standalone server which you could try (the readme said the markdown language server is not available but it is outdated).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts