-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Code] connect the modify search settings button with the search scope settings #33691
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| */ | ||
|
|
||
| import { debounce, isEqual } from 'lodash'; | ||
| import React, { Component } from 'react'; | ||
| import React, { Component, RefObject } from 'react'; | ||
|
|
||
| import { SearchOptions as ISearchOptions } from '../../../actions'; | ||
| import { matchPairs } from '../lib/match_pairs'; | ||
|
|
@@ -109,6 +109,8 @@ export class CodeQueryBar extends Component<Props, State> { | |
|
|
||
| public inputRef: HTMLInputElement | null = null; | ||
|
|
||
| public optionFlyout: any | null = null; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems not right |
||
|
|
||
| private componentIsUnmounting = false; | ||
|
|
||
| public isDirty = () => { | ||
|
|
@@ -384,6 +386,12 @@ export class CodeQueryBar extends Component<Props, State> { | |
| } | ||
| } | ||
|
|
||
| public toggleOptionsFlyout() { | ||
| if (this.optionFlyout) { | ||
| this.optionFlyout.toggleOptionsFlyout(); | ||
| } | ||
| } | ||
|
|
||
| public render() { | ||
| const inputRef = (node: HTMLInputElement | null) => { | ||
| if (node) { | ||
|
|
@@ -442,6 +450,7 @@ export class CodeQueryBar extends Component<Props, State> { | |
| repoSearchResults={this.props.repoSearchResults} | ||
| searchLoading={this.props.searchLoading} | ||
| searchOptions={this.props.searchOptions} | ||
| ref={element => (this.optionFlyout = element)} | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,9 @@ class SearchPage extends React.PureComponent<Props, State> { | |
| public state = { | ||
| uri: '', | ||
| }; | ||
|
|
||
| public searchBar: any | null = null; | ||
|
||
|
|
||
| public componentDidMount() { | ||
| chrome.breadcrumbs.push({ text: `Search` }); | ||
| } | ||
|
|
@@ -142,7 +145,14 @@ class SearchPage extends React.PureComponent<Props, State> { | |
| repositorySearchResults, | ||
| } = this.props; | ||
|
|
||
| let mainComp = <EmptyPlaceholder query={query} />; | ||
| let mainComp = ( | ||
| <EmptyPlaceholder | ||
| query={query} | ||
| toggleOptionsFlyout={() => { | ||
| this.searchBar.toggleOptionsFlyout(); | ||
| }} | ||
| /> | ||
| ); | ||
| let repoStats: any[] = []; | ||
| let languageStats: any[] = []; | ||
| if ( | ||
|
|
@@ -227,6 +237,7 @@ class SearchPage extends React.PureComponent<Props, State> { | |
| repoScope={this.props.searchOptions.repoScope.map(r => r.uri)} | ||
| query={this.props.query} | ||
| onSearchScopeChanged={this.props.onSearchScopeChanged} | ||
| ref={element => (this.searchBar = element)} | ||
| /> | ||
| {mainComp} | ||
| </EuiFlexItem> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,7 +180,7 @@ export class LspIndexer extends AbstractIndexer { | |
| reference: this.options.enableGlobalReference, | ||
| }); | ||
|
|
||
| if (response && response.result.length > 0) { | ||
| if (response && response.result.length > 0 && response.result[0]) { | ||
|
||
| const { symbols, references } = response.result[0]; | ||
| for (const symbol of symbols) { | ||
| await this.batchIndexHelper.index(SymbolIndexName(repoUri), symbol); | ||
|
|
||
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.
unused import