Skip to content

Commit a760573

Browse files
authored
Correctly type URIs in file operations and clarify comments (#1820)
* Correctly type URI in file create, rename and delete * Clarify comments * Update meta model
1 parent 8cb66c8 commit a760573

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

protocol/metaModel.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5923,8 +5923,8 @@
59235923
}
59245924
},
59255925
"optional": true,
5926-
"documentation": "Tags for this code action.\n\n@since 3.18.0 - proposed",
5927-
"since": "3.18.0 - proposed"
5926+
"documentation": "Tags for this code action.\n\n@since 3.18.0",
5927+
"since": "3.18.0"
59285928
}
59295929
],
59305930
"documentation": "A code action represents a change that can be performed in code, e.g. to fix a problem or\nto refactor code.\n\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed."
@@ -7140,9 +7140,9 @@
71407140
"name": "uri",
71417141
"type": {
71427142
"kind": "base",
7143-
"name": "string"
7143+
"name": "DocumentUri"
71447144
},
7145-
"documentation": "A file:// URI for the location of the file/folder being created."
7145+
"documentation": "A URI for the location of the file/folder being created."
71467146
}
71477147
],
71487148
"documentation": "Represents information on a file/folder create.\n\n@since 3.16.0",
@@ -7374,17 +7374,17 @@
73747374
"name": "oldUri",
73757375
"type": {
73767376
"kind": "base",
7377-
"name": "string"
7377+
"name": "DocumentUri"
73787378
},
7379-
"documentation": "A file:// URI for the original location of the file/folder being renamed."
7379+
"documentation": "A URI for the original location of the file/folder being renamed."
73807380
},
73817381
{
73827382
"name": "newUri",
73837383
"type": {
73847384
"kind": "base",
7385-
"name": "string"
7385+
"name": "DocumentUri"
73867386
},
7387-
"documentation": "A file:// URI for the new location of the file/folder being renamed."
7387+
"documentation": "A URI for the new location of the file/folder being renamed."
73887388
}
73897389
],
73907390
"documentation": "Represents information on a file/folder rename.\n\n@since 3.16.0",
@@ -7397,9 +7397,9 @@
73977397
"name": "uri",
73987398
"type": {
73997399
"kind": "base",
7400-
"name": "string"
7400+
"name": "DocumentUri"
74017401
},
7402-
"documentation": "A file:// URI for the location of the file/folder being deleted."
7402+
"documentation": "A URI for the location of the file/folder being deleted."
74037403
}
74047404
],
74057405
"documentation": "Represents information on a file/folder delete.\n\n@since 3.16.0",
@@ -15001,8 +15001,8 @@
1500115001
"documentation": "Marks the code action as LLM-generated."
1500215002
}
1500315003
],
15004-
"documentation": "Code action tags are extra annotations that tweak the behavior of a code action.\n\n@since 3.18.0 - proposed",
15005-
"since": "3.18.0 - proposed"
15004+
"documentation": "Code action tags are extra annotations that tweak the behavior of a code action.\n\n@since 3.18.0",
15005+
"since": "3.18.0"
1500615006
},
1500715007
{
1500815008
"name": "TraceValue",

protocol/src/common/protocol.fileOperations.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ------------------------------------------------------------------------------------------ */
55

66
import { NotificationHandler, RequestHandler } from 'vscode-jsonrpc';
7-
import { WorkspaceEdit } from 'vscode-languageserver-types';
7+
import { WorkspaceEdit, type DocumentUri } from 'vscode-languageserver-types';
88
import { CM, MessageDirection, ProtocolNotificationType, ProtocolRequestType } from './messages';
99

1010
/**
@@ -211,9 +211,9 @@ export interface CreateFilesParams {
211211
export interface FileCreate {
212212

213213
/**
214-
* A file:// URI for the location of the file/folder being created.
214+
* A URI for the location of the file/folder being created.
215215
*/
216-
uri: string;
216+
uri: DocumentUri;
217217
}
218218

219219
/**
@@ -239,14 +239,14 @@ export interface RenameFilesParams {
239239
export interface FileRename {
240240

241241
/**
242-
* A file:// URI for the original location of the file/folder being renamed.
242+
* A URI for the original location of the file/folder being renamed.
243243
*/
244-
oldUri: string;
244+
oldUri: DocumentUri;
245245

246246
/**
247-
* A file:// URI for the new location of the file/folder being renamed.
247+
* A URI for the new location of the file/folder being renamed.
248248
*/
249-
newUri: string;
249+
newUri: DocumentUri;
250250
}
251251

252252
/**
@@ -271,9 +271,9 @@ export interface DeleteFilesParams {
271271
export interface FileDelete {
272272

273273
/**
274-
* A file:// URI for the location of the file/folder being deleted.
274+
* A URI for the location of the file/folder being deleted.
275275
*/
276-
uri: string;
276+
uri: DocumentUri;
277277
}
278278

279279

0 commit comments

Comments
 (0)