Skip to content

Latest commit

 

History

History
114 lines (86 loc) · 3.19 KB

README.md

File metadata and controls

114 lines (86 loc) · 3.19 KB

PlantUML LSP

An implementation of the language server protocol (LSP) for PlantUML.

Disclaimer: This project is very early in devlopment, so many features will be missing. Contributions are welcome, please open an issue or PR if you would like to add something.

Installation

# clone repository
git clone https://github.com/ptdewey/plantuml-lsp.git
cd plantuml-lsp

# build lsp binary
go build
cd ..

# (optional but recommended) clone stdlib repo
git clone https://github.com/plantuml/plantuml-stdlib.git
# or alternatively, extract stdlib from plantuml executable
plantuml -extractstdlib

Setup

Neovim (with lspconfig):

config = function()
    local lspconfig = require("lspconfig")
    local configs = require("lspconfig.configs")
    if not configs.plantuml_lsp then
        configs.plantuml_lsp = {
            default_config = {
                cmd = { "/path/to/plantuml_lsp", "--stdlib-path=/path/to/plantuml-stdlib" },
                filetypes = { "plantuml" },
                root_dir = function(fname)
                    return lspconfig.util.find_git_ancestor(fname) or lspconfig.util.path.dirname(fname)
                end,
                settings = {},
            }
        }
    end
    lspconfig.plantuml_lsp.setup {}
end,
  • NOTE: This assumes plantuml is set up as a filetype already

VS Code:

TODO (I don't use VS Code)


Capabilities

Completion:

  • Core (WIP)

    • Types, keywords, directives
    • Colors, skinparams (Figuring out if these should be included)
  • stdlib/C4 (WIP)

    • Procedures
    • Functions, globals, defines, constants, variables (Todo)
  • Other stdlib (Todo)

  • User Defined (Todo)

  • Snippets (WIP)

    • Core (Todo)
    • stdlib/C4

Hover

  • Core
    • Example usage (Backlog)
  • stdlib/C4
    • Example usage (Backlog)
  • Other stdlib (Backlog)
  • User Defined (Backlog)

Definition

  • Core (Might be impossible with plantuml project structure)
  • stdlib/C4 (Todo)
  • Other stdlib (Backlog)
  • User Defined (Backlog)

Diagnostics

  • Core (Backlog)
  • stdlib/C4 (Backlog)
  • Other stdlib (Backlog)
  • User Defined (Backlog)

Other Language Server Features

Other language server features are not currently planned. See the language server protocol specification for more info about other features.


Developer Notes

LSP Specification

PlantUML Language specification: