npm.io
0.2.4 • Published 2 months ago

spark-sql-language-server

Licence
MIT
Version
0.2.4
Deps
6
Size
19.3 MB
Vulns
0
Weekly
0

SparkSQL LSP language server web extension

A SparkSQL LSP server that runs in a web extension/WebWorker.

Functionality

This Language Server runs syntax validation while the textDocument's content is changing (turned off by default). In addition, it supports LSP capabilities including:

  • Auto-completion
  • Custom commands:
    • extension.sparksql.validationOn: used to turn on/off syntax validation in language server.

Usage

The package exports a worker JS file named "sparksql-server-worker". To run in a browser env, such as monaco-editor, please use it to create a Worker instance with the help of monaco-languageclient.

Use sendRequest API to execute custom commands:

languageClient.sendRequest(ExecuteCommandRequest.type, {
    command: "extension.sparksql.validationOn",
    arguments: [true]
});

Server-side i18n can also be configured with execute commands:

languageClient.sendRequest(ExecuteCommandRequest.method, {
    command: "extension.sparkSQL.setLocale",
    arguments: ["zh-CN"]
});

languageClient.sendRequest(ExecuteCommandRequest.method, {
    command: "extension.sparkSQL.registerI18nMessages",
    arguments: [
        "patch",
        {
            "zh-CN": {
                "lineage.node.query.resultSet.displayName": "查询结果集",
                "lineage.edge.semantic.mapping.displayName": "字段来源"
            }
        }
    ]
});

Other language servers

Keywords