Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,7 @@ export default tseslint.config(
'vs/editor/contrib/*/~',
'vs/workbench/~',
'vs/workbench/services/*/~',
'vs/sessions/services/*/~',
{
'when': 'test',
'pattern': 'vs/workbench/contrib/*/~'
Expand Down
17 changes: 16 additions & 1 deletion extensions/git/esbuild.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { run } from '../esbuild-extension-common.mts';

const srcDir = path.join(import.meta.dirname, 'src');
const outDir = path.join(import.meta.dirname, 'dist');

async function copyNonTsFiles(outDir: string): Promise<void> {
const entries = await fs.readdir(srcDir, { withFileTypes: true, recursive: true });
for (const entry of entries) {
if (!entry.isFile() || entry.name.endsWith('.ts')) {
continue;
}
const srcPath = path.join(entry.parentPath, entry.name);
const relativePath = path.relative(srcDir, srcPath);
const destPath = path.join(outDir, relativePath);
await fs.mkdir(path.dirname(destPath), { recursive: true });
await fs.copyFile(srcPath, destPath);
}
}

run({
platform: 'node',
entryPoints: {
Expand All @@ -17,4 +32,4 @@ run({
},
srcDir,
outdir: outDir,
}, process.argv);
}, process.argv, copyNonTsFiles);
12 changes: 0 additions & 12 deletions extensions/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,6 @@
}
],
"chat/input/editing/sessionApplyActions": [
{
"command": "github.createPullRequest",
"group": "navigation",
"order": 1,
"when": "isSessionsWindow && agentSessionHasChanges && chatSessionType == copilotcli && !github.hasOpenPullRequest"
},
{
"command": "github.openPullRequest",
"group": "navigation",
"order": 1,
"when": "isSessionsWindow && agentSessionHasChanges && chatSessionType == copilotcli && github.hasOpenPullRequest"
}
]
},
"configuration": [
Expand Down
15 changes: 8 additions & 7 deletions src/vs/sessions/contrib/changesView/browser/changesView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import { createFileIconThemableTreeContainerScope } from '../../../../workbench/
import { IActivityService, NumberBadge } from '../../../../workbench/services/activity/common/activity.js';
import { IEditorService, MODAL_GROUP, SIDE_GROUP } from '../../../../workbench/services/editor/common/editorService.js';
import { IExtensionService } from '../../../../workbench/services/extensions/common/extensions.js';
import { ICommandService } from '../../../../platform/commands/common/commands.js';
import { IWorkbenchLayoutService } from '../../../../workbench/services/layout/browser/layoutService.js';
import { ISessionsManagementService } from '../../sessions/browser/sessionsManagementService.js';
import { GITHUB_REMOTE_FILE_SCHEME } from '../../fileTreeView/browser/githubFileSystemProvider.js';
Expand Down Expand Up @@ -254,7 +253,6 @@ export class ChangesViewPane extends ViewPane {
@ISessionsManagementService private readonly sessionManagementService: ISessionsManagementService,
@ILabelService private readonly labelService: ILabelService,
@IStorageService private readonly storageService: IStorageService,
@ICommandService private readonly commandService: ICommandService,
) {
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService);

Expand Down Expand Up @@ -561,18 +559,23 @@ export class ChangesViewPane extends ViewPane {
return files > 0;
}));

// Check if a PR exists when the active session changes
// Set context key for PR state from session metadata
const hasOpenPullRequestKey = scopedContextKeyService.createKey<boolean>('sessions.hasOpenPullRequest', false);
this.renderDisposables.add(autorun(reader => {
const sessionResource = activeSessionResource.read(reader);
sessionsChangedSignal.read(reader);
if (sessionResource) {
const metadata = this.agentSessionsService.getSession(sessionResource)?.metadata;
this.commandService.executeCommand('github.checkOpenPullRequest', sessionResource, metadata).catch(() => { /* ignore */ });
hasOpenPullRequestKey.set(!!metadata?.pullRequestUrl);
} else {
hasOpenPullRequestKey.set(false);
}
}));

this.renderDisposables.add(autorun(reader => {
const { isSessionMenu, added, removed } = topLevelStats.read(reader);
const sessionResource = activeSessionResource.read(reader);
sessionsChangedSignal.read(reader); // Re-evaluate when session metadata changes (e.g. pullRequestUrl)
const menuId = isSessionMenu ? MenuId.ChatEditingSessionChangesToolbar : MenuId.ChatEditingWidgetToolbar;

reader.store.add(scopedInstantiationService.createInstance(
Expand All @@ -581,6 +584,7 @@ export class ChangesViewPane extends ViewPane {
menuId,
{
telemetrySource: 'changesView',
disableWhileRunning: isSessionMenu,
menuOptions: isSessionMenu && sessionResource
? { args: [sessionResource, this.agentSessionsService.getSession(sessionResource)?.metadata] }
: { shouldForwardArgs: true },
Expand All @@ -592,9 +596,6 @@ export class ChangesViewPane extends ViewPane {
);
return { showIcon: true, showLabel: true, isSecondary: true, customClass: 'working-set-diff-stats', customLabel: diffStatsLabel };
}
if (action.id === 'github.createPullRequest' || action.id === 'github.openPullRequest') {
return { showIcon: true, showLabel: true, isSecondary: true };
}
if (action.id === 'chatEditing.synchronizeChanges') {
return { showIcon: true, showLabel: true, isSecondary: true };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
.changes-view-body .chat-editing-session-actions.outside-card .monaco-button {
height: 26px;
padding: 4px 14px;
border-radius: 4px;
font-size: 12px;
line-height: 18px;
}
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions src/vs/sessions/electron-browser/sessions.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,15 @@ export class SessionsMain extends Disposable {
logService: ILogService,
policyService: IPolicyService
): Promise<{ configurationService: ConfigurationService; workspaceContextService: SessionsWorkspaceContextService }> {
const configurationService = new ConfigurationService(userDataProfileService.currentProfile.settingsResource, fileService, policyService, logService);
const workspaceContextService = new SessionsWorkspaceContextService(workspaceIdentifier, uriIdentityService);
const configurationService = new ConfigurationService(userDataProfileService, workspaceContextService, uriIdentityService, fileService, policyService, logService);
try {
await configurationService.initialize();
} catch (error) {
onUnexpectedError(error);
}

const workspaceContextService = new SessionsWorkspaceContextService(workspaceIdentifier, uriIdentityService, configurationService);
workspaceContextService.setConfigurationService(configurationService);
return { configurationService, workspaceContextService };
}

Expand Down
Loading
Loading