Testing #37133
fyi @jrieken .
- observe that a WorkspaceFolder has three fields:
uri, name and index.
- observe the reading API:
export let workspaceFolders: WorkspaceFolder[] | undefined;
IMHO, the editing API seems out of place:
removeWorkspaceFolder takes as argument a single WorkspaceFolder; why a single one ?
addWorkspaceFolder also takes in a single WorkspaceFolder; why ? It also ignores the index property; how to add something at the beginning of the array ?
e.g. of difficulty:
- how to implement replace folder at
i with another folder. i.e. workspaceFolders[i] = newWorkspaceFolder:
- remove N folders where folder.index >= i, i.e. call
removeWorkspaceFolder N times
- add N folders back again i.e. call
addWorkspaceFolder N times
IMHO a much simpler API would be a setWorkspaceFolders(newWorkspaceFolders: WorkspaceFolder[])
Testing #37133
fyi @jrieken .
uri,nameandindex.export let workspaceFolders: WorkspaceFolder[] | undefined;IMHO, the editing API seems out of place:
removeWorkspaceFoldertakes as argument a singleWorkspaceFolder; why a single one ?addWorkspaceFolderalso takes in a singleWorkspaceFolder; why ? It also ignores theindexproperty; how to add something at the beginning of the array ?e.g. of difficulty:
iwith another folder. i.e.workspaceFolders[i] = newWorkspaceFolder:removeWorkspaceFolderN timesaddWorkspaceFolderN timesIMHO a much simpler API would be a
setWorkspaceFolders(newWorkspaceFolders: WorkspaceFolder[])