https://github.com/mkslanc/websockets-ls
Language Server WebSocket Bridge for ace
https://github.com/mkslanc/websockets-ls
Last synced: 7 months ago
JSON representation
Language Server WebSocket Bridge for ace
- Host: GitHub
- URL: https://github.com/mkslanc/websockets-ls
- Owner: mkslanc
- License: mit
- Created: 2023-09-10T15:15:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T08:10:00.000Z (7 months ago)
- Last Synced: 2025-03-13T09:23:09.604Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 181 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Language Server WebSocket Bridge
## Overview
This script provides a WebSocket bridge to interface multiple Language Servers (e.g., `svelte-language-server`, `pylsp`, `gopls`, `clangd`, etc.) with clients via a single WebSocket connection. It supports various language servers concurrently and handles language-specific file extensions and initialization parameters.## Features
- Supports multiple language servers concurrently.
- Easy language server configuration and initialization parameter modification.
- Error handling and logging for language server processes.
- Utilizes `vscode-jsonrpc` for LSP message handling.
- Support for IPC and stdio communication with language servers.
- Automatic file URI translation between server and client paths.
- Temporary file creation for `textDocument/didOpen` events.## Usage
1. Install Node.js and the required language servers.
2. Configure the desired language servers in `defaultServers.js`.
3. Run the script: `node index.js`.
4. Connect to the WebSocket server on `ws://localhost:3030/`.
5. Transmit LSP messages via the WebSocket connection.## Configuration
Add or modify language server configurations in `defaultServers.js`:
```javascript
exports.servers = [
{
endpointName: "language_endpoint", // WebSocket endpoint name
args: ['executable_path', ['arg1', 'arg2', ...]],
nameEndsWith: ".file_extension",
connectionType: "ipc" | "stdio", // Communication type
relativePath: true | false, // Whether to use relative paths
serverFileNameReplacePattern: { // Server file name regex replacements
from: /pattern/,
to: "replacement"
},
clientFileNameReplacePattern: { // Client file name regex replacements
from: /pattern/,
to: "replacement"
}
}
// Add more language server configurations here
];