-
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
quick palette fixes #4549
quick palette fixes #4549
Conversation
This is what i get from the Feb 26 build And this patch: As you can tell from the GIFs, when I searched Not sure if it is caused by the change in this PR. |
I can confirm, I noticed the same thing @elaihau mentioned. |
@elaihau @vince-fugnitto could you double check, i get on master: @elaihau Could be that you confused one with another? Your search also looks different, it seems that in one case you pressed quick file twice to enable ignored files and another once. Please press once. |
It's the same on master, please open a separate issue. |
@elaihau strange and you don't have any custom user settings? |
not sure. could you please give me a couple of examples of "user settings" ? |
I meant just in |
I don't have search-related prefs in my settings.json:
I just tested this change in my local env. and everything looks working. |
If you trigger file search once you should not see files filtered by .gitignore but you have them on your gifs. It does not look working. |
if i am not mistaken, the |
@akosyakov I see the problems from I noticed one thing however, do you believe this is a bug from your PR? Searching for workspace: Searching for workspace-: As you can see when searching for |
@elaihau ok, it seems with Gitpod OS, it works a bit better and manages to filter out some ignored files Anyway, i did not change code around it. It's fixing following issues reproduciable on master: The issue with (2) is that we match against /workSpace/tHEia/Logo/theia-Logo.svg, but should only against With this PR you should not be able to reproduce these issues. |
@vince-fugnitto i think it is all because of #1588. you should not see anything from |
And I also have feeling that it got broken at some point, or we just all so get used to it. |
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.
what i am getting from my local env (ubuntu 16 + chrome + example browser) looks good.
however when i tested on gitpod it gives me some irrelavent stuffs (e.g., package.json and readme.md) when i search "work". Also, like @vince-fugnitto described, some results from searching workspace-
do not show up on the search of workspace
.
Ok, will give one more round maybe can improve it a bit more. |
describe('irrelevant absolute results', () => { | ||
const rootUri = FileUri.create(path.resolve(__dirname, '../../../../..')); | ||
|
||
it('not fuzzy', 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.
here is a repro for the bogus workspace
search results.
const rootUri = FileUri.create(path.resolve(__dirname, '../../../..'));
it.only('not fuzzy', async () => {
const searchPattern = rootUri.path.dir.base;
const matches = await service.find(searchPattern, { rootUris: [rootUri.toString()], fuzzyMatch: false, useGitIgnore: true, limit: 200 });
for (const match of matches) {
const relativUri = rootUri.relative(new URI(match));
if (relativUri) {
const relativMatch = relativUri.toString();
assert.notEqual(relativMatch.indexOf(searchPattern), -1, relativMatch);
}
}
});
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.
@elaihau, ☝️ the workspace
search pattern is in the path of the bogus search results.
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.
it.only
nice feature, did not know it :)
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.
just don't forget to remove it ;-)
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.
It's because of glob search: https://github.com/theia-ide/theia/blob/8235400c78af8eb46ef5523ae1a635ec9761a0c3/packages/file-search/src/node/file-search-service-impl.ts#L93-L94
@elaihau @vince-fugnitto @AlexTugarev do you have an idea why we do it in addition to fuzzy search?
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.
ah, I see it is for vscode extension, i don't think API was modeled properly, there should be a new explicit option for included globs and it should not affect quick file
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.
@akosyakov this is one example: https://github.com/Microsoft/vscode/blob/master/extensions/npm/src/tasks.ts#L101
npm uses the service to find all packages.json
, excluding those from node_modules
.
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.
there are a few examples tested here as well:
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.
there should be a new explicit option for included globs and it should not affect quick file
i was thinking about the same thing. but after seeing this interface i chose to support the string match & glob match from the same function without having that option. https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/services/search/common/search.ts#L79
export interface IFileQueryProps<U extends UriComponents> extends ICommonQueryProps<U> {
type: QueryType.File;
filePattern?: string;
/**
* If true no results will be returned. Instead `limitHit` will indicate if at least one result exists or not.
* Currently does not work with queries including a 'siblings clause'.
*/
exists?: boolean;
sortByScore?: boolean;
cacheKey?: string;
}
maybe you are right, with the new option defined we would have finer grained control over what the service does.
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.
@elaihau yes, searchPattern
and includePatterns
are not the same, i've separated them
@elaihau @vince-fugnitto @AlexTugarev please try again VS Code API client also should be tested, what do you expect from npm extension? |
the builds are failing, and so is the prebuilt gitpod workspace 😞 |
@vince-fugnitto should be good now |
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
…4537 Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
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.
Thanks so much for fixing this! 💯
@akosyakov sorry I just got a chance to check it now, its still early morning in Montreal 😄 On Gitpod I noticed that everything was fine, however locally I noticed irregularities. It might be something to look into. |
@vince-fugnitto please file an issue, this PR does not touch recently opened at all, but you are right it is worth to look into as well |
I was able to reproduce in Gitpod as well. |
@elaihau is it good for VS Code extension? Could you verify please? |
testing right now |
i am getting the following errors in browser:
i will see if i can find where it went wrong |
line 174 of workspace-main.ts is where it failed. the function call didn't reach the file-search-service, and stopped in the plugin-ext if (theiaToken) {
theiaToken.onCancellationRequested(() => source.cancel());
}
|
@elaihau good, please describe which extension do you install and what you do |
maxResults?: number, token?: theia.CancellationToken): Promise<UriComponents[]> { | ||
const opts: FileSearchService.Options = { rootUris: this.roots.map(r => r.uri) }; | ||
async $startFileSearch(includePattern: string, includeFolderUri: string | undefined, excludePatternOrDisregardExcludes?: string | false, | ||
maxResults?: number, theiaToken?: theia.CancellationToken): Promise<UriComponents[]> { |
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.
@benoitf @evidolob Is cancellation hooked into plugin RCP? from #4549 (comment) it looks like not. Is there another way to cancel?
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.
fyi, this is what vscode does from the extension host:
if (token && token.isCancellationRequested) {
return Promise.resolve([]);
}
return this._proxy.$startFileSearch(includePattern, includeFolder, excludePatternOrDisregardExcludes, maxResults, token)
.then(data => Array.isArray(data) ? data.map(URI.revive) : []);
code is from extHostWorkspace.ts
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.
i know, but it does not seem to work in Theia, i would need to check
…h root Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@elaihau i've removed cancellation, plugin RCP does not seem to support it, could you try again please |
i installed grunt and npm. what i did was run command "run tasks" from the single root workspace where gulp tasks and npm scripts are defined. i tested again. with the latest change everything from my side worked fine. Thank you ! |
fix #4537
See #4549 (comment) for how to reproduce.