From 23b60dc1975db38c280d8a123aff97544d1673e0 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:34:21 +0800 Subject: [PATCH] TODO#139890 FAQ 常見問題 1-文案調整 --- PAMapp/node_modules/typescript/lib/protocol.d.ts | 144 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 128 insertions(+), 16 deletions(-) diff --git a/PAMapp/node_modules/typescript/lib/protocol.d.ts b/PAMapp/node_modules/typescript/lib/protocol.d.ts index 3f84ea9..be78227 100644 --- a/PAMapp/node_modules/typescript/lib/protocol.d.ts +++ b/PAMapp/node_modules/typescript/lib/protocol.d.ts @@ -72,7 +72,8 @@ UncommentSelection = "uncommentSelection", PrepareCallHierarchy = "prepareCallHierarchy", ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls", - ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls" + ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls", + ProvideInlayHints = "provideInlayHints" } /** * A TypeScript Server message @@ -501,6 +502,7 @@ type OrganizeImportsScope = GetCombinedCodeFixScope; interface OrganizeImportsRequestArgs { scope: OrganizeImportsScope; + skipDestructiveCodeActions?: boolean; } interface OrganizeImportsResponse extends Response { body: readonly FileCodeEdits[]; @@ -707,21 +709,36 @@ */ file: string; } + interface JSDocTagInfo { + /** Name of the JSDoc tag */ + name: string; + /** + * Comment text after the JSDoc tag -- the text after the tag name until the next tag or end of comment + * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise. + */ + text?: string | SymbolDisplayPart[]; + } interface TextSpanWithContext extends TextSpan { contextStart?: Location; contextEnd?: Location; } interface FileSpanWithContext extends FileSpan, TextSpanWithContext { } + interface DefinitionInfo extends FileSpanWithContext { + /** + * When true, the file may or may not exist. + */ + unverified?: boolean; + } interface DefinitionInfoAndBoundSpan { - definitions: readonly FileSpanWithContext[]; + definitions: readonly DefinitionInfo[]; textSpan: TextSpan; } /** * Definition response message. Gives text range for definition. */ interface DefinitionResponse extends Response { - body?: FileSpanWithContext[]; + body?: DefinitionInfo[]; } interface DefinitionInfoAndBoundSpanResponse extends Response { body?: DefinitionInfoAndBoundSpan; @@ -1105,18 +1122,21 @@ FixedPollingInterval = "FixedPollingInterval", PriorityPollingInterval = "PriorityPollingInterval", DynamicPriorityPolling = "DynamicPriorityPolling", + FixedChunkSizePolling = "FixedChunkSizePolling", UseFsEvents = "UseFsEvents", UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory" } const enum WatchDirectoryKind { UseFsEvents = "UseFsEvents", FixedPollingInterval = "FixedPollingInterval", - DynamicPriorityPolling = "DynamicPriorityPolling" + DynamicPriorityPolling = "DynamicPriorityPolling", + FixedChunkSizePolling = "FixedChunkSizePolling" } const enum PollingWatchKind { FixedInterval = "FixedInterval", PriorityInterval = "PriorityInterval", - DynamicPriority = "DynamicPriority" + DynamicPriority = "DynamicPriority", + FixedChunkSize = "FixedChunkSize" } interface WatchOptions { watchFile?: WatchFileKind | ts.WatchFileKind; @@ -1418,6 +1438,7 @@ */ interface QuickInfoRequest extends FileLocationRequest { command: CommandTypes.Quickinfo; + arguments: FileLocationRequestArgs; } /** * Body of QuickInfoResponse. @@ -1445,8 +1466,9 @@ displayString: string; /** * Documentation associated with symbol. + * Display parts when UserPreferences.displayPartsForJSDoc is true, flattened to string otherwise. */ - documentation: string; + documentation: string | SymbolDisplayPart[]; /** * JSDoc tags associated with symbol. */ @@ -1567,7 +1589,15 @@ command: CommandTypes.Formatonkey; arguments: FormatOnKeyRequestArgs; } - type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#"; + type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " "; + const enum CompletionTriggerKind { + /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */ + Invoked = 1, + /** Completion was triggered by a trigger character. */ + TriggerCharacter = 2, + /** Completion was re-triggered as the current completion list is incomplete. */ + TriggerForIncompleteCompletions = 3 + } /** * Arguments for completions messages. */ @@ -1581,6 +1611,7 @@ * Should be `undefined` if a user manually requested completion. */ triggerCharacter?: CompletionsTriggerCharacter; + triggerKind?: CompletionTriggerKind; /** * @deprecated Use UserPreferences.includeCompletionsForModuleExports */ @@ -1612,6 +1643,7 @@ interface CompletionEntryIdentifier { name: string; source?: string; + data?: unknown; } /** * Completion entry details request; value of command field is @@ -1635,6 +1667,11 @@ * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). */ kind: string; + } + /** A part of a symbol description that links from a jsdoc @link tag to a declaration */ + interface JSDocLinkDisplayPart extends SymbolDisplayPart { + /** The location of the declaration that the @link tag links to. */ + target: FileSpan; } /** * An item found in a completion response. @@ -1664,6 +1701,10 @@ */ insertText?: string; /** + * `insertText` should be interpreted as a snippet if true. + */ + isSnippet?: true; + /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. * It will be set if the required span differs from the one generated by the default replacement behavior. @@ -1679,6 +1720,10 @@ */ source?: string; /** + * Human-readable description of the `source`. + */ + sourceDisplay?: SymbolDisplayPart[]; + /** * If true, this completion should be highlighted as recommended. There will only be one of these. * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class. * Then either that enum/class or a namespace containing it will be the recommended symbol. @@ -1691,9 +1736,20 @@ isFromUncheckedFile?: true; /** * If true, this completion was for an auto-import of a module not yet in the program, but listed - * in the project package.json. + * in the project package.json. Used for telemetry reporting. */ isPackageJsonImport?: true; + /** + * If true, this completion was an auto-import-style completion of an import statement (i.e., the + * module specifier was inserted along with the imported identifier). Used for telemetry reporting. + */ + isImportStatementCompletion?: true; + /** + * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`, + * that allows TS Server to look up the symbol represented by the completion item, disambiguating + * items with the same name. + */ + data?: unknown; } /** * Additional completion entry details, available on demand @@ -1728,9 +1784,13 @@ */ codeActions?: CodeAction[]; /** - * Human-readable description of the `source` from the CompletionEntry. + * @deprecated Use `sourceDisplay` instead. */ source?: SymbolDisplayPart[]; + /** + * Human-readable description of the `source` from the CompletionEntry. + */ + sourceDisplay?: SymbolDisplayPart[]; } /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */ interface CompletionsResponse extends Response { @@ -1749,6 +1809,7 @@ * must be used to commit that completion entry. */ readonly optionalReplacementSpan?: TextSpan; + readonly isIncomplete?: boolean; readonly entries: readonly CompletionEntry[]; } interface CompletionDetailsResponse extends Response { @@ -1892,6 +1953,31 @@ */ interface SignatureHelpResponse extends Response { body?: SignatureHelpItems; + } + type InlayHintKind = "Type" | "Parameter" | "Enum"; + interface InlayHintsRequestArgs extends FileRequestArgs { + /** + * Start position of the span. + */ + start: number; + /** + * Length of the span. + */ + length: number; + } + interface InlayHintsRequest extends Request { + command: CommandTypes.ProvideInlayHints; + arguments: InlayHintsRequestArgs; + } + interface InlayHintItem { + text: string; + position: Location; + kind: InlayHintKind; + whitespaceBefore?: boolean; + whitespaceAfter?: boolean; + } + interface InlayHintsResponse extends Response { + body?: InlayHintItem[]; } /** * Synchronous request for semantic diagnostics of one file. @@ -2532,6 +2618,15 @@ */ readonly includeCompletionsForModuleExports?: boolean; /** + * Enables auto-import-style completions on partially-typed import statements. E.g., allows + * `import write|` to be completed to `import { writeFile } from "fs"`. + */ + readonly includeCompletionsForImportStatements?: boolean; + /** + * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`. + */ + readonly includeCompletionsWithSnippetText?: boolean; + /** * If enabled, the completion list will include completions with invalid identifier names. * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. */ @@ -2542,6 +2637,14 @@ * values, with insertion text to replace preceding `.` tokens with `?.`. */ readonly includeAutomaticOptionalChainCompletions?: boolean; + /** + * If enabled, completions for class members (e.g. methods and properties) will include + * a whole declaration for the member. + * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of + * `class A { foo }`. + */ + readonly includeCompletionsWithClassMemberSnippets?: boolean; + readonly allowIncompleteCompletions?: boolean; readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative"; /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */ readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js"; @@ -2551,6 +2654,8 @@ readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; + readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none"; + readonly displayPartsForJSDoc?: boolean; readonly generateReturnInDocTemplate?: boolean; } interface CompilerOptions { @@ -2659,6 +2764,8 @@ ES2018 = "ES2018", ES2019 = "ES2019", ES2020 = "ES2020", + ES2021 = "ES2021", + ES2022 = "ES2022", ESNext = "ESNext" } const enum ClassificationType { @@ -2770,7 +2877,10 @@ * interface Y { foo:number; } */ memberVariableElement = "property", - /** class X { constructor() { } } */ + /** + * class X { constructor() { } } + * class X { static { } } + */ constructorImplementationElement = "constructor", /** interface Y { ():number; } */ callSignatureElement = "call", @@ -2790,10 +2900,17 @@ externalModuleName = "external module name", /** * <JsxTagName attribute1 attribute2={0} /> + * @deprecated */ jsxAttribute = "JSX attribute", /** String literal */ - string = "string" + string = "string", + /** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */ + link = "link", + /** Jsdoc @link: in `{@link C link text}`, the entity name "C" */ + linkName = "link name", + /** Jsdoc @link: in `{@link C link text}`, the link text "link text" */ + linkText = "link text" } export interface TypeAcquisition { @@ -2815,11 +2932,6 @@ extension: string; isMixedContent: boolean; scriptKind?: ScriptKind; - } - - interface JSDocTagInfo { - name: string; - text?: string; } /** -- Gitblit v1.8.0