Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions bin/yaml-language-server
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
#!/usr/bin/env node

const version = require('../package.json').version;
const args = process.argv.slice(2);

if (args.includes('--version') || args.includes('-version')) {
console.log(version);
process.exit(0);
}

if (args.includes('--help') || args.includes('-help') || args.includes('-h')) {
console.log(`Usage: yaml-language-server [transport]

LSP transport options:
--stdio communicate using standard input/output (stdin/stdout)
--node-ipc communicate using Node IPC
--socket=<number> listen on a TCP socket on the given port number

Other:
--version | -version print product version to the output stream and exit
--help | -help | -h print this help message to the output stream and exit
`);
process.exit(0);
}

process.env.YAML_LANGUAGE_SERVER_VERSION = version;
require('../out/server/src/server.js');
4 changes: 4 additions & 0 deletions src/yamlServerInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ export class YAMLServerInit {
registerCommands(commandExecutor, this.connection);
await this.setupl10nBundle(params);
return {
serverInfo: {
name: 'yaml-language-server',
version: process.env.YAML_LANGUAGE_SERVER_VERSION || 'unknown',
},
capabilities: {
textDocumentSync: TextDocumentSyncKind.Incremental,
completionProvider: { resolveProvider: false },
Expand Down