Skip to content

Commit

Permalink
EH Search - File search working with cache, sorting, filtering, all i…
Browse files Browse the repository at this point in the history
…n EH
  • Loading branch information
roblourens committed May 11, 2018
1 parent a84db4a commit 0825cd4
Show file tree
Hide file tree
Showing 5 changed files with 810 additions and 53 deletions.
9 changes: 8 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "Attach to Extension Host",
"protocol": "inspector",
"port": 5870,
"restart": true,
// "restart": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]
Expand Down Expand Up @@ -250,6 +250,13 @@
"Launch VS Code",
"Attach to Search Process"
]
},
{
"name": "Renderer and Extension Host processes",
"configurations": [
"Launch VS Code",
"Attach to Extension Host"
]
}
]
}
3 changes: 2 additions & 1 deletion src/vs/platform/search/common/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface ICommonQueryOptions<U> {
disregardIgnoreFiles?: boolean;
disregardExcludeSettings?: boolean;
ignoreSymlinks?: boolean;
maxFileSize?: number;
}

export interface IQueryOptions extends ICommonQueryOptions<uri> {
Expand Down Expand Up @@ -108,7 +109,7 @@ export interface IFileMatch<U extends UriComponents = uri> {
lineMatches?: ILineMatch[];
}

export type IRawFileMatch = IFileMatch<UriComponents>;
export type IRawFileMatch2 = IFileMatch<UriComponents>;

export interface ILineMatch {
preview: string;
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/electron-browser/mainThreadSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { values } from 'vs/base/common/map';
import URI, { UriComponents } from 'vs/base/common/uri';
import { PPromise, TPromise } from 'vs/base/common/winjs.base';
import { IFileMatch, ISearchComplete, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, QueryType, IRawFileMatch } from 'vs/platform/search/common/search';
import { IFileMatch, ISearchComplete, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, QueryType, IRawFileMatch2 } from 'vs/platform/search/common/search';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { ExtHostContext, ExtHostSearchShape, IExtHostContext, MainContext, MainThreadSearchShape } from '../node/extHost.protocol';

Expand Down Expand Up @@ -40,7 +40,7 @@ export class MainThreadSearch implements MainThreadSearchShape {
this._searchProvider.delete(handle);
}

$handleFindMatch(handle: number, session, data: UriComponents | IRawFileMatch[]): void {
$handleFindMatch(handle: number, session, data: UriComponents | IRawFileMatch2[]): void {
this._searchProvider.get(handle).handleFindMatch(session, data);
}
}
Expand Down Expand Up @@ -125,7 +125,7 @@ class RemoteSearchProvider implements ISearchResultProvider {
});
}

handleFindMatch(session: number, dataOrUri: UriComponents | IRawFileMatch[]): void {
handleFindMatch(session: number, dataOrUri: UriComponents | IRawFileMatch2[]): void {
if (!this._searches.has(session)) {
// ignore...
return;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/node/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { IStat, FileChangeType, IWatchOptions, FileSystemProviderCapabilities, F
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { CommentRule, CharacterPair, EnterAction } from 'vs/editor/common/modes/languageConfiguration';
import { ISingleEditOperation } from 'vs/editor/common/model';
import { IPatternInfo, IRawSearchQuery, IRawFileMatch } from 'vs/platform/search/common/search';
import { IPatternInfo, IRawSearchQuery, IRawFileMatch2 } from 'vs/platform/search/common/search';
import { LogLevel } from 'vs/platform/log/common/log';
import { TaskExecutionDTO, TaskDTO, TaskHandleDTO, TaskFilterDTO } from 'vs/workbench/api/shared/tasks';

Expand Down Expand Up @@ -404,7 +404,7 @@ export interface MainThreadFileSystemShape extends IDisposable {
export interface MainThreadSearchShape extends IDisposable {
$registerSearchProvider(handle: number, scheme: string): void;
$unregisterProvider(handle: number): void;
$handleFindMatch(handle: number, session: number, data: UriComponents | IRawFileMatch[]): void;
$handleFindMatch(handle: number, session: number, data: UriComponents | IRawFileMatch2[]): void;
}

export interface MainThreadTaskShape extends IDisposable {
Expand Down
Loading

0 comments on commit 0825cd4

Please sign in to comment.