Files
carbon-lang/utils/vscode/src/extension.js
T
maan2003 7c891fdacd Language Server (#3112)
Add a language server for carbon as part of GSoC.

This currently does code outline using toolchain parser.

See development steps in utils/vscode/README.md for running and using
language server.
2023-08-21 18:39:31 +00:00

37 lines
823 B
JavaScript

/*
* Part of the Carbon Language project, under the Apache License v2.0 with LLVM
* Exceptions. See /LICENSE for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
const { LanguageClient } = require('vscode-languageclient/node');
function activate(context) {
const command = './bazel-bin/language_server/language_server';
const serverOptions = {
run: { command },
debug: { command },
};
const clientOptions = {
documentSelector: [{ scheme: 'file', language: 'carbon' }],
};
const client = new LanguageClient(
'languageServer',
'Language Server for Carbon',
serverOptions,
clientOptions
);
// stop client on shutdown
context.subscriptions.push(client.start());
}
function deactivate() {}
module.exports = {
activate,
deactivate,
};