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 {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ts {
|
|
|
|
export = _ts;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Object {
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
__proto__: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DenoCore {
|
|
|
|
// deno-lint-ignore no-explicit-any
|
2021-04-12 15:55:05 -04:00
|
|
|
opSync<T>(name: string, params: T): any;
|
2020-12-07 05:46:39 -05:00
|
|
|
ops(): void;
|
2021-05-02 19:30:03 -04:00
|
|
|
print(msg: string, stderr: bool): void;
|
2021-02-25 14:06:06 -05:00
|
|
|
registerErrorClass(
|
|
|
|
name: string,
|
|
|
|
Ctor: typeof Error,
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
...args: any[]
|
|
|
|
): void;
|
2020-12-07 05:46:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type LanguageServerRequest =
|
|
|
|
| ConfigureRequest
|
2021-01-31 22:30:41 -05:00
|
|
|
| FindRenameLocationsRequest
|
2020-12-15 14:34:39 -05:00
|
|
|
| GetAsset
|
2021-08-05 21:46:32 -04:00
|
|
|
| GetApplicableRefactors
|
|
|
|
| GetEditsForRefactor
|
2021-02-04 13:53:02 -05:00
|
|
|
| GetCodeFixes
|
|
|
|
| GetCombinedCodeFix
|
2021-03-15 18:01:41 -04:00
|
|
|
| GetCompletionDetails
|
2021-01-31 22:30:41 -05:00
|
|
|
| GetCompletionsRequest
|
|
|
|
| GetDefinitionRequest
|
2020-12-29 20:46:58 -05:00
|
|
|
| GetDiagnosticsRequest
|
2020-12-07 05:46:39 -05:00
|
|
|
| GetDocumentHighlightsRequest
|
2021-04-19 21:26:36 -04:00
|
|
|
| GetEncodedSemanticClassifications
|
2021-01-12 16:53:27 -05:00
|
|
|
| GetImplementationRequest
|
2021-01-31 22:30:41 -05:00
|
|
|
| GetNavigationTree
|
2021-04-02 02:21:07 -04:00
|
|
|
| GetOutliningSpans
|
2021-01-31 22:30:41 -05:00
|
|
|
| GetQuickInfoRequest
|
2021-02-04 13:53:02 -05:00
|
|
|
| GetReferencesRequest
|
2021-02-15 21:34:09 -05:00
|
|
|
| GetSignatureHelpItemsRequest
|
2021-03-23 19:33:25 -04:00
|
|
|
| GetSmartSelectionRange
|
2021-04-19 01:11:26 -04:00
|
|
|
| GetSupportedCodeFixes
|
|
|
|
| PrepareCallHierarchy
|
|
|
|
| ProvideCallHierarchyIncomingCalls
|
|
|
|
| ProvideCallHierarchyOutgoingCalls;
|
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>;
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface FindRenameLocationsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "findRenameLocations";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
findInStrings: boolean;
|
|
|
|
findInComments: boolean;
|
|
|
|
providePrefixAndSuffixTextForRename: boolean;
|
|
|
|
}
|
|
|
|
|
2020-12-15 14:34:39 -05:00
|
|
|
interface GetAsset extends BaseLanguageServerRequest {
|
|
|
|
method: "getAsset";
|
|
|
|
specifier: string;
|
|
|
|
}
|
|
|
|
|
2021-08-05 21:46:32 -04:00
|
|
|
interface GetApplicableRefactors extends BaseLanguageServerRequest {
|
|
|
|
method: "getApplicableRefactors";
|
|
|
|
specifier: string;
|
|
|
|
range: ts.TextRange;
|
|
|
|
kind: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetEditsForRefactor extends BaseLanguageServerRequest {
|
|
|
|
method: "getEditsForRefactor";
|
|
|
|
specifier: string;
|
|
|
|
range: ts.TextRange;
|
|
|
|
refactorName: string;
|
|
|
|
actionName: string;
|
|
|
|
}
|
|
|
|
|
2021-02-04 13:53:02 -05:00
|
|
|
interface GetCodeFixes extends BaseLanguageServerRequest {
|
|
|
|
method: "getCodeFixes";
|
|
|
|
specifier: string;
|
|
|
|
startPosition: number;
|
|
|
|
endPosition: number;
|
|
|
|
errorCodes: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetCombinedCodeFix extends BaseLanguageServerRequest {
|
|
|
|
method: "getCombinedCodeFix";
|
|
|
|
specifier: string;
|
|
|
|
// deno-lint-ignore ban-types
|
|
|
|
fixId: {};
|
|
|
|
}
|
|
|
|
|
2021-03-15 18:01:41 -04:00
|
|
|
interface GetCompletionDetails extends BaseLanguageServerRequest {
|
|
|
|
method: "getCompletionDetails";
|
|
|
|
args: {
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
name: string;
|
|
|
|
source?: string;
|
|
|
|
data?: unknown;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetCompletionsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getCompletions";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
2021-03-15 18:01:41 -04:00
|
|
|
preferences: ts.GetCompletionsAtPositionOptions;
|
2021-01-31 22:30:41 -05:00
|
|
|
}
|
|
|
|
|
2020-12-29 20:46:58 -05:00
|
|
|
interface GetDiagnosticsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDiagnostics";
|
2021-01-22 05:03:16 -05:00
|
|
|
specifiers: string[];
|
2020-12-07 05:46:39 -05:00
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetDefinitionRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDefinition";
|
2020-12-07 05:46:39 -05:00
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface GetDocumentHighlightsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getDocumentHighlights";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
filesToSearch: string[];
|
|
|
|
}
|
|
|
|
|
2021-04-19 21:26:36 -04:00
|
|
|
interface GetEncodedSemanticClassifications
|
|
|
|
extends BaseLanguageServerRequest {
|
|
|
|
method: "getEncodedSemanticClassifications";
|
|
|
|
specifier: string;
|
|
|
|
span: ts.TextSpan;
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetImplementationRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getImplementation";
|
2020-12-07 05:46:39 -05:00
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetNavigationTree extends BaseLanguageServerRequest {
|
|
|
|
method: "getNavigationTree";
|
2020-12-07 05:46:39 -05:00
|
|
|
specifier: string;
|
|
|
|
}
|
2020-12-08 05:36:13 -05:00
|
|
|
|
2021-04-02 02:21:07 -04:00
|
|
|
interface GetOutliningSpans extends BaseLanguageServerRequest {
|
|
|
|
method: "getOutliningSpans";
|
|
|
|
specifier: string;
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetQuickInfoRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getQuickInfo";
|
2021-01-12 16:53:27 -05:00
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
2021-01-31 22:30:41 -05:00
|
|
|
interface GetReferencesRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getReferences";
|
2020-12-29 19:58:20 -05:00
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
2021-02-04 13:53:02 -05:00
|
|
|
|
2021-02-15 21:34:09 -05:00
|
|
|
interface GetSignatureHelpItemsRequest extends BaseLanguageServerRequest {
|
|
|
|
method: "getSignatureHelpItems";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
options: ts.SignatureHelpItemsOptions;
|
|
|
|
}
|
|
|
|
|
2021-03-23 19:33:25 -04:00
|
|
|
interface GetSmartSelectionRange extends BaseLanguageServerRequest {
|
|
|
|
method: "getSmartSelectionRange";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
2021-02-04 13:53:02 -05:00
|
|
|
interface GetSupportedCodeFixes extends BaseLanguageServerRequest {
|
|
|
|
method: "getSupportedCodeFixes";
|
|
|
|
}
|
2021-04-19 01:11:26 -04:00
|
|
|
|
|
|
|
interface PrepareCallHierarchy extends BaseLanguageServerRequest {
|
|
|
|
method: "prepareCallHierarchy";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ProvideCallHierarchyIncomingCalls
|
|
|
|
extends BaseLanguageServerRequest {
|
|
|
|
method: "provideCallHierarchyIncomingCalls";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ProvideCallHierarchyOutgoingCalls
|
|
|
|
extends BaseLanguageServerRequest {
|
|
|
|
method: "provideCallHierarchyOutgoingCalls";
|
|
|
|
specifier: string;
|
|
|
|
position: number;
|
|
|
|
}
|
2020-12-07 05:46:39 -05:00
|
|
|
}
|