Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Tab and Escape work when focus is in the preview #236685

Merged
merged 4 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
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
Next Next commit
Add the possibility to define context keys on CodeEditorWidgets
  • Loading branch information
alexdima committed Dec 20, 2024
commit 91ced52bc8547ce1c21138ee4a6a5061cf995c92
11 changes: 11 additions & 0 deletions src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}));

this._contextKeyService = this._register(contextKeyService.createScoped(this._domElement));
if (codeEditorWidgetOptions.contextKeyValues) {
for (const [key, value] of Object.entries(codeEditorWidgetOptions.contextKeyValues)) {
this._contextKeyService.createKey(key, value);
}
}
this._notificationService = notificationService;
this._codeEditorService = codeEditorService;
this._commandService = commandService;
Expand Down Expand Up @@ -1988,6 +1993,12 @@ export interface ICodeEditorWidgetOptions {
* Defaults to MenuId.SimpleEditorContext or MenuId.EditorContext depending on whether the widget is simple.
*/
contextMenuId?: MenuId;

/**
* Define extra context keys that will be defined in the context service
* for the editor.
*/
contextKeyValues?: Record<string, ContextKeyValue>;
}

class ModelData {
Expand Down