Registry / devops / flink-sql-language-server

flink-sql-language-server

JSON →
library0.7.1jsnpmunverified

A browser-based LSP language server for Apache Flink SQL, built with Antlr4ts. Provides code completions, diagnostics, rename, references, folding, hover, formatting, and code actions for Flink SQL files. Version 0.7.1 supports Flink 1.20. Released on npm, ships TypeScript types. Differentiates from generic SQL LSPs by offering Flink-specific SQL dialect support and custom commands for extracting SQL structure and registering schemas for auto-completion.

npm install flink-sql-language-server
INSTALL
IMPORT
SIG · FLINK-SQL-LANGUAGE
F
flink-sql-language-server
devopsjavascriptv0.7.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EXTRACT_SQL_STRUCTURE
import { EXTRACT_SQL_STRUCTURE } from 'flink-sql-language-server/out-tsc/constants';
import { EXTRACT_SQL_STRUCTURE } from 'flink-sql-language-server';
The constant is not exported from the main entry point; must import from the explicit path '/out-tsc/constants'.
Server
import { Server } from 'flink-sql-language-server';
const Server = require('flink-sql-language-server').Server;
The package is ESM-only; use ES import syntax. Default export is the Server class.
IDiagnostic
import type { IDiagnostic } from 'flink-sql-language-server';
import { IDiagnostic } from 'flink-sql-language-server';
IDiagnostic is a TypeScript interface; use 'import type' to avoid runtime issues.

Starts the Flink SQL Language Server and demonstrates integration with VS Code's LanguageClient.

import { Server } from 'flink-sql-language-server'; const server = new Server({ flinkVersion: '1.20', // ... other options }); // Listen for messages (e.g., via stdin/stdout for LSP) server.listen(); // Or use with vscode-languageclient: import { LanguageClient } from 'vscode-languageclient/node'; const client = new LanguageClient( 'flink-sql', 'Flink SQL Language Server', { run: { module: require.resolve('flink-sql-language-server'), transport: TransportKind.ipc } }, { documentSelector: [{ scheme: 'file', language: 'flinksql' }] } ); client.start();
Debug
Known issues
gotchaThe constant EXTRACT_SQL_STRUCTURE must be imported from a deep path in the package.
fix
Use import from 'flink-sql-language-server/out-tsc/constants'.
affects: >=0.7.0
breakingIn version 0.7.0, the server constructor signature changed: options object now requires 'flinkVersion' string.
fix
Ensure to pass { flinkVersion: '1.20' } or similar.
affects: >=0.7.0 <0.7.0
deprecatedThe 'registerSchemas' command with string arguments was replaced with an object argument in v0.6.0.
fix
Use executeCommand('extension.flinkSQL.registerSchemas', { catalogs: [...], databases: [...], tables: [...] })
affects: >=0.6.0
gotchaThe language server expects a language ID of 'flinksql' for document selectors.
fix
Set documentSelector to [{ language: 'flinksql' }].
affects: >=0.1.0
deprecatedThe 'FlinkSQL' class (capital letters) has been renamed to 'Server' since v0.5.0.
fix
Use the new 'Server' class instead.
affects: >=0.5.0
Errors
Common errors & fixes
Cannot find module 'flink-sql-language-server' or its corresponding type declarations.
Importing from the main entry point instead of the correct subpath.
fix
Use: import { Server } from 'flink-sql-language-server';
Command 'extension.flinkSQL.registerSchemas' failed: TypeError: Cannot read properties of undefined (reading 'catalogs')
Passing array arguments directly instead of an object with catalogs/databases/tables properties.
fix
Call: vscode.commands.executeCommand('extension.flinkSQL.registerSchemas', { catalogs: [...], databases: [...], tables: [...] })
The language client cannot activate because the server module is not found.
Using wrong path in LanguageClient options. The module should point to the package's main file.
fix
Set the 'run.module' option to require.resolve('flink-sql-language-server').
Upgrade
Version history
0.7.1latest on npm
Audit
Dependencies
antlr4tsrequiredGrammar-based parsing of Flink SQL
Agent activity
41 hits · last 30 days
node
34
Resources
flink-sql-language-server — npm install flink-sql-language-server · libregistry