mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as path from 'path';
|
||||
|
||||
import { workspace, languages, ExtensionContext, extensions, Uri, TextDocument, ColorInformation, Color, ColorPresentation } from 'vscode';
|
||||
import { workspace, languages, ExtensionContext, extensions, Uri, TextDocument, ColorInformation, Color, ColorPresentation, LanguageConfiguration } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification } from 'vscode-languageclient';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
import { ConfigurationFeature } from 'vscode-languageclient/lib/configuration.proposed';
|
||||
@@ -67,7 +67,7 @@ export function activate(context: ExtensionContext) {
|
||||
// The server is implemented in node
|
||||
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'jsonServerMain.js'));
|
||||
// The debug options for the server
|
||||
let debugOptions = { execArgv: ['--nolazy', '--inspect=6004'] };
|
||||
let debugOptions = { execArgv: ['--nolazy', '--inspect'] };
|
||||
|
||||
// If the extension is launch in debug mode the debug server options are use
|
||||
// Otherwise the run options are used
|
||||
@@ -76,7 +76,7 @@ export function activate(context: ExtensionContext) {
|
||||
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
|
||||
};
|
||||
|
||||
let documentSelector = ['json'];
|
||||
let documentSelector = ['json', 'jsonc'];
|
||||
|
||||
// Options to control the language client
|
||||
let clientOptions: LanguageClientOptions = {
|
||||
@@ -159,13 +159,15 @@ export function activate(context: ExtensionContext) {
|
||||
}));
|
||||
});
|
||||
|
||||
languages.setLanguageConfiguration('json', {
|
||||
let languageConfiguration: LanguageConfiguration = {
|
||||
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|[^\s{}\[\],:]+/,
|
||||
indentationRules: {
|
||||
increaseIndentPattern: /^.*(\{[^}]*|\[[^\]]*)$/,
|
||||
decreaseIndentPattern: /^\s*[}\]],?\s*$/
|
||||
}
|
||||
});
|
||||
};
|
||||
languages.setLanguageConfiguration('json', languageConfiguration);
|
||||
languages.setLanguageConfiguration('jsonc', languageConfiguration);
|
||||
}
|
||||
|
||||
function getSchemaAssociation(context: ExtensionContext): ISchemaAssociations {
|
||||
|
||||
Reference in New Issue
Block a user