thrift-ls is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install thrift-ls
It will make the thrift-ls command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall thrift-ls uninstalls.
Adding thrift_analyzer library as a dependency
Run this command in a terminal, in your project's directory:
cargo add thrift-ls
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
thrift-ls = "0.1.6"
The thrift_analyzer library will be automatically available globally.
Read the thrift_analyzer library documentation .
Back to the crate overview .
Readme
thrift-ls
A Thrift language server.
This project contains two programs:
Rust binary: A language server for Thrift.
VS Code extension: A VS Code extension for Thrift. This extension uses the WASM output of the Rust library.
Features
semantic syntax highlighting.
go to definition.
diagnostics.
completion.
How to Build
Prerequisites
Cargo installed (see here ).
Node.js installed (optional, for building the VS Code extension).
Build with Cargo
Clone and Build
git clone https://github.com/ocfbnj/thrift-ls.git
cd thrift-ls
cargo build -- release
Now you can find the binary in ./target/release/thrift-ls .
Build VS Code Extension
Install wasm-pack and wasm-bindgen-cli
cargo install wasm-pack wasm-bindgen-cli
Install vsce
npm install - g @vscode/vsce
Build the VS Code extension
cd editors/code
npm install
npm run compile
vsce package
Now you can find the VS Code extension in ./thrift-ls-x.x.x.vsix .