openapi-language-server

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 8 Imported by: 0

README

OpenAPI Language Server

An OpenAPI language server for LSP compatible code editors.

⚠ This is beta software. Many features are still missing. See Features below.

asciicast

Features

I created this language server because I manually edit OpenAPI/Swagger files, and I needed a quick way to jump between schema definitions and references.

I use yaml-language-server for validation and completion, so these features are not a priority for me right now.

Language Features
  • Jump to definition
  • Find references
  • Code completion
  • Diagnostics
  • Hover
  • Rename
  • Document symbols
  • Code actions
Other Features
  • YAML filetype support
  • JSON filetype support
  • VSCode extension

Installation

Download the latest release from GitHub releases.

Using Go
go install github.com/armsnyder/openapi-language-server@latest

Usage

Neovim Configuration Example

Assuming you are using Neovim and have the installed openapi-language-server binary in your PATH, you can use the following Lua code in your Neovim configuration:

    vim.api.nvim_create_autocmd('FileType', {
      pattern = 'yaml',
      callback = function()
        vim.lsp.start {
          cmd = { 'openapi-language-server' },
          filetypes = { 'yaml' },
          root_dir = vim.fn.getcwd(),
        }
      end,
    })

This is just a basic working example. You will probably want to further customize the configuration to your needs.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
analysis
Package analysis contains the OpenAPI Language Server business logic.
Package analysis contains the OpenAPI Language Server business logic.
analysis/yaml
Package yaml provides parsing and analysis of YAML documents.
Package yaml provides parsing and analysis of YAML documents.
lsp
Package lsp provides a pluggable language server protocol implementation, as well as utilities to make building language servers easier.
Package lsp provides a pluggable language server protocol implementation, as well as utilities to make building language servers easier.
lsp/jsonrpc
Package jsonrpc provides utilities for working with the JSON-RPC protocol.
Package jsonrpc provides utilities for working with the JSON-RPC protocol.
lsp/testutil
Package testutil provides common utilities for testing the LSP server.
Package testutil provides common utilities for testing the LSP server.
lsp/types
Package types contains the Language Server Protocol specification types.
Package types contains the Language Server Protocol specification types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL