GetEditsForFileRename = "getEditsForFileRename",
ConfigurePlugin = "configurePlugin",
SelectionRange = "selectionRange",
+ ToggleLineComment = "toggleLineComment",
+ ToggleMultilineComment = "toggleMultilineComment",
+ CommentSelection = "commentSelection",
+ UncommentSelection = "uncommentSelection",
PrepareCallHierarchy = "prepareCallHierarchy",
ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls",
ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls"
* Time spent updating the program graph, in milliseconds.
*/
updateGraphDurationMs?: number;
+ /**
+ * The time spent creating or updating the auto-import program, in milliseconds.
+ */
+ createAutoImportProviderProgramDurationMs?: number;
}
/**
* Arguments for FileRequest messages.
code: number;
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
+ reportsDeprecated?: {};
relatedInformation?: DiagnosticRelatedInformation[];
}
/**
command: CommandTypes.GetApplicableRefactors;
arguments: GetApplicableRefactorsRequestArgs;
}
- type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs;
+ type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
+ triggerReason?: RefactorTriggerReason;
+ };
+ type RefactorTriggerReason = "implicit" | "invoked";
/**
* Response is a list of available refactorings.
* Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
* so this description should make sense by itself if the parent is inlineable=true
*/
description: string;
+ /**
+ * A message to show to the user if the refactoring cannot be applied in
+ * the current context.
+ */
+ notApplicableReason?: string;
}
interface GetEditsForRefactorRequest extends Request {
command: CommandTypes.GetEditsForRefactor;
textSpan: TextSpan;
parent?: SelectionRange;
}
+ interface ToggleLineCommentRequest extends FileRequest {
+ command: CommandTypes.ToggleLineComment;
+ arguments: FileRangeRequestArgs;
+ }
+ interface ToggleMultilineCommentRequest extends FileRequest {
+ command: CommandTypes.ToggleMultilineComment;
+ arguments: FileRangeRequestArgs;
+ }
+ interface CommentSelectionRequest extends FileRequest {
+ command: CommandTypes.CommentSelection;
+ arguments: FileRangeRequestArgs;
+ }
+ interface UncommentSelectionRequest extends FileRequest {
+ command: CommandTypes.UncommentSelection;
+ arguments: FileRangeRequestArgs;
+ }
/**
* Information found in an "open" request.
*/
*/
closedFiles?: string[];
}
+ /**
+ * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
+ */
+ type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
/**
* Request to set compiler options for inferred projects.
* External projects are opened / closed explicitly.
/**
* Compiler options to be used with inferred projects.
*/
- options: ExternalProjectCompilerOptions;
+ options: InferredProjectCompilerOptions;
/**
* Specifies the project root path used to scope compiler options.
* It is an error to provide this property if the server has not been started with
* and therefore may not be accurate.
*/
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.
+ */
+ isPackageJsonImport?: true;
}
/**
* Additional completion entry details, available on demand
readonly isGlobalCompletion: boolean;
readonly isMemberCompletion: boolean;
readonly isNewIdentifierLocation: boolean;
+ /**
+ * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
+ * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
+ * must be used to commit that completion entry.
+ */
+ readonly optionalReplacementSpan?: TextSpan;
readonly entries: readonly CompletionEntry[];
}
interface CompletionDetailsResponse extends Response {
*/
category: string;
reportsUnnecessary?: {};
+ reportsDeprecated?: {};
/**
* Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites
*/
interface CallHierarchyItem {
name: string;
kind: ScriptElementKind;
+ kindModifiers?: string;
file: string;
span: TextSpan;
selectionSpan: TextSpan;
+ containerName?: string;
}
interface CallHierarchyIncomingCall {
from: CallHierarchyItem;
insertSpaceAfterConstructor?: boolean;
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
+ insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
readonly allowTextChangesInNewFiles?: boolean;
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
readonly providePrefixAndSuffixTextForRename?: boolean;
+ readonly provideRefactorNotApplicableReason?: boolean;
readonly allowRenameOfImportPath?: boolean;
+ readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
}
interface CompilerOptions {
allowJs?: boolean;
None = "None",
Preserve = "Preserve",
ReactNative = "ReactNative",
- React = "React"
+ React = "React",
+ ReactJSX = "ReactJSX",
+ ReactJSXDev = "ReactJSXDev"
}
const enum ModuleKind {
None = "None",
System = "System",
ES6 = "ES6",
ES2015 = "ES2015",
+ ES2020 = "ES2020",
ESNext = "ESNext"
}
const enum ModuleResolutionKind {
ES2018 = "ES2018",
ES2019 = "ES2019",
ES2020 = "ES2020",
+ JSON = "JSON",
ESNext = "ESNext"
}
}
enable?: boolean;
include?: string[];
exclude?: string[];
- [option: string]: string[] | boolean | undefined;
+ disableFilenameBasedTypeAcquisition?: boolean;
+ [option: string]: CompilerOptionsValue | undefined;
}
+ export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
+
export interface FileExtensionInfo {
extension: string;
isMixedContent: boolean;
scriptKind?: ScriptKind;
}
- export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[] | ProjectReference[] | null | undefined;
-
interface JSDocTagInfo {
name: string;
text?: string;