|
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] Neovimumple.nvimNeovim plugin for the Umple modeling language. Provides diagnostics, code completion, go-to-definition, find references, rename, hover, formatting, and syntax highlighting for Requirements
Installing prerequisitesmacOS (via Homebrew): brew install neovim node brew install openjdk # optional, for diagnostics Ubuntu/Debian: sudo apt install neovim nodejs npm build-essential sudo apt install default-jdk # optional, for diagnostics Setting up lazy.nvimIf you don’t have a plugin manager yet, follow the lazy.nvim installation guide. InstallationAdd this to your lazy.nvim plugin list: {
'umple/umple.nvim',
build = './scripts/build.sh',
dependencies = {
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require("umple-lsp").setup()
end,
}
The build script downloads the LSP server from npm and fetches the tree-sitter grammar. The tree-sitter parser is compiled automatically on first load — no manual steps needed. Auto-completion (recommended)For auto-popup completion, install a completion plugin such as nvim-cmp with cmp-nvim-lsp. Without one, the LSP server still provides completions but you won’t see them automatically. Configurationrequire("umple-lsp").setup({
port = 5556, -- UmpleSync port (default: 5556)
on_attach = function(client, bufnr)
-- your custom keybindings
end,
})
KeybindingsNo keybindings are set by default — use require("umple-lsp").setup({
on_attach = function(client, bufnr)
local opts = { buffer = bufnr }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format, opts)
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
end,
})
Features
Updating:Lazy update umple.nvim This pulls the latest plugin code and re-runs the build script (which updates the LSP server and tree-sitter grammar). TroubleshootingNo syntax highlightingThe plugin compiles the tree-sitter parser on first load. If it fails:
No diagnosticsDiagnostics require Java 11+. Verify: LSP not starting
DevelopmentTo test local changes to the LSP server:
workspace/ ├── umple-lsp/ # LSP server monorepo └── umple.nvim/ # This plugin
cd umple-lsp npm install npm run compile npm run download-jar
{
dir = '/path/to/umple.nvim',
dependencies = {
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require("umple-lsp").setup({
plugin_dir = '/path/to/umple.nvim',
})
end,
}
Then symlink the local server into the plugin’s expected locations: cd umple.nvim # Symlink tree-sitter grammar ln -sf ../umple-lsp/packages/tree-sitter-umple tree-sitter-umple # Symlink local server into node_modules (jar is already inside packages/server/) mkdir -p node_modules ln -sf ../../umple-lsp/packages/server node_modules/umple-lsp-server After making changes to the server, recompile and restart: cd umple-lsp npm run compile # Server-only changes npm run build-grammar # After grammar.js changes (regenerates parser + WASM + compiles) Then in Neovim: After grammar changes, also delete the cached native parser so Neovim recompiles it: rm -f ~/.local/share/nvim/site/parser/umple.so rm -rf ~/.local/share/nvim/site/queries/umple How it worksThe build script installs the pre-compiled umple-lsp-server from npm, downloads Original markdown source for this page: https://github.com/umple/umple.nvim/blob/master/README.md |