Crates.io | composer_lsp |
lib.rs | composer_lsp |
version | 0.0.3 |
source | src |
created_at | 2022-11-26 12:35:14.654171 |
updated_at | 2023-01-03 17:44:12.063329 |
description | A LSP server for composer |
homepage | |
repository | https://github.com/nkoporec/composer_lsp/ |
max_upload_size | |
id | 723227 |
size | 449,186 |
The composer language server provides various features for composer to make development easier and faster.
For better debugging, you can use additional file logging with log4rs crate. A enviroment variable COMPOSER_LSP_LOG
needs to be set, which points to the log4rs yaml config file. For more information check the log4rs documentation.
Using cargo
cargo install composer_lsp
Plugins required:
After installing the package, add this to your lua config
local configs = require 'lspconfig.configs'
local lspconfig = require 'lspconfig'
if not configs.composer_lsp then
configs.composer_lsp = {
default_config = {
cmd = {'composer_lsp'},
filetypes = {'json'},
root_dir = function(pattern)
local cwd = vim.loop.cwd()
local root = lspconfig.util.root_pattern('composer.json', '.git')(pattern)
-- prefer cwd if root is a descendant
return lspconfig.util.path.is_descendant(cwd, root) and cwd or root
end,
settings = {},
},
}
end
lspconfig.composer_lsp.setup{}
TODO - Still need to build an extension for it.