Crates.io | asm-lsp |
lib.rs | asm-lsp |
version | 0.9.0 |
source | src |
created_at | 2020-07-27 07:43:22.78678 |
updated_at | 2024-09-04 01:25:32.612881 |
description | Language Server for x86/x86_64, ARM, RISCV, and z80 Assembly Code |
homepage | https://github.com/bergercookie/asm-lsp |
repository | https://github.com/bergercookie/asm-lsp |
max_upload_size | |
id | 269999 |
size | 54,757,827 |
Provide hovering, autocompletion, signature help, go to definition, and view references for assembly files written in the GAS/NASM or GO assembly flavors. It supports assembly files for the x86, x86_64, ARM, RISCV, and z80 instruction sets.
This tool can serve as reference when reading the assembly output of a program. This way you can query what each command exactly does and deliberate about whether the compiler is producing the desired output or whether you have to tweak your code for optimisation.
Install using the cargo package manager, either from crates.io
or from github:
cargo install asm-lsp
# or to get the latest version from github
cargo install --git https://github.com/bergercookie/asm-lsp
Add a section like the following in your settings.json
file:
"asm-lsp": {
"command": "asm-lsp",
"filetypes": [
"asm", "s", "S"
]
}
.asm-lsp.toml
Add a .asm-lsp.toml
file like the following to your project's root directory
and/or ~/.config/asm-lsp/
(project configs will override global configs) to
selectively target specific assemblers and/or instruction sets. Omitting an item
from the assemblers
or instruction_sets
sections is equivalent to setting it
to false
. Be default, diagnostics are enabled and the server attempts to invoke
gcc
(and then clang
) to generate them. If the compiler
config field is specified,
the server will attempt to use the specified path to generate diagnostics.
version = "0.1"
[assemblers]
gas = true
go = false
z80 = false
masm = false
nasm = false
[instruction_sets]
x86 = false
x86_64 = true
z80 = false
arm = false
riscv = false
[opts]
#compiler = "gcc"
diagnostics = true
default_diagnostics = true
compile_commands.json
/compile_flags.txt
Add a compile_commands.json
or compile_flags.txt
file to your project's root or root build
directory to enable inline diagnostic
features, as well as to specify additional include directories for use in hover
features. If a compile_commands.json
or compile_flags.txt
file isn't provided,
the server will attempt to provide diagnostics with a default compile command.
This feature can be disabled by setting the default_diagnostics
config field
to false
.
The project has not published any VSCode extension package yet. However, there is
a development extension in the editors/code
directory with setup instructions.
.git
The lsp searches for a .git
directory to locate the root of your project.
Please be sure to run git init
if your project is not already configured as a
git repository.
:lua vim.lsp.buf.signature_help()
.inoremap <silent> ,s <C-r>=CocActionAsync('showSignatureHelp')<CR>
to trigger signature help in insert mode.x86 and x86-64 instruction documentation builds on top of the opcodes python package
x86 and x86-64 register documentation sourced from:
GAS directives sourced from SourceWare's pseudo-ops page
MASM and NASM directives sourced from the asm-dude Visual Studio extension project. Additions sourced from Microsoft and NASM documentation.
ARM instruction documentation builds on top of ARM's official Exploration tools documentation
RISCV instruction and register documentation builds on top of the riscv-isadoc project