Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/armsnyder/openapi-language-server
OpenAPI language server for LSP compatible code editors
https://github.com/armsnyder/openapi-language-server
language-server lsp lsp-server neovim openapi openapi3 swagger vscode yaml
Last synced: about 1 month ago
JSON representation
OpenAPI language server for LSP compatible code editors
- Host: GitHub
- URL: https://github.com/armsnyder/openapi-language-server
- Owner: armsnyder
- License: mit
- Created: 2024-06-23T11:56:13.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-20T18:09:17.000Z (about 2 months ago)
- Last Synced: 2024-09-30T23:01:32.349Z (about 2 months ago)
- Topics: language-server, lsp, lsp-server, neovim, openapi, openapi3, swagger, vscode, yaml
- Language: Go
- Homepage:
- Size: 55.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI Language Server
An OpenAPI language server for [LSP compatible code
editors.](https://microsoft.github.io/language-server-protocol/implementors/tools/)> :warning: This is beta software. Many features are still missing. See
> [Features](https://github.com/armsnyder/openapi-language-server?tab=readme-ov-file#features)
> below.[![asciicast](https://asciinema.org/a/v7etZb80HbYkKBQUa3dVSenPz.svg)](https://asciinema.org/a/v7etZb80HbYkKBQUa3dVSenPz)
## 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](https://github.com/redhat-developer/yaml-language-server)
for validation and completion, so these features are not a priority for me
right now.### Language Features
- [x] Jump to definition
- [x] Find references
- [ ] Code completion
- [ ] Diagnostics
- [ ] Hover
- [ ] Rename
- [ ] Document symbols
- [ ] Code actions### Other Features
- [x] YAML filetype support
- [ ] JSON filetype support
- [ ] VSCode extension## Installation
### From GitHub Releases (Recommended)
Download the latest release from [GitHub releases](https://github.com/armsnyder/openapi-language-server/releases).
### Using Go
```bash
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:```lua
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.