2021-01-11 12:13:41 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-12-07 05:46:39 -05:00
|
|
|
|
|
|
|
// Contains types that can be used to validate and check `99_main_compiler.js`
|
|
|
|
|
|
|
|
import * as _ts from "../dts/typescript";
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
// deno-lint-ignore no-namespace
|
|
|
|
namespace ts {
|
|
|
|
var libs: string[];
|
|
|
|
var libMap: Map<string, string>;
|
|
|
|
|
|
|
|
interface SourceFile {
|
|
|
|
version?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Performance {
|
|
|
|
enable(): void;
|
|
|
|
getDuration(value: string): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
var performance: Performance;
|
|
|
|
}
|
|
|
|
|
|
|
|
// deno-lint-ignore no-namespace
|
|
|
|
namespace ts {
|
|
|
|
export = _ts;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Object {
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
__proto__: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DenoCore {
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
jsonOpSync<T>(name: string, params: T): any;
|
|
|
|
ops(): void;
|
2020-12-29 20:46:58 -05:00
|
|
|
print(msg: string, code?: number): void;
|
2020-12-07 05:46:39 -05:00
|
|
|
registerErrorClass(name: string, Ctor: typeof Error): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
type LanguageServerRequest =
|
|
|
|
| ConfigureRequest
|
2020-12-15 14:34:39 -05:00
|
|
|
| GetAsset
|
2020-12-29 20:46:58 -05:00
|
|
|
| GetDiagnosticsRequest
|
2020-12-07 05:46:39 -05:00
|
|
|
| GetQuickInfoRequest
|
|
|
|
| GetDocumentHighlightsRequest
|
|
|
|
| GetReferencesRequest
|
2020-12-08 05:36:13 -05:00
|
|
|
| GetDefinitionRequest
|
2020-12-29 19:58:20 -05:00
|
|
|
| GetCompletionsRequest
|
2021-01-12 16:53:27 -05:00
|
|
|
| GetImplementationRequest
|
2020-12-29 19:58:20 -05:00
|
|
|
| FindRenameLocationsRequest;
|
2020-12-07 05:46:39 -05:00
|
|
|
|
|
|
|
interface BaseLanguageServerRequest {
|
|
|
|
id: number;
|
|
|
|
method: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ConfigureRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "configure";
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
compilerOptions: Record<string, any>;
|
|
|
|
}
|
|
|
|
|
2020-12-15 14:34:39 -05:00
|
|
|
interface GetAsset extends BaseLanguageServerRequest {
|
|
|
|
method: "getAsset";
|
|
|
|
specifier: string;
|
|
|
|
}
|
|
|
|
|
2020-12-29 20:46:58 -05:00
|
|
|
interface GetDiagnosticsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDiagnostics";
|
2020-12-07 05:46:39 -05:00
|
|
|
specifier: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetQuickInfoRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getQuickInfo";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetDocumentHighlightsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDocumentHighlights";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
filesToSearch: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetReferencesRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getReferences";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetDefinitionRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDefinition";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
2020-12-08 05:36:13 -05:00
|
|
|
|
|
|
|
interface GetCompletionsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getCompletions";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
preferences: ts.UserPreferences;
|
|
|
|
}
|
2020-12-29 19:58:20 -05:00
|
|
|
|
2021-01-12 16:53:27 -05:00
|
|
|
interface GetImplementationRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getImplementation";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
2020-12-29 19:58:20 -05:00
|
|
|
interface FindRenameLocationsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "findRenameLocations";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
findInStrings: boolean;
|
|
|
|
findInComments: boolean;
|
|
|
|
providePrefixAndSuffixTextForRename: boolean;
|
|
|
|
}
|
2020-12-07 05:46:39 -05:00
|
|
|
}
|