Change:
! In the edit sessions when I click on the file it should show the compare view in between changes with the current head change Right now I have explicitly have to hit the refresh button to show all edit sessions and also the syntax highlighting is missing. It is just showing the white text. I think it would be much better if you provide git stash similar functionality for edit sessions ! Thank you! Appreciate your work
<!-- -96bd-47a8-a0e8- --This feature request is now a candidate for our backlog. The community has 60 days to the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our . Happy Coding!
<!-- -a7ce-58b9-b1f9- --This feature request has not yet received the 20 community it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our . Happy Coding!
Verification steps: vscode repo some changes to a file command from command palette changes the node corresponding to the changes you just stored on the tree item for the file you changed in step 2 should open a diff for the file

Discussion:
import { Registry } from 'vs/platform/registry/common/platform'; import { TreeView, TreeViewPane } from 'vs/workbench/browser/parts/views/treeView'; import { Extensions, ITreeItem, ITreeViewDataProvider, ITreeViewDescriptor, IViewsRegistry, TreeItemCollapsibleState, TreeViewItemHandleArg, ViewContainer } from 'vs/workbench/common/views'; <del> import { EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_TITLE, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions'; </del> <ins> import { ChangeType, EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_TITLE, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions'; </ins> import { URI } from 'vs/base/common/uri'; import { fromNow } from 'vs/base/common/date'; import { Codicon } from 'vs/base/common/codicons';

import { ContextKeyExpr, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; <ins> import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { joinPath } from 'vs/base/common/resources'; import { IFileService } from 'vs/platform/files/common/files'; import { basename } from 'vs/base/common/path'; </ins> const EDIT_SESSIONS_COUNT_KEY = 'editSessionsCount'; const EDIT_SESSIONS_COUNT_CONTEXT_KEY = new RawContextKey<number>(EDIT_SESSIONS_COUNT_KEY, 0);

constructor( @IEditSessionsStorageService private readonly editSessionsStorageService: IEditSessionsStorageService, <del> @IContextKeyService private readonly contextKeyService: IContextKeyService </del> <ins> @IContextKeyService private readonly contextKeyService: IContextKeyService, @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, @IFileService private readonly fileService: IFileService, </ins> ) { this.editSessionsCount = EDIT_SESSIONS_COUNT_CONTEXT_KEY.bindTo(this.contextKeyService); }

return []; } <del> return (data.editSession.folders.find((folder) => folder.name === folderName)?.workingChanges ?? []).map((change) => { const resource = URI.from({ scheme: EDIT_SESSIONS_SCHEME, authority: 'remote-session-content', path: `/${data.ref}/${folderName}/${change.relativeFilePath}` }); </del> <ins> const currentWorkspaceFolder = this.workspaceContextService.getWorkspace().folders.find((folder) => folder.name === folderName); const editSessionFolder = data.editSession.folders.find((folder) => folder.name === folderName); if (!editSessionFolder) { return []; } return Promise.all(editSessionFolder.workingChanges.map(async (change) => { const cloudChangeUri = URI.from({ scheme: EDIT_SESSIONS_SCHEME, authority: 'remote-session-content', path: `/${data.ref}/${folderName}/${change.relativeFilePath}` }); if (currentWorkspaceFolder?.uri) { // find the corresponding file in the workspace const localCopy = joinPath(currentWorkspaceFolder.uri, change.relativeFilePath); if (change.type === ChangeType.Addition && await this.fileService.exists(localCopy)) { return { handle: cloudChangeUri.toString(), resourceUri: cloudChangeUri, collapsibleState: TreeItemCollapsibleState.None, label: { label: change.relativeFilePath }, themeIcon: Codicon.file, command: { id: 'vscode.diff', title: localize('compare changes', 'Compare Changes'), arguments: [ localCopy, cloudChangeUri, `${basename(change.relativeFilePath)} (${localize('local copy', 'Local Copy')} u2194 ${localize('cloud changes', 'Cloud Changes')})`, undefined ] } }; } } </ins> return { <del> handle: resource.toString(), resourceUri: resource, </del> <ins> handle: cloudChangeUri.toString(), resourceUri: cloudChangeUri, </ins> collapsibleState: TreeItemCollapsibleState.None, label: { label: change.relativeFilePath }, themeIcon: Codicon.file, command: { id: API_OPEN_EDITOR_COMMAND_ID, title: localize('open file', 'Open File'), <del> arguments: [resource, undefined, undefined] </del> <ins> arguments: [cloudChangeUri, undefined, undefined] </ins> } }; <del> }); </del> <ins> })); </ins> } }