@@ -64,6 +64,7 @@ import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/
64
64
import { IMarkdownVulnerability } from '../common/annotations' ;
65
65
import { ResourceLabel } from 'vs/workbench/browser/labels' ;
66
66
import { FileKind } from 'vs/platform/files/common/files' ;
67
+ import { ResourceContextKey } from 'vs/workbench/common/contextkeys' ;
67
68
68
69
const $ = dom . $ ;
69
70
@@ -146,6 +147,8 @@ export class CodeBlockPart extends Disposable {
146
147
private readonly disposableStore = this . _register ( new DisposableStore ( ) ) ;
147
148
private isDisposed = false ;
148
149
150
+ private resourceContextKey : ResourceContextKey ;
151
+
149
152
constructor (
150
153
private readonly options : ChatEditorOptions ,
151
154
readonly menuId : MenuId ,
@@ -160,6 +163,7 @@ export class CodeBlockPart extends Disposable {
160
163
super ( ) ;
161
164
this . element = $ ( '.interactive-result-code-block' ) ;
162
165
166
+ this . resourceContextKey = this . _register ( instantiationService . createInstance ( ResourceContextKey ) ) ;
163
167
this . contextKeyService = this . _register ( contextKeyService . createScoped ( this . element ) ) ;
164
168
const scopedInstantiationService = this . _register ( instantiationService . createChild ( new ServiceCollection ( [ IContextKeyService , this . contextKeyService ] ) ) ) ;
165
169
const editorElement = dom . append ( this . element , $ ( '.interactive-result-editor' ) ) ;
@@ -413,6 +417,7 @@ export class CodeBlockPart extends Disposable {
413
417
element : data . element ,
414
418
languageId : textModel . getLanguageId ( )
415
419
} satisfies ICodeBlockActionContext ;
420
+ this . resourceContextKey . set ( textModel . uri ) ;
416
421
}
417
422
418
423
private getVulnerabilitiesLabel ( ) : string {
0 commit comments