diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-12-07 21:46:39 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 21:46:39 +1100 |
commit | 301d3e4b6849d24154ac2d65c00a9b30223d000e (patch) | |
tree | ab3bc074493e6c9be8d1875233bc141bdc0da3b4 /cli/tsc/compiler.d.ts | |
parent | c8e9b2654ec0d54c77bb3f49fa31c3986203d517 (diff) |
feat: add mvp language server (#8515)
Resolves #8400
Diffstat (limited to 'cli/tsc/compiler.d.ts')
-rw-r--r-- | cli/tsc/compiler.d.ts | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts new file mode 100644 index 000000000..1a899c291 --- /dev/null +++ b/cli/tsc/compiler.d.ts @@ -0,0 +1,103 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. + +// 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; + print(msg: string): void; + registerErrorClass(name: string, Ctor: typeof Error): void; + } + + type LanguageServerRequest = + | ConfigureRequest + | GetSyntacticDiagnosticsRequest + | GetSemanticDiagnosticsRequest + | GetSuggestionDiagnosticsRequest + | GetQuickInfoRequest + | GetDocumentHighlightsRequest + | GetReferencesRequest + | GetDefinitionRequest; + + interface BaseLanguageServerRequest { + id: number; + method: string; + } + + interface ConfigureRequest extends BaseLanguageServerRequest { + method: "configure"; + // deno-lint-ignore no-explicit-any + compilerOptions: Record<string, any>; + } + + interface GetSyntacticDiagnosticsRequest extends BaseLanguageServerRequest { + method: "getSyntacticDiagnostics"; + specifier: string; + } + + interface GetSemanticDiagnosticsRequest extends BaseLanguageServerRequest { + method: "getSemanticDiagnostics"; + specifier: string; + } + + interface GetSuggestionDiagnosticsRequest extends BaseLanguageServerRequest { + method: "getSuggestionDiagnostics"; + 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; + } +} |