Skip to content

omeyenburg/mips-language-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mips-language-server

CI crates.io

A fast language server for the MIPS32/MIPS64 Instruction Set Architecture.
Supported assemblers: GAS, MARS, SPIM

Written in Rust with tower-lsp-server and tree-sitter.

Features

  • Completion
  • Hover information
  • Syntactic analysis and diagnostics

Planned Features

  • Deep semantic analysis
  • Goto definition
  • Context specific completions
  • Formatting
  • References
  • Documentation
  • Macros

Installation

Install from Crates.io

If you have cargo installed, you can install the language server via

cargo install mips-language-server

Install from Github Release

Download the latest release and add it to your path.

Build from source

Alternatively, you can build the source yourself:

Clone the repo and simply run

cargo build --release

You can find the resulting binary in target/release/.

Configuration

Settings

dialect

The dialect of your assembler/simulator (not case-sensitive).

Available: mars, spim, gas, unspecified

version

Mips ISA Version of you assembler/simulator. Not relevant if using mars or spim (not case-sensitive).

Available:

  • Legacy MIPS versions: 'mips1' (Mips I), 'mips2', (Mips II), 'mips3', (Mips III), 'mips4' (Mips IV), 'mips5' (Mips V)
  • MIPS32 versions: 'mips32r1', 'mips32r2', 'mips32r3', 'mips32r5', 'mips32r6'
  • MIPS64 versions: 'mips64r1', 'mips64r2', 'mips64r3', 'mips64r5', 'mips64r6'

Example Configuration

{
    "settings": {
        "mipsls": {
            "dialect": "Mars",
            "version": "Mips I"
        }
    }
}

Editor Integration

NeoVim

With the nvim-lspconfig plugin:

local config = {
    cmd = { '/path/to/compiled/binary' },
    filetypes = { 'asm' },
    settings = {
        mipsls = {
            dialect = 'gas',
            version = 'mips32r5',
        }
    }
}

vim.lsp.config("mipsls", config)
vim.lsp.enable("mipsls")

Testing

This was mostly tested with the latest NeoVim release together with the plugins lsp-config, nvim-cmp and blink.nvim. Further testing in different environments is highly appreciated.

Further reading

About

Language Server for the MIPS instruction set architecture with support for GAS, MARS and SPIM.

Topics

Resources

License

Stars

Watchers

Forks

Contributors