rhaiscript / lsp

Language server for Rhai.
Apache License 2.0
43 stars 4 forks source link

Instructions to build #33

Closed schungx closed 2 years ago

schungx commented 2 years ago

How about some instructions to build the language server and use it with VS Code?

I would LOVE to try it out...

tamasfe commented 2 years ago

I needed to push some fixes as there were some issues while building from scratch, should be fine now.

I used Task during development, you can see the relevant operations defined here.

Also the readme is not up-to-date, as instead of WASM, currently a native binary is built called rhai. To install it, run cargo install --debug --path crates/lsp --features cli.

I had an idea of suggesting an all-in-one rhai CLI in the future instead of rhai-lsp, but I'm not certain if it's a good idea or not.

As for the vscode extension:

You'll need nodejs, yarn and then vsce (yarn global install vsce or npx vsce without the need to install it permanently) to package it.

Then the process is the following:

## In the js/lsp dir

yarn && yarn build

## In the ide/vscode dir

# pull dependencies
yarn

# package the extension
vsce package

# then install it
code --install-extension rhai-*.vsix --force

The extension will look for a rhai executable, but it is possible to override it in the vscode config (rhai.executable.path).

The js/lsp package is used for WASM builds, but it still contains required typescript types, so it has to be built at least once.

Also note that there are bugs and things can be broken in various ways, don't yet expect it to be a good experience.

schungx commented 2 years ago

I had an idea of suggesting an all-in-one rhai CLI in the future instead of rhai-lsp, but I'm not certain if it's a good idea or not.

Actually this is one of the TODO's that nobody really has time to work on.

Technically speaking, there should be one rhai cli that generates new script files, formats, documents, runs, lints, etc. Right now they are separate programs.

tamasfe commented 2 years ago

Actually this is one of the TODO's that nobody really has time to work on.

Great, it doesn't seem to be a huge undertaking, so I might be able to pick it up in the future after I get this repo and lsp in a shippable state.

cn-kali-team commented 2 years ago
tamasfe commented 2 years ago

I updated the readme with instructions, it's not thorough at all, but should be sufficient to be able to play around with the project. Tell me if it's not the case.