Skip to content

Commit dbb9d7e

Browse files
authored
Assistant: enable positron assistant git integration by default (#9073)
### Summary - addresses #9066 - sets the default for `positron.assistant.gitIntegration.enable` to true and removes the experimental tag, but keeps the flag for now - disables the `Source Control...` context item on Web due to #9181 ### Release Notes #### New Features - Assistant: git integration Assistant tools available by default (#9066) ### QA Notes See this PR for usage: #8257 #### Git features enabled by default! - `positron.assistant.gitIntegration.enable` setting still available in the settings UI but is now enabled by default #### `Source Control...` context option disabled by default for Web/Workbench - On Web / Workbench, the `Source Control...` context option should be missing: <img width="672" height="211" alt="image" src="https://github.com/user-attachments/assets/b3d9202c-0e55-4ea4-906c-71b327d7367a" /> - On Desktop, it should be available (some extra options because of my clipboard and editor state): <img width="607" height="279" alt="image" src="https://github.com/user-attachments/assets/2103b951-14f0-4c31-9eae-ddc1caeda48f" /> #### `positron.assistant.gitIntegration.enable` setting can be used to make `Source Control...` context option available on Web/Workbench - Add `"positron.assistant.sourceControlHistoryContext.enable": true` to the settings JSON in a web build to enable the `Source Control...` context option (helpful for debugging)
1 parent cbd1200 commit dbb9d7e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

extensions/positron-assistant/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,8 @@
221221
},
222222
"positron.assistant.gitIntegration.enable": {
223223
"type": "boolean",
224-
"default": false,
225-
"description": "%configuration.gitIntegration.description%",
226-
"tags": [
227-
"experimental"
228-
]
224+
"default": true,
225+
"description": "%configuration.gitIntegration.description%"
229226
},
230227
"positron.assistant.showTokenUsage.enable": {
231228
"type": "boolean",

src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ import { ScmHistoryItemResolver } from '../../multiDiffEditor/browser/scmMultiDi
2828
import { ISCMHistoryItem } from '../common/history.js';
2929
import { ISCMProvider, ISCMService, ISCMViewService } from '../common/scm.js';
3030

31+
// --- Start Positron ---
32+
import { isWeb } from '../../../../base/common/platform.js';
33+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
34+
// --- End Positron ---
35+
3136
export interface SCMHistoryItemTransferData {
3237
readonly name: string;
3338
readonly resource: UriComponents;
@@ -90,12 +95,25 @@ class SCMHistoryItemContext implements IChatContextPickerItem {
9095
}
9196

9297
constructor(
98+
// --- Start Positron ---
99+
@IConfigurationService private readonly _configurationService: IConfigurationService,
100+
// --- End Positron ---
93101
@ISCMViewService private readonly _scmViewService: ISCMViewService
94102
) { }
95103

96104
isEnabled(_widget: IChatWidget): Promise<boolean> | boolean {
97105
const activeRepository = this._scmViewService.activeRepository.get();
106+
// --- Start Positron ---
107+
// Disable SCM History Chat Context in Positron Web due to path error
108+
// See https://github.com/posit-dev/positron/issues/9181
109+
const schContextEnabled = this._configurationService.getValue<boolean>('positron.assistant.sourceControlHistoryContext.enable');
110+
// if schContextEnabled is configured, follow the config to enable/disable scm history context
111+
// if schContextEnabled is undefined, enable scm history context on desktop, but disable on web
112+
return activeRepository?.provider.historyProvider.get() !== undefined && (schContextEnabled ?? !isWeb);
113+
/*
98114
return activeRepository?.provider.historyProvider.get() !== undefined;
115+
*/
116+
// --- End Positron ---
99117
}
100118

101119
asPicker(_widget: IChatWidget) {

0 commit comments

Comments
 (0)