All Projects → fischerling → vis-lspc

fischerling / vis-lspc

Licence: GPL-3.0 license
language server protocol client for the vis editor

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to vis-lspc

typescript-language-server
TypeScript & JavaScript Language Server
Stars: ✭ 1,118 (+4558.33%)
Mutual labels:  language-server-protocol, lsp
Dockerfile Language Server Nodejs
A language server for Dockerfiles powered by Node.js, TypeScript, and VSCode technologies.
Stars: ✭ 170 (+608.33%)
Mutual labels:  language-server-protocol, lsp
Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+14108.33%)
Mutual labels:  language-server-protocol, lsp
groovy-language-server
A language server for Groovy
Stars: ✭ 132 (+450%)
Mutual labels:  language-server-protocol, lsp
Csharp Language Server Protocol
Language Server Protocol in C#
Stars: ✭ 230 (+858.33%)
Mutual labels:  language-server-protocol, lsp
Protocol Buffers Language Server
[WIP] Protocol Buffers Language Server
Stars: ✭ 44 (+83.33%)
Mutual labels:  language-server-protocol, lsp
LspCpp
A Language Server Protocol implementation in C++
Stars: ✭ 40 (+66.67%)
Mutual labels:  language-server-protocol, lsp
Monaco Languageclient
NPM module to connect Monaco editor with language servers
Stars: ✭ 419 (+1645.83%)
Mutual labels:  language-server-protocol, lsp
Haskell Ide Engine
The engine for haskell ide-integration. Not an IDE
Stars: ✭ 2,433 (+10037.5%)
Mutual labels:  language-server-protocol, lsp
Cquery
C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more
Stars: ✭ 2,338 (+9641.67%)
Mutual labels:  language-server-protocol, lsp
Lsp
Client implementation of the Language Server Protocol for Sublime Text
Stars: ✭ 1,018 (+4141.67%)
Mutual labels:  language-server-protocol, lsp
tower-lsp
Language Server Protocol implementation written in Rust
Stars: ✭ 455 (+1795.83%)
Mutual labels:  language-server-protocol, lsp
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+3216.67%)
Mutual labels:  language-server-protocol, lsp
Glsl Language Server
Language server implementation for GLSL
Stars: ✭ 53 (+120.83%)
Mutual labels:  language-server-protocol, lsp
Typescript Language Server
TypeScript & JavaScript Language Server
Stars: ✭ 462 (+1825%)
Mutual labels:  language-server-protocol, lsp
Elm Language Client Vscode
Improving your Elm experience since 2019
Stars: ✭ 162 (+575%)
Mutual labels:  language-server-protocol, lsp
Erlang ls
The Erlang Language Server
Stars: ✭ 363 (+1412.5%)
Mutual labels:  language-server-protocol, lsp
Atom Languageclient
Language Server Protocol support for Atom (the basis of Atom-IDE)
Stars: ✭ 385 (+1504.17%)
Mutual labels:  language-server-protocol, lsp
Fsautocomplete
F# language server using Language Server Protocol
Stars: ✭ 208 (+766.67%)
Mutual labels:  language-server-protocol, lsp
lsp-test
A functional test framework for LSP servers
Stars: ✭ 35 (+45.83%)
Mutual labels:  language-server-protocol, lsp

vis-lspc

A language server protocol client for the vis editor.

Whats working

vis-lspc currently supports:

  • textDocument/completion
  • textDocument/declaration
  • textDocument/definition
  • textDocument/references
  • textDocument/typeDefinition
  • textDocument/implementation
  • textDocument/hover
  • textDocument/rename
  • [Diagnostics]

Whats not working

Everything else.

To my knowledge there is currently no good way to detect file changes via the Lua API. But this is essential to support Text Synchronization which is required by the LSP protocol.

A dirty workaround we currently use is to send the whole file content in a textDocument/didChange method call before calling any other method. If someone can come up with an idea how to solve this I would appreciate contributions.

Communicating with language-servers via other channels than stdin/stdout.

Currently only clangd, pylsp and lua-language-server are configured by default and somewhat tested.

Requirements

  • vis must be compiled with the Lua communicate API.
  • The language server you want to use. Microsoft's list of implementations
  • Optional: the json implementation of your choice
    • must provide encode and decode methods
    • vis-lspc tries to find a suitable json implementation using those candidates:
      • json
      • cjson
      • dkjson
      • bundled fallback (no utf8 support)

Installation

  1. Clone this repository into your vis plugins directory
  2. Load the plugin in your visrc.lua with require('plugins/vis-lspc')

Easy vis-lspc installation with GuixRUs

The GuixRUs channel provides a fork of vis with the communicate API patches applied. Additionally, vis-lspc is bundled for convenience.

After adding GuixRUs to your channels.scm, run the following command to build and install vis-lsp:

guix install vis-lsp

Alternatively, you can clone GuixRUs and install from a local git checkout:

git clone https://git.sr.ht/~whereiseveryone/guixrus

cd guixrus

guix install -L . vis-lsp

Usage

vis-lspc is in a early state, but if you are brave there are some default key bindings:

Default Bindings

Normal mode:
<F2> - start a language server for win.syntax
<F3> - open win.file with a running language server
<C-]> | <gd> - jump to the definition of the symbol under the main cursor
<gD> - jump to declaration
<gd> - jump to definition
<gi> - jump to implementation
<gr> - show references
< D> - jump to type definition
<C-t> - go back in the jump history
< e> - show diagnostics of current line
<K> - hover over current position
Normal and Insert mode:
<C- > - get completions

Available commands

# language-server management:
lspc-start-server [syntax] - start a language server for syntax or win.syntax
lspc-stop-server [syntax] - stop the language server for syntax or win.syntax

# file registration:
lspc-open - register the file in the current window
lspc-close - unregister the file in the current window

# navigation commands (they all operate on the symbol under the main cursor):
lspc-completion - syntax completion
lspc-references [e | vsplit | hsplit] - select and open a reference
lspc-declaration [e | vsplit | hsplit] - select and open a declaration
lspc-definition [e | vsplit | hsplit] - open the definition
lspc-typeDeclaration [e | vsplit | hsplit] - select and open a type declaration
lspc-implementation [e | vsplit | hsplit] - I actually have no idea what this does

lspc-back - navigate back in the goto history

# workspace edits
lspc-rename <new name> - rename the identifier under the cursor to <new name>

# development support
lspc-hover - hover over the current line
lspc-show-diagnostics - show the available diagnostics of the current line

Available configuration options

The module table returned by require('plugins/vis-lspc') can be use to configure some aspects of vis-lspc.

Available options are:

  • name = 'vis-lspc' - the name vis-lspc introduces itself to a language server
  • logging = false - enable logging only useful for debugging vis-lspc
  • log_file = nil - nil, filename or function returning a filename
    • If log_file is nil vis-lspc will create a new file in $XDG_DATA_HOME/vis-lspc
  • autostart = true - try to start a language server in WIN_OPEN
  • menu_cmd = 'fzf' or 'vis-menu' - program to prompt for user choices
  • confirm_cmd = 'vis-menu' - program to prompt for user confirmation
  • ls_map - a table mapping vis syntax names to language server configurations
  • highlight_diagnostics = false - highlight available diagnostics
  • diagnostic_style = 'back:#e3514f' - style used to highlight diagnostics

Configure your own Language Server

If vis-lspc has no language server configuration for your desired language or server you have to create a language server configuration and insert it into the ls_map table. Please have a look at #2 and share your configuration with everyone else.

A language server configuration is a Lua table containing a name field which is used to manage the language server. And a cmd field which is used to start the language server.

Note: the language server must communicate with vis-lspc via stdio. Your language server probably supports stdio but maybe requires a special command line flag.

Example: The language server configuration for clangd and its entries in ls_map

-- clangd language server configuration
local clangd = {name = 'clangd', cmd = 'clangd'}

-- map of known language servers per syntax
lspc.ls_map = {cpp = clangd, ansi_c = clangd}

Language servers configured in vis-lspc can be found in supported_servers.lua.

License

All code except otherwise noted is licensed under the term of GPL-3. See the LICENSE file for more details. Our fallback json implementation in json.lua is NOT licensed under GPL-3. It is taken from here and is put into public domain by Tyler Neylon.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].