This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
forked from redhat-developer/vscode-yaml
-
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.
add web support (redhat-developer#594)
* add web support * fixes * Avoid NodeJS.Timeout * Update test/json-schema-cache.test.ts Co-authored-by: Yevhen Vydolob <[email protected]> * Update test/json-schema-cache.test.ts Co-authored-by: Yevhen Vydolob <[email protected]> * fix merge issues Co-authored-by: Yevhen Vydolob <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,387 additions
and
85 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules/ | |
out/ | ||
dist/ | ||
.vscode-test/ | ||
.vscode-test-web/ | ||
test/testFixture/.vscode | ||
*.vsix | ||
.DS_Store |
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
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
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
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,10 @@ | ||
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | ||
/* eslint-disable @typescript-eslint/no-empty-function */ | ||
class YAMLFormatter { | ||
constructor() {} | ||
configure() {} | ||
format() { | ||
return []; | ||
} | ||
} | ||
exports.YAMLFormatter = YAMLFormatter; |
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
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
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
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
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,44 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { ExtensionContext } from 'vscode'; | ||
import { startClient, LanguageClientConstructor, RuntimeEnvironment } from '../extension'; | ||
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient } from 'vscode-languageclient/node'; | ||
|
||
import { SchemaExtensionAPI } from '../schema-extension-api'; | ||
|
||
import { getRedHatService } from '@redhat-developer/vscode-redhat-telemetry'; | ||
import { JSONSchemaCache } from '../json-schema-cache'; | ||
|
||
// this method is called when vs code is activated | ||
export async function activate(context: ExtensionContext): Promise<SchemaExtensionAPI> { | ||
// Create Telemetry Service | ||
const telemetry = await (await getRedHatService(context)).getTelemetryService(); | ||
telemetry.sendStartupEvent(); | ||
|
||
// The YAML language server is implemented in node | ||
const serverModule = context.asAbsolutePath('./dist/languageserver.js'); | ||
|
||
// The debug options for the server | ||
const 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 | ||
const serverOptions: ServerOptions = { | ||
run: { module: serverModule, transport: TransportKind.ipc }, | ||
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }, | ||
}; | ||
|
||
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { | ||
return new LanguageClient(id, name, serverOptions, clientOptions); | ||
}; | ||
|
||
const runtime: RuntimeEnvironment = { | ||
telemetry, | ||
schemaCache: new JSONSchemaCache(context.globalStorageUri.fsPath, context.globalState), | ||
}; | ||
|
||
return startClient(context, newLanguageClient, runtime); | ||
} |
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
Oops, something went wrong.