Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to nvim-lspconfig #321

Open
checkraisefold opened this issue May 22, 2022 · 1 comment
Open

Add to nvim-lspconfig #321

checkraisefold opened this issue May 22, 2022 · 1 comment

Comments

@checkraisefold
Copy link

checkraisefold commented May 22, 2022

https://github.com/neovim/nvim-lspconfig

It's pretty simplistic to make a configuration, but I'm not familiar with dm-langserver at all and don't know Rust so I can't properly make it. I don't know the proper capabilities. If a maintainer wants to pick this up, here's the barebones functionality server config I made:

local util = require 'lspconfig.util'

local bin_name = 'dm-langserver'
local cmd = { bin_name }

if vim.fn.has 'win32' == 1 then
  cmd = { 'cmd.exe', '/C', bin_name }
end

return {
  default_config = {
    cmd = cmd,
    filetypes = { 'dm', 'dme' },
    root_dir = util.root_pattern('SpacemanDMM.toml', '.git'),
  },
  docs = {
    description = [[
https://github.com/SpaceManiac/SpacemanDMM/tree/master/crates/dm-langserver

Language Server for BYOND DreamMaker code

`dm-langserver` can be installed via cargo:
cargo install --git https://github.com/SpaceManiac/SpacemanDMM.git dm-langserver
]],
  },
}

In addition, it looks like DM files require a filetype autocmd for the LSP to work properly.

vim.cmd [[ autocmd BufNewFile,BufRead *.dm,*.dme set filetype=dm ]]

@checkraisefold
Copy link
Author

It might also be worth making syntax highlighting for neovim if anyone is interested, since the only syntax highlighting right now is from 2016 and kind of sucks in comparison to vscode langclient syntax highlighting
https://github.com/ccraciun/vim-dreammaker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant