Solidity LSP server#
Wake implements an LSP server for Solidity. The only currently supported communication channel is TCP.
Wake LSP server can be run using:
Or with an optional --port
argument (default 65432):
Info
Multi-root workspaces are not currently supported.
Projects using Wake LSP server#
Configuration options#
Server configuration options are loaded using the standard interface from LSP clients. The process of setting the configuration options is client specific. Configuration changes are handled by the server, and the project is recompiled if the compilation options change.
The full list of supported configuration options can be found in the configuration section.
Tip
The LSP server automatically loads the configuration options from the wake.toml
file located in the root of the project if wake.use_toml_if_present
is set to True
.
The path to the configuration file can be changed using the wake.toml_path
configuration option.
Supported commands#
Wake LSP server implements the command execution provider as specified by the LSP specification. The following commands are supported:
Command | Arguments | Description |
---|---|---|
wake.init.detector |
0 : name of the detector1 : boolean indicating whether the detector should be global (True) or project-specific (False) |
Initialize a detector from a template in $XDG_DATA_HOME/wake/global-detectors or ./detectors (if the detector is project-specific). |
wake.init.printer |
0 : name of the printer1 : boolean indicating whether the printer should be global (True) or project-specific (False) |
Initialize a printer from a template in $XDG_DATA_HOME/wake/global-printers or ./printers (if the printer is project-specific). |
wake.lsp.force_recompile |
Force recompile the opened project/files. Useful after modifying files outside the IDE (e.g. after installing npm packages). | |
wake.lsp.force_rerun_detectors |
Force rerun detectors on the opened project/files. | |
wake.generate.control_flow_graph |
0 : URI of the document containing the function1 : canonical name of the function |
Generate a control flow graph for the given function or modifier. Returns the source code of the graph in Graphviz (DOT) format. |
wake.generate.imports_graph |
Generate an imports graph for the whole project. A workspace must be opened. Returns the source code of the graph in Graphviz (DOT) format. | |
wake.generate.inheritance_graph |
0 : URI of the document containing the contract1 : name of the contract |
Generate an inheritance graph for the given contract. Returns the source code of the graph in Graphviz (DOT) format. |
wake.generate.inheritance_graph_full |
Generate an inheritance graph for the whole project. A workspace must be opened. Returns the source code of the graph in Graphviz (DOT) format. | |
wake.generate.linearized_inheritance_graph |
0 : URI of the document containing the contract1 : name of the contract |
Generate a linearized inheritance graph for the given contract. Returns the source code of the graph in Graphviz (DOT) format. |
Features#
Go to definition#
Go to type definition#
Go to implementation#
Finds implementations of an unimplemented function or modifier.
Find references#
Type hierarchy#
Also works for virtual functions.
Document links#
Hover#
Includes links to documentation for OpenZeppelin contracts.
Code lens#
Number of references is shown above each declaration.
Document symbols#
Diagnostics#
Together with compiler errors, diagnostics also include results from Wake vulnerability detectors.
Rename#
Debugging#
Wake LSP server can be debugged using: