Language server for Ralph.
- Publish Diagnostics
- Goto Definition
- Find References
- Completion
- Rename
- More to come...
Java 11 or higher.
Ralph LSP
is available on the VSCode Marketplace.
Follow these steps:
- Download: Get the
.vsix
plugin file from the latest release. - Install:
- Open Visual Studio Code.
- Go to Extensions > Views and More Actions > Install from VSIX...
- Select the downloaded
.vsix
file and click "Install".
Go to the latest release
Download ralph-lsp.zip
, extract it and add ralph-lsp/bin
to your PATH
environment variable.
Plug 'alephium/ralph-lsp', {'rtp': 'plugin-nvim'}
lazy_opts = {
performance = {
rtp = {
paths = {
vim.fn.stdpath('data') .. '/lazy/ralph-lsp/plugin-nvim'
}
},
},
}
lazy_plugin_config = {
"alephium/ralph-lsp",
init = function()
-- expose directly from inside nvim
local path = vim.env.PATH
path = path .. ":" .. "/path/to/ralph-lsp/bin"
vim.env.PATH = path
end
}
The plugin adds file type detection, syntax highlighting and start the LSP server, make sure you have ralph-lsp
available in your PATH
sbt "compile; lsp-server/assembly"
Look in target
folder: .../ralph-lsp/lsp-server/target/scala-2.13/ralph-lsp.jar
sbt universal:packageBin
zip file will be generated in target/universal/ralph-lsp.zip
For local development, you can run
sbt stage
This creates the target/universal/stage/bin/ralph-lsp
executable
sbt "compile; lsp-server/assembly; copyJARToVSCode"
The JAR file gets generated to plugin-vscode/out/ralph-lsp.jar
.
Open the plugin directory plugin-vscode
in VSCode:
cd plugin-vscode
code .
Run the plugin by selecting the menu option Run -> Run Without Debugging
or Run -> Start Debugging
.
Configurations in alephium.config.ts
are the primary source for build settings, and ralph.json
is secondary.
Any settings defined in alephium.config.ts
will be mirrored in ralph.json
.
Refer to the documentation for more details about the alephium.config.ts
.
Once your IDE has booted up, a config file named ralph.json
will be generated in your project's root
directory under the folder .ralph-lsp/ralph.json
.
This file reflects the sourceDir
and compilerOptions
settings defined in alephium.config.ts
.
If alephium.config.ts
is not present or if the settings are missing, default settings will be used.
The dependencyPath
setting is specific to Ralph-LSP and configures the directory for dependencies.
If dependencyPath
is not specified, the default path (<user.home>/.ralph-lsp/dependencies/
) will be used.
Here’s an example of the ralph.json
file with all configurations set:
{
"contractPath": "contracts",
"dependencyPath": "dependencies",
"compilerOptions": {
"ignoreUnusedConstantsWarnings": false,
"ignoreUnusedVariablesWarnings": false,
"ignoreUnusedFieldsWarnings": false,
"ignoreUnusedPrivateFunctionsWarnings": false,
"ignoreUpdateFieldsCheckWarnings": false,
"ignoreCheckExternalCallerWarnings": false,
"ignoreUnusedFunctionReturnWarnings": false
}
}
off
- Enablesinfo
,warning
anderror
.messages
- Enables all the above includingdebug
.verbose
- Enables all the above includingtrace
.
- Run "Build the JAR for VSCode"
- Run
vsce package <version>
- Run
vsce publish