Skip to content

Latest commit

 

History

History
168 lines (113 loc) · 4.55 KB

File metadata and controls

168 lines (113 loc) · 4.55 KB

ArmLS (preview)

ArmLS is a language server for Arm Assembly that offers a collection of modern code editor features such as in-editor diagnostics and on-hover documentation. It has builtin knowledge of the latest version of the architecture (Armv9.7-A) and implements the Language Server Protocol, making it compatible with many code editors.

Key features

ArmLS currently implements the following LSP functionality.

Hover

ArmLS can provide information about instruction mnemonics and their operands on hover.

Diagnostics

ArmLS offers real-time diagnostics support, either through its own internal diagnostics engine or through error mapping from a specified clang binary.

Completion

ArmLS provides completion suggestions for items like mnemonics, macros, and labels based on the cursor position.

Document symbols and goto definition

ArmLS detects and provides a list of useful symbols to your editor, and supports jumping to definitions.

Semantic highlighting

You can configure ArmLS to provide semantic highlighting to clients that support it, providing batteries-included syntax highlighting that can intelligently differentiate between symbol types.

Usage

ArmLS should be compatible with any LSP-compliant client, but has been explicitly tested in the following use cases.

VS Code

ArmLS has a VS Code extension (vscode-armls) that you can download from the Visual Studio Marketplace or the Open VSX Registry.

Neovim

Configuration

Simple setup (default config)
local config = {
    cmd = { "<path-to-armls-binary>" },
    filetypes = { "asm" },
    settings = {
        armls = {
            diagnostics = {
                enable = true,
                disableCategories = {
                    "invalidOperand",
                    "tooManyOperands",
                    "tooFewOperands",
                },
            },
        },
    },
}
vim.lsp.config("armls", config)
vim.lsp.enable("armls")
Granular internal diagnostics configuration
local config = {
    settings = {
        armls = {
            diagnostics = {
                enable = true,
                disableCategories = {
                    -- "unrecognisedInstruction",
                    -- "invalidOperand",
                    -- "tooManyOperands",
                    -- "tooFewOperands",
                },
            },
        },
    },
}
External diagnostics configuration
local config = {
    settings = {
        armls = {
            externalDiagnostics = {
                clang = {
                    path = "/path/to/clang-executable",
                    args = { "--target=aarch64" },
                    -- Or "--target=arm" if using A32.
                },
            },
        },
    },
}
A32 support
local config = {
    settings = {
        armls = {
        	defaultArchitecture = "A32",
        },
    },
}

Semantic highlighting

To disable semantic highlighting in Neovim, delete the semanticTokensProvider property in the armls language server configuration.

Compatibility

ArmLS has been tested against the following versions of each major operating system:

  • MacOS Sequoia
  • Ubuntu 24.04
  • Windows 11

Current limitations

ArmLS is in preview and has the current limitations:

  • ArmLS does not support cross-file references
  • ArmLS does not support C/C++ pre-processor syntax
  • The internal diagnostics engine is alpha quality and might display false positives. We recommend that you use clang-powered diagnostics at this time.
  • A32 only supports Unified Assembler Language (.syntax unified)

Contact

To report bugs or request enhancements, use GitHub issues.

Related resources