-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added language server for HTML and CSS
- Loading branch information
1 parent
c0db87f
commit c241236
Showing
19 changed files
with
2,005 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
*.vsix | ||
local/ | ||
local/ | ||
out | ||
node_modules | ||
client/server | ||
.vscode-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "lsp-sample-client", | ||
"description": "VSCode part of a language server", | ||
"author": "Microsoft Corporation", | ||
"license": "MIT", | ||
"version": "0.0.1", | ||
"publisher": "vscode", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Microsoft/vscode-extension-samples" | ||
}, | ||
"engines": { | ||
"vscode": "^1.43.0" | ||
}, | ||
"dependencies": { | ||
"vscode-languageclient": "^6.1.3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^12.12.0", | ||
"@types/vscode": "^1.43.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* -------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* ------------------------------------------------------------------------------------------ */ | ||
|
||
import * as path from 'path'; | ||
import { ExtensionContext } from 'vscode'; | ||
|
||
import { | ||
LanguageClient, | ||
LanguageClientOptions, | ||
ServerOptions, | ||
TransportKind | ||
} from 'vscode-languageclient'; | ||
|
||
let client: LanguageClient; | ||
|
||
export function activate(context: ExtensionContext) { | ||
// The server is implemented in node | ||
let serverModule = context.asAbsolutePath( | ||
path.join('server', 'out', 'server.js') | ||
); | ||
// The debug options for the server | ||
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging | ||
let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] }; | ||
|
||
// If the extension is launched in debug mode then the debug server options are used | ||
// Otherwise the run options are used | ||
let serverOptions: ServerOptions = { | ||
run: { module: serverModule, transport: TransportKind.ipc }, | ||
debug: { | ||
module: serverModule, | ||
transport: TransportKind.ipc, | ||
options: debugOptions | ||
} | ||
}; | ||
|
||
// Options to control the language client | ||
let clientOptions: LanguageClientOptions = { | ||
// Register the server for plain text documents | ||
documentSelector: [{ scheme: 'file', language: 'abell' }] | ||
}; | ||
|
||
// Create the language client and start the client. | ||
client = new LanguageClient( | ||
'languageServerExample', | ||
'Language Server Example', | ||
serverOptions, | ||
clientOptions | ||
); | ||
|
||
// Start the client. This will also launch the server | ||
client.start(); | ||
} | ||
|
||
export function deactivate(): Thenable<void> | undefined { | ||
if (!client) { | ||
return undefined; | ||
} | ||
return client.stop(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es2019", | ||
"lib": ["ES2019"], | ||
"outDir": "out", | ||
"rootDir": "src", | ||
"sourceMap": true | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules", ".vscode-test"] | ||
} |
Oops, something went wrong.