spark-sql-language-server
v0.2.4
Published
A LSP-based language server for Apache Spark SQL
Readme
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": "字段来源"
}
}
]
});