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

[siw] Typing into the files to include, exclude fields do not re-trigger the search #9150

Closed
kittaakos opened this issue Mar 4, 2021 · 7 comments · Fixed by #9183
Closed
Labels
bug bugs found in the application search in workspace issues related to the search-in-workspace

Comments

@kittaakos
Copy link
Contributor

Bug Description:

The result in the SIW is not updated when changing the include/exclude fields. I have to press enter to rerun the search. It works from VS Code.

Steps to Reproduce:

Additional Information

  • Operating System:
  • Theia Version:
@kittaakos kittaakos added the bug bugs found in the application label Mar 4, 2021
@vince-fugnitto vince-fugnitto added the search in workspace issues related to the search-in-workspace label Mar 4, 2021
@AbhiSahane0
Copy link

Can I do this project Plz.

@vince-fugnitto
Copy link
Member

Can I do this project Plz.

@AbhiSahane0 please go ahead 👍:

protected renderGlobField(kind: 'include' | 'exclude'): React.ReactNode {
const currentValue = this.searchInWorkspaceOptions[kind];
const value = currentValue && currentValue.join(', ') || '';
return <div className='glob-field'>
<div className='label'>{'files to ' + kind}</div>
<input
className='theia-input'
type='text'
size={1}
defaultValue={value}
id={kind + '-glob-field'}
onKeyUp={e => {
if (e.target) {
if (Key.ENTER.keyCode === e.keyCode) {
this.resultTreeWidget.search(this.searchTerm, this.searchInWorkspaceOptions);
} else {
this.searchInWorkspaceOptions[kind] = this.splitOnComma((e.target as HTMLInputElement).value);
}
}
}}
onFocus={kind === 'include' ? this.handleFocusIncludesInputBox : this.handleFocusExcludesInputBox}
onBlur={kind === 'include' ? this.handleBlurIncludesInputBox : this.handleBlurExcludesInputBox}></input>
</div>;
}

@AbhiSahane0
Copy link

sir what to do with 'onKeyUp={e => { '

@vince-fugnitto
Copy link
Member

sir what to do with 'onKeyUp={e => { '

@AbhiSahane0 you'll likely need to modify this handler when creating the glob fields (include and exclude) so that they search on input rather than wait for an Enter key to be pressed (similarly to the actual search input). The logic to split the input (on commas) should be preserved to support globs.

@AbhiSahane0
Copy link

So, should I remove the if else part so that user directly go for input

@vince-fugnitto
Copy link
Member

So, should I remove the if else part so that user directly go for input

@AbhiSahane0 I believe there is enough information in the issue (including comments) in order to get started on a fix.
I think the best way forward would be to attempt the fix yourself including testing different scenarios and when you provide a pull-request we can guide you through any improvements if necessary.

Remember that we now want to trigger searching when users type into the inputs (similarly to the search) but want to preserve logic that does the comma split to support passing multiple glob patterns (which is already present but needs to be slightly modified).

kittaakos pushed a commit to kittaakos/theia that referenced this issue Mar 11, 2021
Closes eclipse-theia#9150.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@kittaakos
Copy link
Contributor Author

Thank you so much for your assistance, @AbhiSahane0. I really needed the fix, so here is the PR: #9183

Please chime-in and propose any changes if you do not like my approach. Thanks!

kittaakos pushed a commit to kittaakos/theia that referenced this issue Mar 11, 2021
Closes eclipse-theia#9150.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
kittaakos pushed a commit that referenced this issue Mar 12, 2021
Closes #9150.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application search in workspace issues related to the search-in-workspace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants