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

Support for output search #7258

Merged
merged 33 commits into from Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c68f089
Support for output search
Sep 23, 2019
9bd3d9c
rebase; fixed yarn.lock
telamonian Oct 28, 2019
4133440
replace `lodash` with `@phosphor/algorithm`
telamonian Oct 28, 2019
1e756bb
removed unneeded typing
telamonian Oct 28, 2019
b5d3f96
Fix issue with saving modified nodes
Oct 28, 2019
be2aee8
fixed typeerror
telamonian Nov 13, 2019
dbe4924
Add filter on search to only search input or output
Nov 19, 2019
c099641
Merge origin/master into pr/mlucool/7258
saulshanabrook Dec 9, 2019
5cebdf8
Dev mode update
saulshanabrook Dec 9, 2019
18e7d62
phosphor -> lumino
saulshanabrook Dec 9, 2019
6d78fb2
Remove unneeded tsingore
saulshanabrook Dec 9, 2019
114ccb3
Move filter button to replace line when able
saulshanabrook Dec 9, 2019
741dbfb
Keep buttons in the same place as you expand
saulshanabrook Dec 9, 2019
1db831c
Space properly on dropdown
saulshanabrook Dec 10, 2019
d7f5d9d
Switch to ellepsis button
saulshanabrook Dec 10, 2019
932ea3f
Move filters to bottom
saulshanabrook Dec 10, 2019
423bb11
Search input by default
saulshanabrook Dec 10, 2019
87df382
Only show outputs toggle in notebook
saulshanabrook Dec 11, 2019
e60f5bb
Add basic styling for search options
saulshanabrook Dec 11, 2019
77031d6
Only show filter in notebook and disable when find and replace
saulshanabrook Dec 12, 2019
6fe4f0b
Remove search options header
saulshanabrook Dec 12, 2019
1f7313e
Make text label for checkbox
saulshanabrook Dec 12, 2019
4b361ba
Make search options grey if disabled
saulshanabrook Dec 12, 2019
fbf01c2
Switch to ui color 3
saulshanabrook Dec 12, 2019
84b2516
Switch back (wrong component)
saulshanabrook Dec 12, 2019
a670f86
Show if search options are enabled
saulshanabrook Dec 12, 2019
8f14628
Merge origin/master into pr/mlucool/7258
saulshanabrook Dec 12, 2019
c324faa
Yarn lock updates
saulshanabrook Dec 12, 2019
b4a2232
Make typings more strict
saulshanabrook Dec 12, 2019
848bf2a
added hover characteristics to some buttons
tgeorgeux Dec 12, 2019
bbaef99
Merge remote-tracking branch 'origin/master' into pr/mlucool/7258
saulshanabrook Dec 23, 2019
c7fec0e
Integrity update
saulshanabrook Dec 24, 2019
ee1f1d0
Fix null checks
saulshanabrook Dec 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/documentsearch/package.json
Expand Up @@ -38,6 +38,7 @@
"@jupyterlab/codemirror": "^2.0.0-alpha.4",
"@jupyterlab/fileeditor": "^2.0.0-alpha.4",
"@jupyterlab/notebook": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/polling": "^1.0.1",
Expand Down
27 changes: 26 additions & 1 deletion packages/documentsearch/src/interfaces.ts
Expand Up @@ -4,6 +4,10 @@
import { ISignal } from '@lumino/signaling';
import { Widget } from '@lumino/widgets';

export interface IFiltersType {
output: boolean;
}

export interface IDisplayState {
/**
* The index of the currently selected match
Expand Down Expand Up @@ -64,6 +68,16 @@ export interface IDisplayState {
* Whether or not the replace entry row is visible
*/
replaceEntryShown: boolean;

/**
* What should we include when we search?
*/
filters: IFiltersType;

/**
* Is the filters view open?
*/
filtersOpen: boolean;
}

export interface ISearchMatch {
Expand Down Expand Up @@ -123,10 +137,15 @@ export interface ISearchProvider<T extends Widget = Widget> {
*
* @param query A RegExp to be use to perform the search
* @param searchTarget The widget to be searched
* @param filters Filter parameters to pass to provider
*
* @returns A promise that resolves with a list of all matches
*/
startQuery(query: RegExp, searchTarget: T): Promise<ISearchMatch[]>;
startQuery(
query: RegExp,
searchTarget: T,
filters: IFiltersType
): Promise<ISearchMatch[]>;

/**
* Clears state of a search provider to prepare for startQuery to be called
Expand Down Expand Up @@ -194,4 +213,10 @@ export interface ISearchProvider<T extends Widget = Widget> {
* the replace option.
*/
readonly isReadOnly: boolean;

/**
* Set to true if the widget under search has outputs to search.
* Defaults to false.
*/
readonly hasOutputs?: boolean;
}
Expand Up @@ -69,12 +69,14 @@ export class CodeMirrorSearchProvider
*
* @param query A RegExp to be use to perform the search
* @param searchTarget The widget to be searched
* @param [filters={}] Filter parameters to pass to provider
*
* @returns A promise that resolves with a list of all matches
*/
async startQuery(
query: RegExp,
searchTarget: Widget
searchTarget: Widget,
filters = {}
): Promise<ISearchMatch[]> {
if (!CodeMirrorSearchProvider.canSearchOn(searchTarget)) {
throw new Error('Cannot find Codemirror instance to search');
Expand Down Expand Up @@ -298,6 +300,9 @@ export class CodeMirrorSearchProvider
return undefined;
}

get editor(): CodeMirrorEditor {
return this._cm;
}
/**
* Set whether or not the CodemirrorSearchProvider will wrap to the beginning
* or end of the document on invocations of highlightNext or highlightPrevious, respectively
Expand Down