Make option literal a type def instead of an interface (#1518)

This commit is contained in:
Dirk Bäumer 2024-07-09 16:51:03 +02:00 коммит произвёл GitHub
Родитель f4d0d76cb1
Коммит a34b844ada
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 110 добавлений и 108 удалений

Просмотреть файл

@ -16,7 +16,7 @@ import type {
/**
* @since 3.18.0
*/
export interface ClientFoldingRangeKindOptions {
export type ClientFoldingRangeKindOptions = {
/**
* The folding range kind values the client supports. When this
* property exists the client also guarantees that it will
@ -24,12 +24,12 @@ export interface ClientFoldingRangeKindOptions {
* to a default value when unknown.
*/
valueSet?: FoldingRangeKind[];
}
};
/**
* @since 3.18.0
*/
export interface ClientFoldingRangeOptions {
export type ClientFoldingRangeOptions = {
/**
* If set, the client signals that it supports setting collapsedText on
* folding ranges to display custom labels instead of the default text.
@ -37,7 +37,7 @@ export interface ClientFoldingRangeOptions {
* @since 3.17.0
*/
collapsedText?: boolean;
}
};
export interface FoldingRangeClientCapabilities {
@ -84,7 +84,7 @@ export interface FoldingRangeClientCapabilities {
* @since 3.18.0
* @proposed
*/
export interface FoldingRangeWorkspaceClientCapabilities {
export type FoldingRangeWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from the
@ -99,7 +99,7 @@ export interface FoldingRangeWorkspaceClientCapabilities {
* @proposed
*/
refreshSupport?: boolean;
}
};
export interface FoldingRangeOptions extends WorkDoneProgressOptions {
}

Просмотреть файл

@ -12,12 +12,12 @@ import type { StaticRegistrationOptions, TextDocumentRegistrationOptions, WorkDo
/**
* @since 3.18.0
*/
export interface ClientInlayHintResolveOptions {
export type ClientInlayHintResolveOptions = {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
}
};
/**
* Inlay hint client capabilities.
*

Просмотреть файл

@ -297,14 +297,14 @@ export type VersionedNotebookDocumentIdentifier = {
/**
* @since 3.18.0
*/
export interface NotebookCellLanguage {
export type NotebookCellLanguage = {
language: string;
}
};
/**
* @since 3.18.0
*/
export interface NotebookDocumentFilterWithNotebook {
export type NotebookDocumentFilterWithNotebook = {
/**
* The notebook to be synced If a string
* value is provided it matches against the
@ -316,13 +316,13 @@ export interface NotebookDocumentFilterWithNotebook {
* The cells of the matching notebook to be synced.
*/
cells?: NotebookCellLanguage[];
}
};
/**
* @since 3.18.0
*/
export interface NotebookDocumentFilterWithCells {
export type NotebookDocumentFilterWithCells = {
/**
* The notebook to be synced If a string
* value is provided it matches against the
@ -334,7 +334,7 @@ export interface NotebookDocumentFilterWithCells {
* The cells of the matching notebook to be synced.
*/
cells: NotebookCellLanguage[];
}
};
/**
* Options specific to a notebook plus its cells
@ -451,7 +451,7 @@ export namespace NotebookCellArrayChange {
*
* @since 3.18.0
*/
export interface NotebookDocumentCellChangeStructure {
export type NotebookDocumentCellChangeStructure = {
/**
* The change to the cell array.
*/
@ -466,24 +466,24 @@ export interface NotebookDocumentCellChangeStructure {
* Additional closed cell text documents.
*/
didClose?: TextDocumentIdentifier[];
}
};
/**
* Content changes to a cell in a notebook document.
*
* @since 3.18.0
*/
export interface NotebookDocumentCellContentChanges {
export type NotebookDocumentCellContentChanges = {
document: VersionedTextDocumentIdentifier;
changes: TextDocumentContentChangeEvent[];
}
};
/**
* Cell changes to a notebook document.
*
* @since 3.18.0
*/
export interface NotebookDocumentCellChanges {
export type NotebookDocumentCellChanges = {
/**
* Changes to the cell structure to add or
* remove cells.
@ -500,7 +500,7 @@ export interface NotebookDocumentCellChanges {
* Changes to the text content of notebook cells.
*/
textContent?: NotebookDocumentCellContentChanges[];
}
};
/**
* A change event for a notebook document.

Просмотреть файл

@ -37,18 +37,18 @@ export type TokenFormat = 'relative';
/**
* @since 3.18.0
*/
export interface ClientSemanticTokensRequestFullDelta {
export type ClientSemanticTokensRequestFullDelta = {
/**
* The client will send the `textDocument/semanticTokens/full/delta` request if
* the server provides a corresponding handler.
*/
delta?: boolean;
}
};
/**
* @since 3.18.0
*/
export interface ClientSemanticTokensRequestOptions {
export type ClientSemanticTokensRequestOptions = {
/**
* The client will send the `textDocument/semanticTokens/range` request if
@ -62,7 +62,7 @@ export interface ClientSemanticTokensRequestOptions {
* the server provides a corresponding handler.
*/
full?: boolean | ClientSemanticTokensRequestFullDelta;
}
};
/**
* @since 3.16.0
@ -143,12 +143,12 @@ export interface SemanticTokensClientCapabilities {
*
* @since 3.18.0
*/
export interface SemanticTokensFullDelta {
export type SemanticTokensFullDelta = {
/**
* The server supports deltas for full documents.
*/
delta?: boolean;
}
};
/**
* @since 3.16.0

Просмотреть файл

@ -131,7 +131,7 @@ let __noDynamicImport: LocationLink | undefined;
*
* @since 3.18.0
*/
export interface TextDocumentFilterLanguage {
export type TextDocumentFilterLanguage = {
/**
* A language id, like `typescript`.
*/
@ -147,15 +147,15 @@ export interface TextDocumentFilterLanguage {
*
* @since 3.18.0 - support for relative patterns.
*/
pattern?: string;
}
pattern?: GlobPattern;
};
/**
* A document filter where `scheme` is required field.
*
* @since 3.18.0
*/
export interface TextDocumentFilterScheme {
export type TextDocumentFilterScheme = {
/**
* A language id, like `typescript`.
*/
@ -171,15 +171,15 @@ export interface TextDocumentFilterScheme {
*
* @since 3.18.0 - support for relative patterns.
*/
pattern?: string;
}
pattern?: GlobPattern;
};
/**
* A document filter where `pattern` is required field.
*
* @since 3.18.0
*/
export interface TextDocumentFilterPattern {
export type TextDocumentFilterPattern = {
/**
* A language id, like `typescript`.
*/
@ -196,7 +196,7 @@ export interface TextDocumentFilterPattern {
* @since 3.18.0 - support for relative patterns.
*/
pattern: GlobPattern;
}
};
/**
* A document filter denotes a document by different properties like
@ -236,7 +236,7 @@ export namespace TextDocumentFilter {
*
* @since 3.18.0
*/
export interface NotebookDocumentFilterNotebookType {
export type NotebookDocumentFilterNotebookType = {
/**
* The type of the enclosing notebook.
*/
@ -251,14 +251,14 @@ export interface NotebookDocumentFilterNotebookType {
* A glob pattern.
*/
pattern?: string;
}
};
/**
* A notebook document filter where `scheme` is required field.
*
* @since 3.18.0
*/
export interface NotebookDocumentFilterScheme {
export type NotebookDocumentFilterScheme = {
/**
* The type of the enclosing notebook.
*/
@ -273,14 +273,14 @@ export interface NotebookDocumentFilterScheme {
* A glob pattern.
*/
pattern?: string;
}
};
/**
* A notebook document filter where `pattern` is required field.
*
* @since 3.18.0
*/
export interface NotebookDocumentFilterPattern {
export type NotebookDocumentFilterPattern = {
/**
* The type of the enclosing notebook.
*/
@ -295,7 +295,7 @@ export interface NotebookDocumentFilterPattern {
* A glob pattern.
*/
pattern: string;
}
};
/**
* A notebook document filter denotes a notebook document by
@ -973,7 +973,7 @@ export type PositionEncodingKind = string;
/**
* @since 3.18.0
*/
export interface StaleRequestSupportOptions {
export type StaleRequestSupportOptions = {
/**
* The client will actively cancel the request.
*/
@ -985,7 +985,7 @@ export interface StaleRequestSupportOptions {
* response with error code `ContentModified`
*/
retryOnContentModified: string[];
}
};
/**
* General client capabilities.
@ -1172,7 +1172,7 @@ export namespace WorkDoneProgressOptions {
*
* @since 3.18.0
*/
export interface WorkspaceOptions {
export type WorkspaceOptions = {
/**
* The server supports workspace folder.
*
@ -1186,7 +1186,7 @@ export interface WorkspaceOptions {
* @since 3.16.0
*/
fileOperations?: FileOperationOptions;
}
};
/**
* Defines the capabilities provided by a language
@ -1416,7 +1416,7 @@ export interface ServerCapabilities<T = LSPAny> {
* @since 3.15.0
* @since 3.18.0 ServerInfo type name added.
*/
export interface ServerInfo {
export type ServerInfo = {
/**
* The name of the server as defined by the server.
*/
@ -1426,7 +1426,7 @@ export interface ServerInfo {
* The server's version as defined by the server.
*/
version?: string;
}
};
/**
@ -1435,7 +1435,7 @@ export interface ServerInfo {
* @since 3.15.0
* @since 3.18.0 ClientInfo type name added.
*/
export interface ClientInfo {
export type ClientInfo = {
/**
* The name of the client as defined by the client.
*/
@ -1445,7 +1445,7 @@ export interface ClientInfo {
* The client's version as defined by the client.
*/
version?: string;
}
};
/**
* The initialize request is sent from the client to the server.
@ -1714,14 +1714,14 @@ export namespace ShowMessageNotification {
/**
* @since 3.18.0
*/
export interface ClientShowMessageActionItemOptions {
export type ClientShowMessageActionItemOptions = {
/**
* Whether the client supports additional attributes which
* are preserved and send back to the server in the
* request's response.
*/
additionalPropertiesSupport?: boolean;
}
};
/**
* Show message request client capabilities
@ -1920,17 +1920,17 @@ export namespace DidOpenTextDocumentNotification {
/**
* @since 3.18.0
*/
export interface TextDocumentContentChangeWholeDocument {
export type TextDocumentContentChangeWholeDocument = {
/**
* The new text of the whole document.
*/
text: string;
}
};
/**
* @since 3.18.0
*/
export interface TextDocumentContentChangePartial {
export type TextDocumentContentChangePartial = {
/**
* The range of the document that changed.
*/
@ -1947,7 +1947,7 @@ export interface TextDocumentContentChangePartial {
* The new text for the provided range.
*/
text: string;
}
};
/**
* An event describing a change to a text document. If only a text is provided
@ -2320,12 +2320,12 @@ export type WatchKind = uinteger;
/**
* @since 3.18.0
*/
export interface ClientDiagnosticsTagOptions {
export type ClientDiagnosticsTagOptions = {
/**
* The tags supported by the client.
*/
valueSet: DiagnosticTag[];
}
};
/**
@ -2432,34 +2432,34 @@ export interface CompletionListCapabilities {
/**
* @since 3.18.0
*/
export interface CompletionItemTagOptions {
export type CompletionItemTagOptions = {
/**
* The tags supported by the client.
*/
valueSet: CompletionItemTag[];
}
};
/**
* @since 3.18.0
*/
export interface ClientCompletionItemResolveOptions {
export type ClientCompletionItemResolveOptions = {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
}
};
/**
* @since 3.18.0
*/
export interface ClientCompletionItemInsertTextModeOptions {
export type ClientCompletionItemInsertTextModeOptions = {
valueSet: InsertTextMode[];
}
};
/**
* @since 3.18.0
*/
export interface ClientCompletionItemOptions {
export type ClientCompletionItemOptions = {
/**
* Client supports snippets as insert text.
*
@ -2534,12 +2534,12 @@ export interface ClientCompletionItemOptions {
* @since 3.17.0
*/
labelDetailsSupport?: boolean;
}
};
/**
* @since 3.18.0
*/
export interface ClientCompletionItemOptionsKind {
export type ClientCompletionItemOptionsKind = {
/**
* The completion item kind values the client supports. When this
* property exists the client also guarantees that it will
@ -2551,7 +2551,7 @@ export interface ClientCompletionItemOptionsKind {
* the initial version of the protocol.
*/
valueSet?: CompletionItemKind[];
}
};
/**
* Completion client capabilities
@ -2650,7 +2650,7 @@ export interface CompletionParams extends TextDocumentPositionParams, WorkDonePr
/**
* @since 3.18.0
*/
export interface ServerCompletionItemOptions {
export type ServerCompletionItemOptions = {
/**
* The server has support for completion item label
* details (see also `CompletionItemLabelDetails`) when
@ -2659,7 +2659,7 @@ export interface ServerCompletionItemOptions {
* @since 3.17.0
*/
labelDetailsSupport?: boolean;
}
};
/**
* Completion options.
@ -2787,7 +2787,7 @@ export namespace HoverRequest {
/**
* @since 3.18.0
*/
export interface ClientSignatureParameterInformationOptions {
export type ClientSignatureParameterInformationOptions = {
/**
* The client supports processing label offsets instead of a
* simple label string.
@ -2795,12 +2795,12 @@ export interface ClientSignatureParameterInformationOptions {
* @since 3.14.0
*/
labelOffsetSupport?: boolean;
}
};
/**
* @since 3.18.0
*/
export interface ClientSignatureInformationOptions {
export type ClientSignatureInformationOptions = {
/**
* Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
@ -2826,10 +2826,10 @@ export interface ClientSignatureInformationOptions {
* indicate that no parameter should be active.
*
* @since 3.18.0
* @proposed
* @proposed
*/
noActiveParameterSupport?: boolean;
}
};
/**
* Client Capabilities for a {@link SignatureHelpRequest}.
@ -3178,7 +3178,7 @@ export namespace DocumentSymbolRequest {
/**
* @since 3.18.0
*/
export interface ClientCodeActionKindOptions {
export type ClientCodeActionKindOptions = {
/**
* The code action kind values the client supports. When this
@ -3187,27 +3187,27 @@ export interface ClientCodeActionKindOptions {
* to a default value when unknown.
*/
valueSet: CodeActionKind[];
}
};
/**
* @since 3.18.0
*/
export interface ClientCodeActionLiteralOptions {
export type ClientCodeActionLiteralOptions = {
/**
* The code action kind is support with the following value
* set.
*/
codeActionKind: ClientCodeActionKindOptions;
}
};
/**
* @since 3.18.0
*/
export interface ClientCodeActionResolveOptions {
export type ClientCodeActionResolveOptions = {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
}
};
/**
* The Client Capabilities of a {@link CodeActionRequest}.
@ -3305,7 +3305,7 @@ export interface CodeActionParams extends WorkDoneProgressParams, PartialResultP
* @since 3.18.0
* @proposed
*/
export interface CodeActionKindDocumentation {
export type CodeActionKindDocumentation = {
/**
* The kind of the code action being documented.
*
@ -3321,7 +3321,7 @@ export interface CodeActionKindDocumentation {
* The title of this documentation code action is taken from {@linkcode Command.title}
*/
command: Command;
}
};
/**
* Provider options for a {@link CodeActionRequest}.
@ -3395,7 +3395,7 @@ export namespace CodeActionResolveRequest {
/**
* @since 3.18.0
*/
export interface ClientSymbolKindOptions {
export type ClientSymbolKindOptions = {
/**
* The symbol kind values the client supports. When this
* property exists the client also guarantees that it will
@ -3407,28 +3407,28 @@ export interface ClientSymbolKindOptions {
* the initial version of the protocol.
*/
valueSet?: SymbolKind[];
}
};
/**
* @since 3.18.0
*/
export interface ClientSymbolTagOptions {
export type ClientSymbolTagOptions = {
/**
* The tags supported by the client.
*/
valueSet: SymbolTag[];
}
};
/**
* @since 3.18.0
*/
export interface ClientSymbolResolveOptions {
export type ClientSymbolResolveOptions = {
/**
* The properties that a client can resolve lazily. Usually
* `location.range`
*/
properties: string[];
}
};
/**
* Client capabilities for a {@link WorkspaceSymbolRequest}.
@ -4016,17 +4016,17 @@ export interface PrepareRenameParams extends TextDocumentPositionParams, WorkDon
/**
* @since 3.18.0
*/
export interface PrepareRenamePlaceholder {
export type PrepareRenamePlaceholder = {
range: Range;
placeholder: string;
}
};
/**
* @since 3.18.0
*/
export interface PrepareRenameDefaultBehavior {
export type PrepareRenameDefaultBehavior = {
defaultBehavior: boolean;
}
};
export type PrepareRenameResult = Range | PrepareRenamePlaceholder | PrepareRenameDefaultBehavior;
@ -4099,14 +4099,14 @@ export namespace ExecuteCommandRequest {
/**
* @since 3.18.0
*/
export interface ChangeAnnotationsSupportOptions {
export type ChangeAnnotationsSupportOptions = {
/**
* Whether the client groups edits with equal labels into tree nodes,
* for instance all edits labelled with "Changes in Strings" would
* be a tree node.
*/
groupsOnLabel?: boolean;
}
};
export interface WorkspaceEditClientCapabilities {
/**

Просмотреть файл

@ -1329,12 +1329,12 @@ export namespace WorkspaceEdit {
* @since 3.18.0
* @proposed
*/
export interface WorkspaceEditMetadata {
export type WorkspaceEditMetadata = {
/**
* Signal to the editor that this edit is a refactoring.
*/
isRefactoring?: boolean;
}
};
/**
* A change to capture text edits for existing resources.
@ -2453,10 +2453,10 @@ export namespace CompletionItem {
*
* @since 3.18.0
*/
export interface EditRangeWithInsertReplace {
export type EditRangeWithInsertReplace = {
insert: Range;
replace: Range;
}
};
/**
* In many cases the items of an actual completion result share the same
@ -2566,10 +2566,10 @@ export namespace CompletionList {
* @since 3.18.0
* @deprecated use MarkupContent instead.
*/
export interface MarkedStringWithLanguage {
export type MarkedStringWithLanguage = {
language: string;
value: string;
}
};
/**
* MarkedString can be used to render human readable text. It is either a markdown string
@ -3023,7 +3023,9 @@ export namespace SymbolInformation {
*
* @since 3.18.0
*/
export interface LocationUriOnly { uri: DocumentUri }
export type LocationUriOnly = {
uri: DocumentUri;
};
/**
* A special workspace symbol that supports locations without a range.
@ -3366,7 +3368,7 @@ export namespace CodeActionContext {
*
* @since 3.18.0
*/
export interface CodeActionDisabled {
export type CodeActionDisabled = {
/**
* Human readable description of why the code action is currently disabled.
@ -3374,7 +3376,7 @@ export interface CodeActionDisabled {
* This is displayed in the code actions UI.
*/
reason: string;
}
};
/**
* A code action represents a change that can be performed in code, e.g. to fix a problem or
@ -4344,7 +4346,7 @@ export namespace InlayHint {
* @since 3.18.0
* @proposed
*/
export interface StringValue {
export type StringValue = {
/**
* The kind of string value.
*/
@ -4354,7 +4356,7 @@ export interface StringValue {
* The snippet string.
*/
value: string;
}
};
export namespace StringValue {
export function createSnippet(value: string): StringValue {
@ -4448,7 +4450,7 @@ export type InlineCompletionTriggerKind = 1 | 2;
* @since 3.18.0
* @proposed
*/
export interface SelectedCompletionInfo {
export type SelectedCompletionInfo = {
/**
* The range that will be replaced if this completion item is accepted.
*/
@ -4458,7 +4460,7 @@ export interface SelectedCompletionInfo {
* The text the range will be replaced with if this completion is accepted.
*/
text: string;
}
};
export namespace SelectedCompletionInfo {
export function create(range: Range, text: string): SelectedCompletionInfo {
@ -4472,7 +4474,7 @@ export namespace SelectedCompletionInfo {
* @since 3.18.0
* @proposed
*/
export interface InlineCompletionContext {
export type InlineCompletionContext = {
/**
* Describes how the inline completion was triggered.
*/
@ -4482,7 +4484,7 @@ export interface InlineCompletionContext {
* Provides information about the currently selected item in the autocomplete widget if it is visible.
*/
selectedCompletionInfo?: SelectedCompletionInfo;
}
};
export namespace InlineCompletionContext{
export function create(triggerKind: InlineCompletionTriggerKind, selectedCompletionInfo?: SelectedCompletionInfo): InlineCompletionContext {