indoorvivants / llvm-ir-lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LLMV IR LSP

just look at this poor defenceless I surrounded by consonants

This is an experimental Language Server to work with LLVM IR - the .ll files produced by compiler frontends.

Currently it focuses on the metadata section, but the intent is to expand support to everything that the IR supports and makes sense in the context of IDE experience.

Here's a GIF so you know it's solid.

2022-09-22 18 22 47

Features

Current feature set is very limited, but stay tuned - like and subscribe, smash that ⭐ button.

Metadata section

  • document symbols
  • go to definition
  • hover

Setup

This part is very editor specific and needs your contributions!

Regardless, it all starts from downloading a server binary from the Releases tab.

Neovim

In Nightly neovim, setting up a custom LSP is trivial:

local lsp = vim.api.nvim_create_augroup("LSP", { clear = true })
-- assuming the binary is in /usr/local/bin/LLVM_LanguageServer
vim.api.nvim_create_autocmd("FileType", {
  group = lsp,
  pattern = "lifelines",
  callback = function()
    vim.lsp.start({
      name = "LLVM LSP",
      cmd = { '/usr/local/bin/LLVM_LanguageServer' },
    })
  end
})

The reason it's so simple is because there already exists a filetype named lifelines associated with .ll files!

About


Languages

Language:Scala 83.3%Language:LLVM 15.5%Language:Makefile 1.2%