coc-make
v0.1.0
Published
Makefile language server support for coc.nvim
Readme
coc-make
A coc.nvim extension that provides Language Server Protocol support for Makefiles.
Features
- Diagnostics for parse errors
- Completions for targets, variables, and built-in functions
- Document symbols (outline of targets and variables)
- Folding ranges
- Semantic highlighting for targets, variables, prerequisites, recipes, and comments
Installation
Prerequisites
- coc.nvim installed in Vim/Neovim
- Node.js and npm
- The makefile-lsp server built and available
Local Installation
Build the makefile-lsp server first:
cd /path/to/makefile-lsp cargo build --releaseInstall and build the coc extension:
cd coc-make npm install npm run buildInstall the extension in coc.nvim:
:CocInstall file:///absolute/path/to/makefile-lsp/coc-makeOr alternatively, create a symlink in your coc extensions directory:
ln -s /absolute/path/to/makefile-lsp/coc-make ~/.config/coc/extensions/node_modules/coc-makeConfigure the LSP server path:
Add the following to your coc-settings.json (
:CocConfigin Vim):{ "make.enable": true, "make.serverPath": "/absolute/path/to/makefile-lsp/target/release/makefile-lsp" }
Verify Installation
- Open a Makefile
- Try typing targets or variables and you should see completions
- Check
:CocList extensionsto see ifcoc-makeis listed and active
Configuration
Available settings in coc-settings.json:
make.enable(boolean, default: true) - Enable/disable the extensionmake.serverPath(string, default: "makefile-lsp") - Path to the makefile-lsp executable
Development
To work on the extension:
# Watch for changes and rebuild
npm run watch
# After making changes, restart coc
:CocRestartTroubleshooting
- LSP not starting: Check that the
make.serverPathpoints to the correct executable - No completions: Verify the file is recognized as a Makefile
- Extension not loading: Check
:CocList extensionsand look for any error messages
