Skip to content

Commit

Permalink
Make option literal a type def instead of an interface (#1518)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaeumer authored Jul 9, 2024
1 parent f4d0d76 commit a34b844
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 108 deletions.
12 changes: 6 additions & 6 deletions protocol/src/common/protocol.foldingRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ 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
* handle values outside its set gracefully and falls back
* 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.
*
* @since 3.17.0
*/
collapsedText?: boolean;
}
};

export interface FoldingRangeClientCapabilities {

Expand Down Expand Up @@ -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
Expand All @@ -99,7 +99,7 @@ export interface FoldingRangeWorkspaceClientCapabilities {
* @proposed
*/
refreshSupport?: boolean;
}
};

export interface FoldingRangeOptions extends WorkDoneProgressOptions {
}
Expand Down
4 changes: 2 additions & 2 deletions protocol/src/common/protocol.inlayHint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
24 changes: 12 additions & 12 deletions protocol/src/common/protocol.notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -451,7 +451,7 @@ export namespace NotebookCellArrayChange {
*
* @since 3.18.0
*/
export interface NotebookDocumentCellChangeStructure {
export type NotebookDocumentCellChangeStructure = {
/**
* The change to the cell array.
*/
Expand All @@ -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.
Expand All @@ -500,7 +500,7 @@ export interface NotebookDocumentCellChanges {
* Changes to the text content of notebook cells.
*/
textContent?: NotebookDocumentCellContentChanges[];
}
};

/**
* A change event for a notebook document.
Expand Down
12 changes: 6 additions & 6 deletions protocol/src/common/protocol.semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -62,7 +62,7 @@ export interface ClientSemanticTokensRequestOptions {
* the server provides a corresponding handler.
*/
full?: boolean | ClientSemanticTokensRequestFullDelta;
}
};

/**
* @since 3.16.0
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit a34b844

Please sign in to comment.