mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
Allow users to control find scopes
This commit is contained in:
parent
1f02a97e06
commit
e5a432ba0b
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -125,9 +125,5 @@
|
|||
],
|
||||
"application.experimental.rendererProfiling": true,
|
||||
"editor.experimental.asyncTokenization": true,
|
||||
"editor.experimental.asyncTokenizationVerification": true,
|
||||
"notebook.experimental.findInMarkdownMode": {
|
||||
"source": true,
|
||||
"preview": true
|
||||
}
|
||||
"editor.experimental.asyncTokenizationVerification": true
|
||||
}
|
||||
|
|
|
@ -306,9 +306,14 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
|||
) {
|
||||
super();
|
||||
|
||||
const findInMarkdownMode = this._configurationService.getValue<{ source: boolean; preview: boolean }>(NotebookSetting.experimentalFindInMarkdownMode) ?? { source: true, preview: false };
|
||||
const findScope = this._configurationService.getValue<{
|
||||
markupSource: boolean;
|
||||
markupPreview: boolean;
|
||||
codeSource: boolean;
|
||||
codeOutput: boolean;
|
||||
}>(NotebookSetting.findScope) ?? { markupSource: true, markupPreview: true, codeSource: true, codeOutput: true };
|
||||
|
||||
this._filters = new NotebookFindFilters(findInMarkdownMode.source, findInMarkdownMode.preview, true, true);
|
||||
this._filters = new NotebookFindFilters(findScope.markupSource, findScope.markupPreview, findScope.codeSource, findScope.codeOutput);
|
||||
this._state.change({ filters: this._filters }, false);
|
||||
|
||||
this._filters.onDidChange(() => {
|
||||
|
|
|
@ -917,22 +917,32 @@ configurationRegistry.registerConfiguration({
|
|||
type: 'boolean',
|
||||
default: true
|
||||
},
|
||||
[NotebookSetting.experimentalFindInMarkdownMode]: {
|
||||
markdownDescription: nls.localize('notebook.experimental.findInMarkdownMode', "Customize the Find Widget behavior for searching within markdown cells. When both are enabled, the Find Widget will search either the content or preview based on the current state of the markdown cell. Toggle the boolean values to control the Find Widget's scope for each mode as needed."),
|
||||
[NotebookSetting.findScope]: {
|
||||
markdownDescription: nls.localize('notebook.findScope', "Customize the Find Widget behavior for searching within notebook cells. When both markup source and markup preview are enabled, the Find Widget will search either the source code or preview based on the current state of the cell."),
|
||||
type: 'object',
|
||||
properties: {
|
||||
source: {
|
||||
markupSource: {
|
||||
type: 'boolean',
|
||||
default: true
|
||||
},
|
||||
preview: {
|
||||
markupPreview: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
default: true
|
||||
},
|
||||
codeSource: {
|
||||
type: 'boolean',
|
||||
default: true
|
||||
},
|
||||
codeOutput: {
|
||||
type: 'boolean',
|
||||
default: true
|
||||
}
|
||||
},
|
||||
default: {
|
||||
source: true,
|
||||
preview: false
|
||||
markupSource: true,
|
||||
markupPreview: true,
|
||||
codeSource: true,
|
||||
codeOutput: true
|
||||
},
|
||||
tags: ['notebookLayout']
|
||||
}
|
||||
|
|
|
@ -944,7 +944,7 @@ export const NotebookSetting = {
|
|||
outputFontSize: 'notebook.output.fontSize',
|
||||
outputFontFamilyDeprecated: 'notebook.outputFontFamily',
|
||||
outputFontFamily: 'notebook.output.fontFamily',
|
||||
experimentalFindInMarkdownMode: 'notebook.experimental.findInMarkdownMode',
|
||||
findScope: 'notebook.find.scope',
|
||||
logging: 'notebook.logging',
|
||||
confirmDeleteRunningCell: 'notebook.confirmDeleteRunningCell',
|
||||
} as const;
|
||||
|
|
Loading…
Reference in a new issue