-
Notifications
You must be signed in to change notification settings - Fork 2.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
[file-search] Fixed Windows file search inconsistencies #6029
[file-search] Fixed Windows file search inconsistencies #6029
Conversation
@mcgordonite please see the failing CI test on windows. |
I am reviewing it. |
@@ -54,7 +54,7 @@ describe('search-service', function (): void { | |||
expect(testFile).to.be.not.undefined; | |||
}); | |||
|
|||
it.skip('shall respect nested .gitignore', async () => { | |||
it('shall respect nested .gitignore', async () => { |
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.
Please revert. It does not work.
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.
Reverted.
I had thought this test was fixed because it worked on both my linux and windows machines, but it's still failing on appveyor.
I have verified the behavior on Windows, it worked and was in sync with VS Code. Strange, that on Windows, the |
- On Windows, `FileSearchService`.find now returns valid file URIs as it already did on linux. - Use LabelProvider to create tooltip field for quick open entries. - Allow Windows users to search for file paths using either '/' or '\\'. This makes the search UI consistent across platorms. Signed-off-by: Matthew Gordon <matthew.gordon@arm.com>
@kittaakos thanks for the review!
I think this behaviour is consistent with other Theia behaviour on Windows: Theia displays relative paths with forward slash throughout the UI (e.g. SCM changes view, search results). It would be confusing if they couldn't use the same separator when searching. |
@@ -25,7 +25,7 @@ export interface FileSearchService { | |||
|
|||
/** | |||
* finds files by a given search pattern. | |||
* @return the matching paths, relative to the given `options.rootUri`. | |||
* @return the matching file uris |
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.
<3
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.
Initially, I have checked the changes on my Windows 10 image, it worked as expected. I did another verification on Linux (Gitpod). The behavior is in sync with VS Code, in fact, VS Code throws an error if I search for ////
, Theia does not. 😎
Thank you for your help, @mcgordonite!
What it does
Before:
Note:
After:
Linux (for comparison):
Also, allow Windows users to use both forwards or back slashes as path separators (same behaviour as VS code).
Fixes #1591
How to test
Review checklist
Reminder for reviewers