Skip to content

Commit a34b844

Browse files
authored
Make option literal a type def instead of an interface (#1518)
1 parent f4d0d76 commit a34b844

6 files changed

Lines changed: 110 additions & 108 deletions

File tree

protocol/src/common/protocol.foldingRange.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ import type {
1616
/**
1717
* @since 3.18.0
1818
*/
19-
export interface ClientFoldingRangeKindOptions {
19+
export type ClientFoldingRangeKindOptions = {
2020
/**
2121
* The folding range kind values the client supports. When this
2222
* property exists the client also guarantees that it will
2323
* handle values outside its set gracefully and falls back
2424
* to a default value when unknown.
2525
*/
2626
valueSet?: FoldingRangeKind[];
27-
}
27+
};
2828

2929
/**
3030
* @since 3.18.0
3131
*/
32-
export interface ClientFoldingRangeOptions {
32+
export type ClientFoldingRangeOptions = {
3333
/**
3434
* If set, the client signals that it supports setting collapsedText on
3535
* folding ranges to display custom labels instead of the default text.
3636
*
3737
* @since 3.17.0
3838
*/
3939
collapsedText?: boolean;
40-
}
40+
};
4141

4242
export interface FoldingRangeClientCapabilities {
4343

@@ -84,7 +84,7 @@ export interface FoldingRangeClientCapabilities {
8484
* @since 3.18.0
8585
* @proposed
8686
*/
87-
export interface FoldingRangeWorkspaceClientCapabilities {
87+
export type FoldingRangeWorkspaceClientCapabilities = {
8888

8989
/**
9090
* Whether the client implementation supports a refresh request sent from the
@@ -99,7 +99,7 @@ export interface FoldingRangeWorkspaceClientCapabilities {
9999
* @proposed
100100
*/
101101
refreshSupport?: boolean;
102-
}
102+
};
103103

104104
export interface FoldingRangeOptions extends WorkDoneProgressOptions {
105105
}

protocol/src/common/protocol.inlayHint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import type { StaticRegistrationOptions, TextDocumentRegistrationOptions, WorkDo
1212
/**
1313
* @since 3.18.0
1414
*/
15-
export interface ClientInlayHintResolveOptions {
15+
export type ClientInlayHintResolveOptions = {
1616
/**
1717
* The properties that a client can resolve lazily.
1818
*/
1919
properties: string[];
20-
}
20+
};
2121
/**
2222
* Inlay hint client capabilities.
2323
*

protocol/src/common/protocol.notebook.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,14 @@ export type VersionedNotebookDocumentIdentifier = {
297297
/**
298298
* @since 3.18.0
299299
*/
300-
export interface NotebookCellLanguage {
300+
export type NotebookCellLanguage = {
301301
language: string;
302-
}
302+
};
303303

304304
/**
305305
* @since 3.18.0
306306
*/
307-
export interface NotebookDocumentFilterWithNotebook {
307+
export type NotebookDocumentFilterWithNotebook = {
308308
/**
309309
* The notebook to be synced If a string
310310
* value is provided it matches against the
@@ -316,13 +316,13 @@ export interface NotebookDocumentFilterWithNotebook {
316316
* The cells of the matching notebook to be synced.
317317
*/
318318
cells?: NotebookCellLanguage[];
319-
}
319+
};
320320

321321

322322
/**
323323
* @since 3.18.0
324324
*/
325-
export interface NotebookDocumentFilterWithCells {
325+
export type NotebookDocumentFilterWithCells = {
326326
/**
327327
* The notebook to be synced If a string
328328
* value is provided it matches against the
@@ -334,7 +334,7 @@ export interface NotebookDocumentFilterWithCells {
334334
* The cells of the matching notebook to be synced.
335335
*/
336336
cells: NotebookCellLanguage[];
337-
}
337+
};
338338

339339
/**
340340
* Options specific to a notebook plus its cells
@@ -451,7 +451,7 @@ export namespace NotebookCellArrayChange {
451451
*
452452
* @since 3.18.0
453453
*/
454-
export interface NotebookDocumentCellChangeStructure {
454+
export type NotebookDocumentCellChangeStructure = {
455455
/**
456456
* The change to the cell array.
457457
*/
@@ -466,24 +466,24 @@ export interface NotebookDocumentCellChangeStructure {
466466
* Additional closed cell text documents.
467467
*/
468468
didClose?: TextDocumentIdentifier[];
469-
}
469+
};
470470

471471
/**
472472
* Content changes to a cell in a notebook document.
473473
*
474474
* @since 3.18.0
475475
*/
476-
export interface NotebookDocumentCellContentChanges {
476+
export type NotebookDocumentCellContentChanges = {
477477
document: VersionedTextDocumentIdentifier;
478478
changes: TextDocumentContentChangeEvent[];
479-
}
479+
};
480480

481481
/**
482482
* Cell changes to a notebook document.
483483
*
484484
* @since 3.18.0
485485
*/
486-
export interface NotebookDocumentCellChanges {
486+
export type NotebookDocumentCellChanges = {
487487
/**
488488
* Changes to the cell structure to add or
489489
* remove cells.
@@ -500,7 +500,7 @@ export interface NotebookDocumentCellChanges {
500500
* Changes to the text content of notebook cells.
501501
*/
502502
textContent?: NotebookDocumentCellContentChanges[];
503-
}
503+
};
504504

505505
/**
506506
* A change event for a notebook document.

protocol/src/common/protocol.semanticTokens.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ export type TokenFormat = 'relative';
3737
/**
3838
* @since 3.18.0
3939
*/
40-
export interface ClientSemanticTokensRequestFullDelta {
40+
export type ClientSemanticTokensRequestFullDelta = {
4141
/**
4242
* The client will send the `textDocument/semanticTokens/full/delta` request if
4343
* the server provides a corresponding handler.
4444
*/
4545
delta?: boolean;
46-
}
46+
};
4747

4848
/**
4949
* @since 3.18.0
5050
*/
51-
export interface ClientSemanticTokensRequestOptions {
51+
export type ClientSemanticTokensRequestOptions = {
5252

5353
/**
5454
* The client will send the `textDocument/semanticTokens/range` request if
@@ -62,7 +62,7 @@ export interface ClientSemanticTokensRequestOptions {
6262
* the server provides a corresponding handler.
6363
*/
6464
full?: boolean | ClientSemanticTokensRequestFullDelta;
65-
}
65+
};
6666

6767
/**
6868
* @since 3.16.0
@@ -143,12 +143,12 @@ export interface SemanticTokensClientCapabilities {
143143
*
144144
* @since 3.18.0
145145
*/
146-
export interface SemanticTokensFullDelta {
146+
export type SemanticTokensFullDelta = {
147147
/**
148148
* The server supports deltas for full documents.
149149
*/
150150
delta?: boolean;
151-
}
151+
};
152152

153153
/**
154154
* @since 3.16.0

0 commit comments

Comments
 (0)