-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Add ability to search in notebook inputs (under experimental flag) #167952
Conversation
@@ -666,7 +666,7 @@ export interface INotebookEditor { | |||
getNextVisibleCellIndex(index: number): number | undefined; | |||
getPreviousVisibleCellIndex(index: number): number | undefined; | |||
find(query: string, options: INotebookSearchOptions, token: CancellationToken): Promise<CellFindMatchWithIndex[]>; | |||
highlightFind(cell: ICellViewModel, matchIndex: number): Promise<number>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this argument wasn't be used by the implementation
src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
Outdated
Show resolved
Hide resolved
notes about this PR:
|
src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make sure that extractSelectionLine
doesn't run unless requested.
src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts
Outdated
Show resolved
Hide resolved
@@ -268,21 +312,6 @@ suite('SearchResult', () => { | |||
assert.deepStrictEqual([{ elements: arrayToRemove, removed: true }], target.args[0]); | |||
}); | |||
|
|||
test('remove triggers change event', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a repeat test of a test with the same name above.
@@ -124,6 +124,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD | |||
readonly onDidChangeCellState = this._onDidChangeCellState.event; | |||
private readonly _onDidChangeViewCells = this._register(new Emitter<INotebookViewCellsUpdateEvent>()); | |||
readonly onDidChangeViewCells: Event<INotebookViewCellsUpdateEvent> = this._onDidChangeViewCells.event; | |||
private readonly _onWillChangeModel = this._register(new Emitter<NotebookTextModel | undefined>()); | |||
readonly onWillChangeModel: Event<NotebookTextModel | undefined> = this._onWillChangeModel.event; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing where this is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used here
widget.onWillChangeModel( |
if (e.resource.scheme === network.Schemas.vscodeNotebookCell) { | ||
const notebookResource = CellUri.parse(e.resource)?.notebook; | ||
if (notebookResource) { | ||
return this.editorService.save([...this.editorService.findEditors(notebookResource)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should be doing this at the model level as well like for text files? I don't know which service would do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that saving the text models happened here
return this.textFileService.files.get(e.resource)?.save({ source: ReplaceService.REPLACE_SAVE_SOURCE }); |
Affects #164926