composer_lsp

Crates.iocomposer_lsp
lib.rscomposer_lsp
version0.0.3
sourcesrc
created_at2022-11-26 12:35:14.654171
updated_at2023-01-03 17:44:12.063329
descriptionA LSP server for composer
homepage
repositoryhttps://github.com/nkoporec/composer_lsp/
max_upload_size
id723227
size449,186
nkoporec (nkoporec)

documentation

README

composer_lsp

The composer language server provides various features for composer to make development easier and faster.

2022-11-10_17-28

Debugging

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.

Features

  • Shows when a package needs an update.
  • Package name hover, to show details about it.
  • Package go to definition.
  • Package name completion.
  • Actions to update the selected package.

Install

Using cargo

cargo install composer_lsp

Editor Setup

Neovim

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{}

VS Code

TODO - Still need to build an extension for it.

Commit count: 57

cargo fmt