mirror of
https://github.com/Microsoft/vscode
synced 2024-06-30 23:04:56 +00:00
css/json/html web: adopt LanguageClient API change (#218060)
This commit is contained in:
parent
1b27e602ed
commit
a28cbc207a
|
@ -8,13 +8,6 @@ import { BaseLanguageClient, LanguageClientOptions } from 'vscode-languageclient
|
||||||
import { startClient, LanguageClientConstructor } from '../cssClient';
|
import { startClient, LanguageClientConstructor } from '../cssClient';
|
||||||
import { LanguageClient } from 'vscode-languageclient/browser';
|
import { LanguageClient } from 'vscode-languageclient/browser';
|
||||||
|
|
||||||
declare const Worker: {
|
|
||||||
new(stringUrl: string): any;
|
|
||||||
};
|
|
||||||
declare const TextDecoder: {
|
|
||||||
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
|
|
||||||
};
|
|
||||||
|
|
||||||
let client: BaseLanguageClient | undefined;
|
let client: BaseLanguageClient | undefined;
|
||||||
|
|
||||||
// this method is called when vs code is activated
|
// this method is called when vs code is activated
|
||||||
|
@ -25,7 +18,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
||||||
|
|
||||||
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
||||||
return new LanguageClient(id, name, clientOptions, worker);
|
return new LanguageClient(id, name, worker, clientOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
client = await startClient(context, newLanguageClient, { TextDecoder });
|
client = await startClient(context, newLanguageClient, { TextDecoder });
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out"
|
"outDir": "./out",
|
||||||
|
"lib": [
|
||||||
|
"webworker"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -8,13 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient';
|
||||||
import { startClient, LanguageClientConstructor, AsyncDisposable } from '../htmlClient';
|
import { startClient, LanguageClientConstructor, AsyncDisposable } from '../htmlClient';
|
||||||
import { LanguageClient } from 'vscode-languageclient/browser';
|
import { LanguageClient } from 'vscode-languageclient/browser';
|
||||||
|
|
||||||
declare const Worker: {
|
|
||||||
new(stringUrl: string): any;
|
|
||||||
};
|
|
||||||
declare const TextDecoder: {
|
|
||||||
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
|
|
||||||
};
|
|
||||||
|
|
||||||
let client: AsyncDisposable | undefined;
|
let client: AsyncDisposable | undefined;
|
||||||
|
|
||||||
// this method is called when vs code is activated
|
// this method is called when vs code is activated
|
||||||
|
@ -25,7 +18,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
||||||
|
|
||||||
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
||||||
return new LanguageClient(id, name, clientOptions, worker);
|
return new LanguageClient(id, name, worker, clientOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
const timer = {
|
const timer = {
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out"
|
"outDir": "./out",
|
||||||
|
"lib": [
|
||||||
|
"webworker"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -8,12 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient';
|
||||||
import { startClient, LanguageClientConstructor, SchemaRequestService, AsyncDisposable, languageServerDescription } from '../jsonClient';
|
import { startClient, LanguageClientConstructor, SchemaRequestService, AsyncDisposable, languageServerDescription } from '../jsonClient';
|
||||||
import { LanguageClient } from 'vscode-languageclient/browser';
|
import { LanguageClient } from 'vscode-languageclient/browser';
|
||||||
|
|
||||||
declare const Worker: {
|
|
||||||
new(stringUrl: string): any;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare function fetch(uri: string, options: any): any;
|
|
||||||
|
|
||||||
let client: AsyncDisposable | undefined;
|
let client: AsyncDisposable | undefined;
|
||||||
|
|
||||||
// this method is called when vs code is activated
|
// this method is called when vs code is activated
|
||||||
|
@ -24,7 +18,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
|
||||||
|
|
||||||
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
|
||||||
return new LanguageClient(id, name, clientOptions, worker);
|
return new LanguageClient(id, name, worker, clientOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
const schemaRequests: SchemaRequestService = {
|
const schemaRequests: SchemaRequestService = {
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out"
|
"outDir": "./out",
|
||||||
|
"lib": [
|
||||||
|
"webworker"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user