Pinsave/counterstrike
1
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABLITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16declare namespace ts {17 namespace server {18 namespace protocol {19 export import ApplicableRefactorInfo = ts.ApplicableRefactorInfo;20 export import ClassificationType = ts.ClassificationType;21 export import CompletionsTriggerCharacter = ts.CompletionsTriggerCharacter;22 export import CompletionTriggerKind = ts.CompletionTriggerKind;23 export import InlayHintKind = ts.InlayHintKind;24 export import OrganizeImportsMode = ts.OrganizeImportsMode;25 export import RefactorActionInfo = ts.RefactorActionInfo;26 export import RefactorTriggerReason = ts.RefactorTriggerReason;27 export import RenameInfoFailure = ts.RenameInfoFailure;28 export import SemicolonPreference = ts.SemicolonPreference;29 export import SignatureHelpCharacterTypedReason = ts.SignatureHelpCharacterTypedReason;30 export import SignatureHelpInvokedReason = ts.SignatureHelpInvokedReason;31 export import SignatureHelpParameter = ts.SignatureHelpParameter;32 export import SignatureHelpRetriggerCharacter = ts.SignatureHelpRetriggerCharacter;33 export import SignatureHelpRetriggeredReason = ts.SignatureHelpRetriggeredReason;34 export import SignatureHelpTriggerCharacter = ts.SignatureHelpTriggerCharacter;35 export import SignatureHelpTriggerReason = ts.SignatureHelpTriggerReason;36 export import SymbolDisplayPart = ts.SymbolDisplayPart;37 export import UserPreferences = ts.UserPreferences;38 type ChangePropertyTypes<39 T,40 Substitutions extends {41 [K in keyof T]?: any;42 },43 > = {44 [K in keyof T]: K extends keyof Substitutions ? Substitutions[K] : T[K];45 };46 type ChangeStringIndexSignature<T, NewStringIndexSignatureType> = {47 [K in keyof T]: string extends K ? NewStringIndexSignatureType : T[K];48 };49 export enum CommandTypes {50 JsxClosingTag = "jsxClosingTag",51 LinkedEditingRange = "linkedEditingRange",52 Brace = "brace",53 BraceCompletion = "braceCompletion",54 GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",55 Change = "change",56 Close = "close",57 /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */58 Completions = "completions",59 CompletionInfo = "completionInfo",60 CompletionDetails = "completionEntryDetails",61 CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",62 CompileOnSaveEmitFile = "compileOnSaveEmitFile",63 Configure = "configure",64 Definition = "definition",65 DefinitionAndBoundSpan = "definitionAndBoundSpan",66 Implementation = "implementation",67 Exit = "exit",68 FileReferences = "fileReferences",69 Format = "format",70 Formatonkey = "formatonkey",71 Geterr = "geterr",72 GeterrForProject = "geterrForProject",73 SemanticDiagnosticsSync = "semanticDiagnosticsSync",74 SyntacticDiagnosticsSync = "syntacticDiagnosticsSync",75 SuggestionDiagnosticsSync = "suggestionDiagnosticsSync",76 NavBar = "navbar",77 Navto = "navto",78 NavTree = "navtree",79 NavTreeFull = "navtree-full",80 DocumentHighlights = "documentHighlights",81 Open = "open",82 Quickinfo = "quickinfo",83 References = "references",84 Reload = "reload",85 Rename = "rename",86 Saveto = "saveto",87 SignatureHelp = "signatureHelp",88 FindSourceDefinition = "findSourceDefinition",89 Status = "status",90 TypeDefinition = "typeDefinition",91 ProjectInfo = "projectInfo",92 ReloadProjects = "reloadProjects",93 Unknown = "unknown",94 OpenExternalProject = "openExternalProject",95 OpenExternalProjects = "openExternalProjects",96 CloseExternalProject = "closeExternalProject",97 UpdateOpen = "updateOpen",98 GetOutliningSpans = "getOutliningSpans",99 TodoComments = "todoComments",100 Indentation = "indentation",101 DocCommentTemplate = "docCommentTemplate",102 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",103 GetCodeFixes = "getCodeFixes",104 GetCombinedCodeFix = "getCombinedCodeFix",105 ApplyCodeActionCommand = "applyCodeActionCommand",106 GetSupportedCodeFixes = "getSupportedCodeFixes",107 GetApplicableRefactors = "getApplicableRefactors",108 GetEditsForRefactor = "getEditsForRefactor",109 GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions",110 PreparePasteEdits = "preparePasteEdits",111 GetPasteEdits = "getPasteEdits",112 OrganizeImports = "organizeImports",113 GetEditsForFileRename = "getEditsForFileRename",114 ConfigurePlugin = "configurePlugin",115 SelectionRange = "selectionRange",116 ToggleLineComment = "toggleLineComment",117 ToggleMultilineComment = "toggleMultilineComment",118 CommentSelection = "commentSelection",119 UncommentSelection = "uncommentSelection",120 PrepareCallHierarchy = "prepareCallHierarchy",121 ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",122 ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",123 ProvideInlayHints = "provideInlayHints",124 WatchChange = "watchChange",125 MapCode = "mapCode",126 }127 /**128 * A TypeScript Server message129 */130 export interface Message {131 /**132 * Sequence number of the message133 */134 seq: number;135 /**136 * One of "request", "response", or "event"137 */138 type: "request" | "response" | "event";139 }140 /**141 * Client-initiated request message142 */143 export interface Request extends Message {144 type: "request";145 /**146 * The command to execute147 */148 command: string;149 /**150 * Object containing arguments for the command151 */152 arguments?: any;153 }154 /**155 * Request to reload the project structure for all the opened files156 */157 export interface ReloadProjectsRequest extends Request {158 command: CommandTypes.ReloadProjects;159 }160 /**161 * Server-initiated event message162 */163 export interface Event extends Message {164 type: "event";165 /**166 * Name of event167 */168 event: string;169 /**170 * Event-specific information171 */172 body?: any;173 }174 /**175 * Response by server to client request message.176 */177 export interface Response extends Message {178 type: "response";179 /**180 * Sequence number of the request message.181 */182 request_seq: number;183 /**184 * Outcome of the request.185 */186 success: boolean;187 /**188 * The command requested.189 */190 command: string;191 /**192 * If success === false, this should always be provided.193 * Otherwise, may (or may not) contain a success message.194 */195 message?: string;196 /**197 * Contains message body if success === true.198 */199 body?: any;200 /**201 * Contains extra information that plugin can include to be passed on202 */203 metadata?: unknown;204 /**205 * Exposes information about the performance of this request-response pair.206 */207 performanceData?: PerformanceData;208 }209 export interface PerformanceData {210 /**211 * Time spent updating the program graph, in milliseconds.212 */213 updateGraphDurationMs?: number;214 /**215 * The time spent creating or updating the auto-import program, in milliseconds.216 */217 createAutoImportProviderProgramDurationMs?: number;218 /**219 * The time spent computing diagnostics, in milliseconds.220 */221 diagnosticsDuration?: FileDiagnosticPerformanceData[];222 }223 /**224 * Time spent computing each kind of diagnostics, in milliseconds.225 */226 export type DiagnosticPerformanceData = {227 [Kind in DiagnosticEventKind]?: number;228 };229 export interface FileDiagnosticPerformanceData extends DiagnosticPerformanceData {230 /**231 * The file for which the performance data is reported.232 */233 file: string;234 }235 /**236 * Arguments for FileRequest messages.237 */238 export interface FileRequestArgs {239 /**240 * The file for the request (absolute pathname required).241 */242 file: string;243 projectFileName?: string;244 }245 export interface StatusRequest extends Request {246 command: CommandTypes.Status;247 }248 export interface StatusResponseBody {249 /**250 * The TypeScript version (`ts.version`).251 */252 version: string;253 }254 /**255 * Response to StatusRequest256 */257 export interface StatusResponse extends Response {258 body: StatusResponseBody;259 }260 /**261 * Requests a JS Doc comment template for a given position262 */263 export interface DocCommentTemplateRequest extends FileLocationRequest {264 command: CommandTypes.DocCommentTemplate;265 }266 /**267 * Response to DocCommentTemplateRequest268 */269 export interface DocCommandTemplateResponse extends Response {270 body?: TextInsertion;271 }272 /**273 * A request to get TODO comments from the file274 */275 export interface TodoCommentRequest extends FileRequest {276 command: CommandTypes.TodoComments;277 arguments: TodoCommentRequestArgs;278 }279 /**280 * Arguments for TodoCommentRequest request.281 */282 export interface TodoCommentRequestArgs extends FileRequestArgs {283 /**284 * Array of target TodoCommentDescriptors that describes TODO comments to be found285 */286 descriptors: TodoCommentDescriptor[];287 }288 /**289 * Response for TodoCommentRequest request.290 */291 export interface TodoCommentsResponse extends Response {292 body?: TodoComment[];293 }294 /**295 * A request to determine if the caret is inside a comment.296 */297 export interface SpanOfEnclosingCommentRequest extends FileLocationRequest {298 command: CommandTypes.GetSpanOfEnclosingComment;299 arguments: SpanOfEnclosingCommentRequestArgs;300 }301 export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {302 /**303 * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.304 */305 onlyMultiLine: boolean;306 }307 /**308 * Request to obtain outlining spans in file.309 */310 export interface OutliningSpansRequest extends FileRequest {311 command: CommandTypes.GetOutliningSpans;312 }313 export type OutliningSpan = ChangePropertyTypes<ts.OutliningSpan, {314 textSpan: TextSpan;315 hintSpan: TextSpan;316 }>;317 /**318 * Response to OutliningSpansRequest request.319 */320 export interface OutliningSpansResponse extends Response {321 body?: OutliningSpan[];322 }323 /**324 * A request to get indentation for a location in file325 */326 export interface IndentationRequest extends FileLocationRequest {327 command: CommandTypes.Indentation;328 arguments: IndentationRequestArgs;329 }330 /**331 * Response for IndentationRequest request.332 */333 export interface IndentationResponse extends Response {334 body?: IndentationResult;335 }336 /**337 * Indentation result representing where indentation should be placed338 */339 export interface IndentationResult {340 /**341 * The base position in the document that the indent should be relative to342 */343 position: number;344 /**345 * The number of columns the indent should be at relative to the position's column.346 */347 indentation: number;348 }349 /**350 * Arguments for IndentationRequest request.351 */352 export interface IndentationRequestArgs extends FileLocationRequestArgs {353 /**354 * An optional set of settings to be used when computing indentation.355 * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.356 */357 options?: EditorSettings;358 }359 /**360 * Arguments for ProjectInfoRequest request.361 */362 export interface ProjectInfoRequestArgs extends FileRequestArgs {363 /**364 * Indicate if the file name list of the project is needed365 */366 needFileNameList: boolean;367 /**368 * if true returns details about default configured project calculation369 */370 needDefaultConfiguredProjectInfo?: boolean;371 }372 /**373 * A request to get the project information of the current file.374 */375 export interface ProjectInfoRequest extends Request {376 command: CommandTypes.ProjectInfo;377 arguments: ProjectInfoRequestArgs;378 }379 /**380 * A request to retrieve compiler options diagnostics for a project381 */382 export interface CompilerOptionsDiagnosticsRequest extends Request {383 arguments: CompilerOptionsDiagnosticsRequestArgs;384 }385 /**386 * Arguments for CompilerOptionsDiagnosticsRequest request.387 */388 export interface CompilerOptionsDiagnosticsRequestArgs {389 /**390 * Name of the project to retrieve compiler options diagnostics.391 */392 projectFileName: string;393 }394 /**395 * Details about the default project for the file if tsconfig file is found396 */397 export interface DefaultConfiguredProjectInfo {398 /** List of config files looked and did not match because file was not part of root file names */399 notMatchedByConfig?: readonly string[];400 /** List of projects which were loaded but file was not part of the project or is file from referenced project */401 notInProject?: readonly string[];402 /** Configured project used as default */403 defaultProject?: string;404 }405 /**406 * Response message body for "projectInfo" request407 */408 export interface ProjectInfo {409 /**410 * For configured project, this is the normalized path of the 'tsconfig.json' file411 * For inferred project, this is undefined412 */413 configFileName: string;414 /**415 * The list of normalized file name in the project, including 'lib.d.ts'416 */417 fileNames?: string[];418 /**419 * Indicates if the project has a active language service instance420 */421 languageServiceDisabled?: boolean;422 /**423 * Information about default project424 */425 configuredProjectInfo?: DefaultConfiguredProjectInfo;426 }427 /**428 * Represents diagnostic info that includes location of diagnostic in two forms429 * - start position and length of the error span430 * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.431 */432 export interface DiagnosticWithLinePosition {433 message: string;434 start: number;435 length: number;436 startLocation: Location;437 endLocation: Location;438 category: string;439 code: number;440 /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */441 reportsUnnecessary?: {};442 reportsDeprecated?: {};443 relatedInformation?: DiagnosticRelatedInformation[];444 }445 /**446 * Response message for "projectInfo" request447 */448 export interface ProjectInfoResponse extends Response {449 body?: ProjectInfo;450 }451 /**452 * Request whose sole parameter is a file name.453 */454 export interface FileRequest extends Request {455 arguments: FileRequestArgs;456 }457 /**458 * Instances of this interface specify a location in a source file:459 * (file, line, character offset), where line and character offset are 1-based.460 */461 export interface FileLocationRequestArgs extends FileRequestArgs {462 /**463 * The line number for the request (1-based).464 */465 line: number;466 /**467 * The character offset (on the line) for the request (1-based).468 */469 offset: number;470 }471 export type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;472 /**473 * Request refactorings at a given position or selection area.474 */475 export interface GetApplicableRefactorsRequest extends Request {476 command: CommandTypes.GetApplicableRefactors;477 arguments: GetApplicableRefactorsRequestArgs;478 }479 export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {480 triggerReason?: RefactorTriggerReason;481 kind?: string;482 /**483 * Include refactor actions that require additional arguments to be passed when484 * calling 'GetEditsForRefactor'. When true, clients should inspect the485 * `isInteractive` property of each returned `RefactorActionInfo`486 * and ensure they are able to collect the appropriate arguments for any487 * interactive refactor before offering it.488 */489 includeInteractiveActions?: boolean;490 };491 /**492 * Response is a list of available refactorings.493 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring494 */495 export interface GetApplicableRefactorsResponse extends Response {496 body?: ApplicableRefactorInfo[];497 }498 /**499 * Request refactorings at a given position or selection area to move to an existing file.500 */501 export interface GetMoveToRefactoringFileSuggestionsRequest extends Request {502 command: CommandTypes.GetMoveToRefactoringFileSuggestions;503 arguments: GetMoveToRefactoringFileSuggestionsRequestArgs;504 }505 export type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & {506 kind?: string;507 };508 /**509 * Response is a list of available files.510 * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring511 */512 export interface GetMoveToRefactoringFileSuggestions extends Response {513 body: {514 newFileName: string;515 files: string[];516 };517 }518 /**519 * Request to check if `pasteEdits` should be provided for a given location post copying text from that location.520 */521 export interface PreparePasteEditsRequest extends FileRequest {522 command: CommandTypes.PreparePasteEdits;523 arguments: PreparePasteEditsRequestArgs;524 }525 export interface PreparePasteEditsRequestArgs extends FileRequestArgs {526 copiedTextSpan: TextSpan[];527 }528 export interface PreparePasteEditsResponse extends Response {529 body: boolean;530 }531 /**532 * Request refactorings at a given position post pasting text from some other location.533 */534 export interface GetPasteEditsRequest extends Request {535 command: CommandTypes.GetPasteEdits;536 arguments: GetPasteEditsRequestArgs;537 }538 export interface GetPasteEditsRequestArgs extends FileRequestArgs {539 /** The text that gets pasted in a file. */540 pastedText: string[];541 /** Locations of where the `pastedText` gets added in a file. If the length of the `pastedText` and `pastedLocations` are not the same,542 * then the `pastedText` is combined into one and added at all the `pastedLocations`.543 */544 pasteLocations: TextSpan[];545 /** The source location of each `pastedText`. If present, the length of `spans` must be equal to the length of `pastedText`. */546 copiedFrom?: {547 file: string;548 spans: TextSpan[];549 };550 }551 export interface GetPasteEditsResponse extends Response {552 body: PasteEditsAction;553 }554 export interface PasteEditsAction {555 edits: FileCodeEdits[];556 fixId?: {};557 }558 export interface GetEditsForRefactorRequest extends Request {559 command: CommandTypes.GetEditsForRefactor;560 arguments: GetEditsForRefactorRequestArgs;561 }562 /**563 * Request the edits that a particular refactoring action produces.564 * Callers must specify the name of the refactor and the name of the action.565 */566 export type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {567 refactor: string;568 action: string;569 interactiveRefactorArguments?: InteractiveRefactorArguments;570 };571 export interface GetEditsForRefactorResponse extends Response {572 body?: RefactorEditInfo;573 }574 export interface RefactorEditInfo {575 edits: FileCodeEdits[];576 /**577 * An optional location where the editor should start a rename operation once578 * the refactoring edits have been applied579 */580 renameLocation?: Location;581 renameFilename?: string;582 notApplicableReason?: string;583 }584 /**585 * Organize imports by:586 * 1) Removing unused imports587 * 2) Coalescing imports from the same module588 * 3) Sorting imports589 */590 export interface OrganizeImportsRequest extends Request {591 command: CommandTypes.OrganizeImports;592 arguments: OrganizeImportsRequestArgs;593 }594 export type OrganizeImportsScope = GetCombinedCodeFixScope;595 export interface OrganizeImportsRequestArgs {596 scope: OrganizeImportsScope;597 /** @deprecated Use `mode` instead */598 skipDestructiveCodeActions?: boolean;599 mode?: OrganizeImportsMode;600 }601 export interface OrganizeImportsResponse extends Response {602 body: readonly FileCodeEdits[];603 }604 export interface GetEditsForFileRenameRequest extends Request {605 command: CommandTypes.GetEditsForFileRename;606 arguments: GetEditsForFileRenameRequestArgs;607 }608 /** Note: Paths may also be directories. */609 export interface GetEditsForFileRenameRequestArgs {610 readonly oldFilePath: string;611 readonly newFilePath: string;612 }613 export interface GetEditsForFileRenameResponse extends Response {614 body: readonly FileCodeEdits[];615 }616 /**617 * Request for the available codefixes at a specific position.618 */619 export interface CodeFixRequest extends Request {620 command: CommandTypes.GetCodeFixes;621 arguments: CodeFixRequestArgs;622 }623 export interface GetCombinedCodeFixRequest extends Request {624 command: CommandTypes.GetCombinedCodeFix;625 arguments: GetCombinedCodeFixRequestArgs;626 }627 export interface GetCombinedCodeFixResponse extends Response {628 body: CombinedCodeActions;629 }630 export interface ApplyCodeActionCommandRequest extends Request {631 command: CommandTypes.ApplyCodeActionCommand;632 arguments: ApplyCodeActionCommandRequestArgs;633 }634 export interface ApplyCodeActionCommandResponse extends Response {635 }636 export interface FileRangeRequestArgs extends FileRequestArgs, FileRange {637 }638 /**639 * Instances of this interface specify errorcodes on a specific location in a sourcefile.640 */641 export interface CodeFixRequestArgs extends FileRangeRequestArgs {642 /**643 * Errorcodes we want to get the fixes for.644 */645 errorCodes: readonly number[];646 }647 export interface GetCombinedCodeFixRequestArgs {648 scope: GetCombinedCodeFixScope;649 fixId: {};650 }651 export interface GetCombinedCodeFixScope {652 type: "file";653 args: FileRequestArgs;654 }655 export interface ApplyCodeActionCommandRequestArgs {656 /** May also be an array of commands. */657 command: {};658 }659 /**660 * Response for GetCodeFixes request.661 */662 export interface GetCodeFixesResponse extends Response {663 body?: CodeAction[];664 }665 /**666 * A request whose arguments specify a file location (file, line, col).667 */668 export interface FileLocationRequest extends FileRequest {669 arguments: FileLocationRequestArgs;670 }671 /**672 * A request to get codes of supported code fixes.673 */674 export interface GetSupportedCodeFixesRequest extends Request {675 command: CommandTypes.GetSupportedCodeFixes;676 arguments?: Partial<FileRequestArgs>;677 }678 /**679 * A response for GetSupportedCodeFixesRequest request.680 */681 export interface GetSupportedCodeFixesResponse extends Response {682 /**683 * List of error codes supported by the server.684 */685 body?: string[];686 }687 /**688 * A request to get encoded semantic classifications for a span in the file689 */690 export interface EncodedSemanticClassificationsRequest extends FileRequest {691 arguments: EncodedSemanticClassificationsRequestArgs;692 }693 /**694 * Arguments for EncodedSemanticClassificationsRequest request.695 */696 export interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {697 /**698 * Start position of the span.699 */700 start: number;701 /**702 * Length of the span.703 */704 length: number;705 /**706 * Optional parameter for the semantic highlighting response, if absent it707 * defaults to "original".708 */709 format?: "original" | "2020";710 }711 /** The response for a EncodedSemanticClassificationsRequest */712 export interface EncodedSemanticClassificationsResponse extends Response {713 body?: EncodedSemanticClassificationsResponseBody;714 }715 /**716 * Implementation response message. Gives series of text spans depending on the format ar.717 */718 export interface EncodedSemanticClassificationsResponseBody {719 endOfLineState: EndOfLineState;720 spans: number[];721 }722 /**723 * Arguments in document highlight request; include: filesToSearch, file,724 * line, offset.725 */726 export interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {727 /**728 * List of files to search for document highlights.729 */730 filesToSearch: string[];731 }732 /**733 * Go to definition request; value of command field is734 * "definition". Return response giving the file locations that735 * define the symbol found in file at location line, col.736 */737 export interface DefinitionRequest extends FileLocationRequest {738 command: CommandTypes.Definition;739 }740 export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {741 readonly command: CommandTypes.DefinitionAndBoundSpan;742 }743 export interface FindSourceDefinitionRequest extends FileLocationRequest {744 readonly command: CommandTypes.FindSourceDefinition;745 }746 export interface DefinitionAndBoundSpanResponse extends Response {747 readonly body: DefinitionInfoAndBoundSpan;748 }749 /**750 * Go to type request; value of command field is751 * "typeDefinition". Return response giving the file locations that752 * define the type for the symbol found in file at location line, col.753 */754 export interface TypeDefinitionRequest extends FileLocationRequest {755 command: CommandTypes.TypeDefinition;756 }757 /**758 * Go to implementation request; value of command field is759 * "implementation". Return response giving the file locations that760 * implement the symbol found in file at location line, col.761 */762 export interface ImplementationRequest extends FileLocationRequest {763 command: CommandTypes.Implementation;764 }765 /**766 * Location in source code expressed as (one-based) line and (one-based) column offset.767 */768 export interface Location {769 line: number;770 offset: number;771 }772 /**773 * Object found in response messages defining a span of text in source code.774 */775 export interface TextSpan {776 /**777 * First character of the definition.778 */779 start: Location;780 /**781 * One character past last character of the definition.782 */783 end: Location;784 }785 /**786 * Object found in response messages defining a span of text in a specific source file.787 */788 export interface FileSpan extends TextSpan {789 /**790 * File containing text span.791 */792 file: string;793 }794 export interface JSDocTagInfo {795 /** Name of the JSDoc tag */796 name: string;797 /**798 * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment799 * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise.800 */801 text?: string | SymbolDisplayPart[];802 }803 export interface TextSpanWithContext extends TextSpan {804 contextStart?: Location;805 contextEnd?: Location;806 }807 export interface FileSpanWithContext extends FileSpan, TextSpanWithContext {808 }809 export interface DefinitionInfo extends FileSpanWithContext {810 /**811 * When true, the file may or may not exist.812 */813 unverified?: boolean;814 }815 export interface DefinitionInfoAndBoundSpan {816 definitions: readonly DefinitionInfo[];817 textSpan: TextSpan;818 }819 /**820 * Definition response message. Gives text range for definition.821 */822 export interface DefinitionResponse extends Response {823 body?: DefinitionInfo[];824 }825 export interface DefinitionInfoAndBoundSpanResponse extends Response {826 body?: DefinitionInfoAndBoundSpan;827 }828 /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */829 export type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;830 /**831 * Definition response message. Gives text range for definition.832 */833 export interface TypeDefinitionResponse extends Response {834 body?: FileSpanWithContext[];835 }836 /**837 * Implementation response message. Gives text range for implementations.838 */839 export interface ImplementationResponse extends Response {840 body?: FileSpanWithContext[];841 }842 /**843 * Request to get brace completion for a location in the file.844 */845 export interface BraceCompletionRequest extends FileLocationRequest {846 command: CommandTypes.BraceCompletion;847 arguments: BraceCompletionRequestArgs;848 }849 /**850 * Argument for BraceCompletionRequest request.851 */852 export interface BraceCompletionRequestArgs extends FileLocationRequestArgs {853 /**854 * Kind of opening brace855 */856 openingBrace: string;857 }858 export interface JsxClosingTagRequest extends FileLocationRequest {859 readonly command: CommandTypes.JsxClosingTag;860 readonly arguments: JsxClosingTagRequestArgs;861 }862 export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {863 }864 export interface JsxClosingTagResponse extends Response {865 readonly body: TextInsertion;866 }867 export interface LinkedEditingRangeRequest extends FileLocationRequest {868 readonly command: CommandTypes.LinkedEditingRange;869 }870 export interface LinkedEditingRangesBody {871 ranges: TextSpan[];872 wordPattern?: string;873 }874 export interface LinkedEditingRangeResponse extends Response {875 readonly body: LinkedEditingRangesBody;876 }877 /**878 * Get document highlights request; value of command field is879 * "documentHighlights". Return response giving spans that are relevant880 * in the file at a given line and column.881 */882 export interface DocumentHighlightsRequest extends FileLocationRequest {883 command: CommandTypes.DocumentHighlights;884 arguments: DocumentHighlightsRequestArgs;885 }886 /**887 * Span augmented with extra information that denotes the kind of the highlighting to be used for span.888 */889 export interface HighlightSpan extends TextSpanWithContext {890 kind: HighlightSpanKind;891 }892 /**893 * Represents a set of highligh spans for a give name894 */895 export interface DocumentHighlightsItem {896 /**897 * File containing highlight spans.898 */899 file: string;900 /**901 * Spans to highlight in file.902 */903 highlightSpans: HighlightSpan[];904 }905 /**906 * Response for a DocumentHighlightsRequest request.907 */908 export interface DocumentHighlightsResponse extends Response {909 body?: DocumentHighlightsItem[];910 }911 /**912 * Find references request; value of command field is913 * "references". Return response giving the file locations that914 * reference the symbol found in file at location line, col.915 */916 export interface ReferencesRequest extends FileLocationRequest {917 command: CommandTypes.References;918 }919 export interface ReferencesResponseItem extends FileSpanWithContext {920 /**921 * Text of line containing the reference. Including this922 * with the response avoids latency of editor loading files923 * to show text of reference line (the server already has loaded the referencing files).924 *925 * If {@link UserPreferences.disableLineTextInReferences} is enabled, the property won't be filled926 */927 lineText?: string;928 /**929 * True if reference is a write location, false otherwise.930 */931 isWriteAccess: boolean;932 /**933 * Present only if the search was triggered from a declaration.934 * True indicates that the references refers to the same symbol935 * (i.e. has the same meaning) as the declaration that began the936 * search.937 */938 isDefinition?: boolean;939 }940 /**941 * The body of a "references" response message.942 */943 export interface ReferencesResponseBody {944 /**945 * The file locations referencing the symbol.946 */947 refs: readonly ReferencesResponseItem[];948 /**949 * The name of the symbol.950 */951 symbolName: string;952 /**953 * The start character offset of the symbol (on the line provided by the references request).954 */955 symbolStartOffset: number;956 /**957 * The full display name of the symbol.958 */959 symbolDisplayString: string;960 }961 /**962 * Response to "references" request.963 */964 export interface ReferencesResponse extends Response {965 body?: ReferencesResponseBody;966 }967 export interface FileReferencesRequest extends FileRequest {968 command: CommandTypes.FileReferences;969 }970 export interface FileReferencesResponseBody {971 /**972 * The file locations referencing the symbol.973 */974 refs: readonly ReferencesResponseItem[];975 /**976 * The name of the symbol.977 */978 symbolName: string;979 }980 export interface FileReferencesResponse extends Response {981 body?: FileReferencesResponseBody;982 }983 /**984 * Argument for RenameRequest request.985 */986 export interface RenameRequestArgs extends FileLocationRequestArgs {987 /**988 * Should text at specified location be found/changed in comments?989 */990 findInComments?: boolean;991 /**992 * Should text at specified location be found/changed in strings?993 */994 findInStrings?: boolean;995 }996 /**997 * Rename request; value of command field is "rename". Return998 * response giving the file locations that reference the symbol999 * found in file at location line, col. Also return full display1000 * name of the symbol so that client can print it unambiguously.1001 */1002 export interface RenameRequest extends FileLocationRequest {1003 command: CommandTypes.Rename;1004 arguments: RenameRequestArgs;1005 }1006 /**1007 * Information about the item to be renamed.1008 */1009 export type RenameInfo = RenameInfoSuccess | RenameInfoFailure;1010 export type RenameInfoSuccess = ChangePropertyTypes<ts.RenameInfoSuccess, {1011 triggerSpan: TextSpan;1012 }>;1013 /**1014 * A group of text spans, all in 'file'.1015 */1016 export interface SpanGroup {1017 /** The file to which the spans apply */1018 file: string;1019 /** The text spans in this group */1020 locs: RenameTextSpan[];1021 }1022 export interface RenameTextSpan extends TextSpanWithContext {1023 readonly prefixText?: string;1024 readonly suffixText?: string;1025 }1026 export interface RenameResponseBody {1027 /**1028 * Information about the item to be renamed.1029 */1030 info: RenameInfo;1031 /**1032 * An array of span groups (one per file) that refer to the item to be renamed.1033 */1034 locs: readonly SpanGroup[];1035 }1036 /**1037 * Rename response message.1038 */1039 export interface RenameResponse extends Response {1040 body?: RenameResponseBody;1041 }1042 /**1043 * Represents a file in external project.1044 * External project is project whose set of files, compilation options and open\close state1045 * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).1046 * External project will exist even if all files in it are closed and should be closed explicitly.1047 * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will1048 * create configured project for every config file but will maintain a link that these projects were created1049 * as a result of opening external project so they should be removed once external project is closed.1050 */1051 export interface ExternalFile {1052 /**1053 * Name of file file1054 */1055 fileName: string;1056 /**1057 * Script kind of the file1058 */1059 scriptKind?: ScriptKindName | ScriptKind;1060 /**1061 * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript)1062 */1063 hasMixedContent?: boolean;1064 /**1065 * Content of the file1066 */1067 content?: string;1068 }1069 /**1070 * Represent an external project1071 */1072 export interface ExternalProject {1073 /**1074 * Project name1075 */1076 projectFileName: string;1077 /**1078 * List of root files in project1079 */1080 rootFiles: ExternalFile[];1081 /**1082 * Compiler options for the project1083 */1084 options: ExternalProjectCompilerOptions;1085 /**1086 * Explicitly specified type acquisition for the project1087 */1088 typeAcquisition?: TypeAcquisition;1089 }1090 export interface CompileOnSaveMixin {1091 /**1092 * If compile on save is enabled for the project1093 */1094 compileOnSave?: boolean;1095 }1096 /**1097 * For external projects, some of the project settings are sent together with1098 * compiler settings.1099 */1100 export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;1101 export interface FileWithProjectReferenceRedirectInfo {1102 /**1103 * Name of file1104 */1105 fileName: string;1106 /**1107 * True if the file is primarily included in a referenced project1108 */1109 isSourceOfProjectReferenceRedirect: boolean;1110 }1111 /**1112 * Represents a set of changes that happen in project1113 */1114 export interface ProjectChanges {1115 /**1116 * List of added files1117 */1118 added: string[] | FileWithProjectReferenceRedirectInfo[];1119 /**1120 * List of removed files1121 */1122 removed: string[] | FileWithProjectReferenceRedirectInfo[];1123 /**1124 * List of updated files1125 */1126 updated: string[] | FileWithProjectReferenceRedirectInfo[];1127 /**1128 * List of files that have had their project reference redirect status updated1129 * Only provided when the synchronizeProjectList request has includeProjectReferenceRedirectInfo set to true1130 */1131 updatedRedirects?: FileWithProjectReferenceRedirectInfo[];1132 }1133 /**1134 * Information found in a configure request.1135 */1136 export interface ConfigureRequestArguments {1137 /**1138 * Information about the host, for example 'Emacs 24.4' or1139 * 'Sublime Text version 3075'1140 */1141 hostInfo?: string;1142 /**1143 * If present, tab settings apply only to this file.1144 */1145 file?: string;1146 /**1147 * The format options to use during formatting and other code editing features.1148 */1149 formatOptions?: FormatCodeSettings;1150 preferences?: UserPreferences;1151 /**1152 * The host's additional supported .js file extensions1153 */1154 extraFileExtensions?: FileExtensionInfo[];1155 watchOptions?: WatchOptions;1156 }1157 export enum WatchFileKind {1158 FixedPollingInterval = "FixedPollingInterval",1159 PriorityPollingInterval = "PriorityPollingInterval",1160 DynamicPriorityPolling = "DynamicPriorityPolling",1161 FixedChunkSizePolling = "FixedChunkSizePolling",1162 UseFsEvents = "UseFsEvents",1163 UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory",1164 }1165 export enum WatchDirectoryKind {1166 UseFsEvents = "UseFsEvents",1167 FixedPollingInterval = "FixedPollingInterval",1168 DynamicPriorityPolling = "DynamicPriorityPolling",1169 FixedChunkSizePolling = "FixedChunkSizePolling",1170 }1171 export enum PollingWatchKind {1172 FixedInterval = "FixedInterval",1173 PriorityInterval = "PriorityInterval",1174 DynamicPriority = "DynamicPriority",1175 FixedChunkSize = "FixedChunkSize",1176 }1177 export interface WatchOptions {1178 watchFile?: WatchFileKind | ts.WatchFileKind;1179 watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;1180 fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;1181 synchronousWatchDirectory?: boolean;1182 excludeDirectories?: string[];1183 excludeFiles?: string[];1184 [option: string]: CompilerOptionsValue | undefined;1185 }1186 /**1187 * Configure request; value of command field is "configure". Specifies1188 * host information, such as host type, tab size, and indent size.1189 */1190 export interface ConfigureRequest extends Request {1191 command: CommandTypes.Configure;1192 arguments: ConfigureRequestArguments;1193 }1194 /**1195 * Response to "configure" request. This is just an acknowledgement, so1196 * no body field is required.1197 */1198 export interface ConfigureResponse extends Response {1199 }1200 export interface ConfigurePluginRequestArguments {