Skip to content

Commit

Permalink
Support for output search
Browse files Browse the repository at this point in the history
This is the first pass at search which can search output in a generic
way. This commit does this on a best effort through walking and
manipulating the DOM. There are limitations, including the inability to
handle that to a user <span><b>foo</b>bar</span> should be searched as
foobar. This also will not handle SVGs and does not expose a way to
delegate search to output presenters. Still, this works very well on
stdout/stderr type messages, tables, etc.

Fixes: #6768
  • Loading branch information
Marc Udoff committed Oct 8, 2019
1 parent d427440 commit 3536693
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 1,741 deletions.
1 change: 1 addition & 0 deletions packages/documentsearch/package.json
Expand Up @@ -44,6 +44,7 @@
"@phosphor/signaling": "^1.3.0",
"@phosphor/widgets": "^1.9.0",
"codemirror": "~5.47.0",
"lodash": "~4.17.15",
"react": "~16.8.4"
},
"devDependencies": {
Expand Down
Expand Up @@ -83,8 +83,6 @@ export class CodeMirrorSearchProvider
// canSearchOn is a type guard that guarantees the type of .editor
this._cm = searchTarget.content.editor;
return this._startQuery(query);

throw new Error('Cannot find Codemirror instance to search');
}

/**
Expand Down Expand Up @@ -300,6 +298,9 @@ export class CodeMirrorSearchProvider
return null;
}

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

0 comments on commit 3536693

Please sign in to comment.