[json] update to latest languageserver

This commit is contained in:
Martin Aeschlimann 2016-08-12 18:34:24 +02:00
parent 70a13f2d11
commit fbe40a406a
7 changed files with 180 additions and 155 deletions

View file

@ -5,7 +5,7 @@
'use strict';
import {
IPCMessageReader, IPCMessageWriter, createConnection, IConnection, Range,
createConnection, IConnection, Range,
TextDocuments, TextDocument, InitializeParams, InitializeResult, RequestType
} from 'vscode-languageserver';

View file

@ -10,6 +10,9 @@ import {workspace, languages, ExtensionContext, extensions, Uri} from 'vscode';
import {LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType} from 'vscode-languageclient';
import TelemetryReporter from 'vscode-extension-telemetry';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
namespace VSCodeContentRequest {
export const type: RequestType<string, string, any> = { get method() { return 'vscode/content'; } };
}
@ -63,7 +66,7 @@ export function activate(context: ExtensionContext) {
};
// Create the language client and start the client.
let client = new LanguageClient('JSON Server', serverOptions, clientOptions);
let client = new LanguageClient('json', localize('jsonserver.name', 'JSON Language Server'), serverOptions, clientOptions);
client.onTelemetry(e => {
if (telemetryReporter) {
telemetryReporter.sendTelemetryEvent(e.key, e.data);

View file

@ -18,9 +18,19 @@
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-2.2.0.tgz"
},
"vscode-languageclient": {
"version": "2.3.0",
"from": "vscode-languageclient@>=2.2.1 <3.0.0",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-2.3.0.tgz"
"version": "2.4.2-next.3",
"from": "vscode-languageclient@next",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-2.4.2-next.3.tgz"
},
"vscode-languageserver-types": {
"version": "1.0.1",
"from": "vscode-languageserver-types@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-1.0.1.tgz"
},
"vscode-nls": {
"version": "1.0.7",
"from": "vscode-nls@latest",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-1.0.7.tgz"
},
"winreg": {
"version": "0.0.13",

View file

@ -1,140 +1,148 @@
{
"name": "json",
"version": "0.1.0",
"publisher": "vscode",
"aiKey":"AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {
"vscode": "0.10.x"
},
"activationEvents": [
"onLanguage:json"
],
"main": "./client/out/jsonMain",
"scripts": {
"compile": "gulp compile-extension:json-client && gulp compile-extension:json-server",
"postinstall": "cd server && npm install"
},
"contributes": {
"languages": [
{
"id": "json",
"aliases": [
"JSON",
"json"
],
"extensions": [
".json",
".bowerrc",
".jshintrc",
".jscsrc",
".eslintrc",
".babelrc",
".webmanifest"
],
"mimetypes": [
"application/json",
"application/manifest+json"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "json",
"scopeName": "source.json",
"path": "./syntaxes/JSON.tmLanguage"
}
],
"jsonValidation": [
{
"fileMatch": "*.schema.json",
"url": "http://json-schema.org/draft-04/schema#"
},
{
"fileMatch": "package.json",
"url": "vscode://schemas/vscode-extensions"
},
{
"fileMatch": "*language-configuration.json",
"url": "vscode://schemas/language-configuration"
},
{
"fileMatch": "vscode://defaultsettings/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "vscode://defaultsettings/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/locale.json",
"url": "vscode://schemas/locale"
},
{
"fileMatch": "/.vscode/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "/.vscode/launch.json",
"url": "vscode://schemas/launch"
},
{
"fileMatch": "/.vscode/tasks.json",
"url": "vscode://schemas/tasks"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json",
"url": "vscode://schemas/snippets"
}
],
"configuration": {
"id": "json",
"order": 20,
"type": "object",
"title": "JSON",
"properties" : {
"json.schemas" : {
"type": "array",
"description": "Associate schemas to JSON files in the current project",
"items": {
"type": "object",
"default": { "fileMatch": [ "{{/myfile}}" ], "url": "{{schemaURL}}" },
"properties": {
"url": {
"type": "string",
"default": "/user.schema.json",
"description": "A URL to a schema or a relative path to a schema in the current directory"
},
"fileMatch": {
"type": "array",
"items": {
"type": "string",
"default": "MyFile.json",
"description": "A file pattern that can contain '*' to match against when resolving JSON files to schemas."
},
"minItems": 1,
"description": "An array of file patterns to match against when resolving JSON files to schemas."
},
"schema": {
"$ref": "http://json-schema.org/draft-04/schema#",
"description": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL."
}
}
}
}
}
}
},
"dependencies": {
"vscode-languageclient": "^2.2.1",
"vscode-extension-telemetry": "^0.0.5"
}
"name": "json",
"version": "0.1.0",
"publisher": "vscode",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"engines": {
"vscode": "0.10.x"
},
"activationEvents": [
"onLanguage:json"
],
"main": "./client/out/jsonMain",
"scripts": {
"compile": "gulp compile-extension:json-client && gulp compile-extension:json-server",
"postinstall": "cd server && npm install",
"install-client-next": "npm install vscode-languageclient@next -f -S",
"install-client-local": "npm install ../../../vscode-languageserver-node/client -f -S"
},
"contributes": {
"languages": [
{
"id": "json",
"aliases": [
"JSON",
"json"
],
"extensions": [
".json",
".bowerrc",
".jshintrc",
".jscsrc",
".eslintrc",
".babelrc",
".webmanifest"
],
"mimetypes": [
"application/json",
"application/manifest+json"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "json",
"scopeName": "source.json",
"path": "./syntaxes/JSON.tmLanguage"
}
],
"jsonValidation": [
{
"fileMatch": "*.schema.json",
"url": "http://json-schema.org/draft-04/schema#"
},
{
"fileMatch": "package.json",
"url": "vscode://schemas/vscode-extensions"
},
{
"fileMatch": "*language-configuration.json",
"url": "vscode://schemas/language-configuration"
},
{
"fileMatch": "vscode://defaultsettings/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/keybindings.json",
"url": "vscode://schemas/keybindings"
},
{
"fileMatch": "vscode://defaultsettings/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/locale.json",
"url": "vscode://schemas/locale"
},
{
"fileMatch": "/.vscode/settings.json",
"url": "vscode://schemas/settings"
},
{
"fileMatch": "/.vscode/launch.json",
"url": "vscode://schemas/launch"
},
{
"fileMatch": "/.vscode/tasks.json",
"url": "vscode://schemas/tasks"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json",
"url": "vscode://schemas/snippets"
}
],
"configuration": {
"id": "json",
"order": 20,
"type": "object",
"title": "JSON",
"properties": {
"json.schemas": {
"type": "array",
"description": "Associate schemas to JSON files in the current project",
"items": {
"type": "object",
"default": {
"fileMatch": [
"{{/myfile}}"
],
"url": "{{schemaURL}}"
},
"properties": {
"url": {
"type": "string",
"default": "/user.schema.json",
"description": "A URL to a schema or a relative path to a schema in the current directory"
},
"fileMatch": {
"type": "array",
"items": {
"type": "string",
"default": "MyFile.json",
"description": "A file pattern that can contain '*' to match against when resolving JSON files to schemas."
},
"minItems": 1,
"description": "An array of file patterns to match against when resolving JSON files to schemas."
},
"schema": {
"$ref": "http://json-schema.org/draft-04/schema#",
"description": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL."
}
}
}
}
}
}
},
"dependencies": {
"vscode-extension-telemetry": "^0.0.5",
"vscode-languageclient": "^2.4.2-next.3",
"vscode-nls": "^1.0.7"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "vscode-json-server",
"version": "0.0.1",
"name": "vscode-json-languageserver",
"version": "1.0.0",
"dependencies": {
"agent-base": {
"version": "1.0.2",
@ -44,7 +44,8 @@
},
"vscode-json-languageservice": {
"version": "1.1.4",
"from": "vscode-json-languageservice@>=1.1.3-next.7 <2.0.0"
"from": "vscode-json-languageservice@1.1.4",
"resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-1.1.4.tgz"
},
"vscode-jsonrpc": {
"version": "2.2.0",
@ -52,9 +53,9 @@
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-2.2.0.tgz"
},
"vscode-languageserver": {
"version": "2.2.1",
"from": "vscode-languageserver@>=2.2.0 <3.0.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-2.2.1.tgz"
"version": "2.4.0-next.4",
"from": "vscode-languageserver@next",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-2.4.0-next.4.tgz"
},
"vscode-languageserver-types": {
"version": "1.0.1",

View file

@ -1,7 +1,7 @@
{
"name": "vscode-json-server",
"name": "vscode-json-languageserver",
"description": "JSON language server",
"version": "0.0.1",
"version": "1.0.0",
"author": "Microsoft Corporation",
"license": "MIT",
"engines": {
@ -10,12 +10,15 @@
"dependencies": {
"request-light": "^0.1.0",
"vscode-json-languageservice": "^1.1.4",
"vscode-languageserver": "^2.2.0",
"vscode-languageserver": "^2.4.0-next.4",
"vscode-nls": "^1.0.4"
},
"scripts": {
"compile": "gulp compile-extension:json-server",
"watch": "gulp watch-extension:json-server",
"update-ls": "npm install vscode-json-languageservice@next --save"
"install-service-next": "npm install vscode-json-languageservice@next -f -S",
"install-service-local": "npm install ../../../../vscode-json-languageservice -f -S",
"install-server-next": "npm install vscode-languageserver@next -f -S",
"install-server-local": "npm install ../../../../vscode-languageserver-node/server -f -S"
}
}

View file

@ -5,7 +5,7 @@
'use strict';
import {
IPCMessageReader, IPCMessageWriter, createConnection, IConnection,
createConnection, IConnection,
TextDocuments, TextDocument, InitializeParams, InitializeResult, NotificationType, RequestType
} from 'vscode-languageserver';
@ -37,7 +37,7 @@ namespace VSCodeContentRequest {
}
// Create a connection for the server
let connection: IConnection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process));
let connection: IConnection = createConnection();
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);