提交 0bcaf897 编写于 作者: B Benjamin Pasero

debt - search history service should not be a core workbench service

上级 56e81f7c
......@@ -252,6 +252,7 @@
"./vs/workbench/contrib/search/common/replace.ts",
"./vs/workbench/contrib/search/common/search.ts",
"./vs/workbench/contrib/search/common/searchModel.ts",
"./vs/workbench/contrib/search/common/searchHistoryService.ts",
"./vs/workbench/contrib/search/test/browser/mockSearchTree.ts",
"./vs/workbench/contrib/search/test/browser/openFileHandler.test.ts",
"./vs/workbench/contrib/search/test/common/searchModel.test.ts",
......@@ -384,7 +385,6 @@
"./vs/workbench/services/search/common/replace.ts",
"./vs/workbench/services/search/common/search.ts",
"./vs/workbench/services/search/common/searchHelpers.ts",
"./vs/workbench/services/search/common/searchHistoryService.ts",
"./vs/workbench/services/search/node/fileSearch.ts",
"./vs/workbench/services/search/node/fileSearchManager.ts",
"./vs/workbench/services/search/node/rawSearchService.ts",
......
......@@ -54,8 +54,11 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel';
import { ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet';
import { SearchView } from 'vs/workbench/contrib/search/browser/searchView';
import { ISearchHistoryService, SearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService';
registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true);
registerSingleton(ISearchHistoryService, SearchHistoryService, true);
replaceContributions();
searchWidgetContributions();
......
......@@ -27,7 +27,8 @@ import { BaseFolderMatch, FileMatch, FileMatchOrMatch, FolderMatch, Match, Rende
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { ISearchConfiguration, ISearchHistoryService, VIEW_ID } from 'vs/workbench/services/search/common/search';
import { ISearchConfiguration, VIEW_ID } from 'vs/workbench/services/search/common/search';
import { ISearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
export function isSearchViewFocused(viewletService: IViewletService, panelService: IPanelService): boolean {
......
......@@ -34,7 +34,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { TreeResourceNavigator2, WorkbenchObjectTree, getSelectionKeyboardEvent } from 'vs/platform/list/browser/listService';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchConfigurationProperties, ISearchHistoryService, ISearchHistoryValues, ITextQuery, SearchErrorCode, VIEW_ID } from 'vs/workbench/services/search/common/search';
import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchConfigurationProperties, ITextQuery, SearchErrorCode, VIEW_ID } from 'vs/workbench/services/search/common/search';
import { ISearchHistoryService, ISearchHistoryValues } from 'vs/workbench/contrib/search/common/searchHistoryService';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, editorFindMatchHighlight, editorFindMatchHighlightBorder, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
......
......@@ -4,9 +4,26 @@
*--------------------------------------------------------------------------------------------*/
import { Emitter, Event } from 'vs/base/common/event';
import { ISearchHistoryValues, ISearchHistoryService } from 'vs/workbench/services/search/common/search';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { isEmptyObject } from 'vs/base/common/types';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
export interface ISearchHistoryService {
_serviceBrand: any;
onDidClearHistory: Event<void>;
clearHistory(): void;
load(): ISearchHistoryValues;
save(history: ISearchHistoryValues): void;
}
export const ISearchHistoryService = createDecorator<ISearchHistoryService>('searchHistoryService');
export interface ISearchHistoryValues {
search?: string[];
replace?: string[];
include?: string[];
exclude?: string[];
}
export class SearchHistoryService implements ISearchHistoryService {
_serviceBrand: any;
......
......@@ -123,8 +123,7 @@ import { MarkerDecorationsService } from 'vs/editor/common/services/markerDecora
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
import { EditorWorkerServiceImpl } from 'vs/editor/common/services/editorWorkerServiceImpl';
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { ISearchService, ISearchHistoryService } from 'vs/workbench/services/search/common/search';
import { SearchHistoryService } from 'vs/workbench/services/search/common/searchHistoryService';
import { ISearchService } from 'vs/workbench/services/search/common/search';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService';
import { IOpenerService } from 'vs/platform/opener/common/opener';
......@@ -599,9 +598,8 @@ export class Workbench extends Disposable implements IPartService {
// Text Mate
serviceCollection.set(ITextMateService, new SyncDescriptor(TextMateService));
// Search !!
// Search
serviceCollection.set(ISearchService, new SyncDescriptor(SearchService));
serviceCollection.set(ISearchHistoryService, new SyncDescriptor(SearchHistoryService));
// Code Editor
serviceCollection.set(ICodeEditorService, new SyncDescriptor(CodeEditorService, undefined, true));
......
......@@ -5,7 +5,6 @@
import { mapArrayOrNot } from 'vs/base/common/arrays';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Event } from 'vs/base/common/event';
import * as glob from 'vs/base/common/glob';
import { IDisposable } from 'vs/base/common/lifecycle';
import * as objects from 'vs/base/common/objects';
......@@ -17,7 +16,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
export const VIEW_ID = 'workbench.view.search';
export const ISearchHistoryService = createDecorator<ISearchHistoryService>('searchHistoryService');
export const ISearchService = createDecorator<ISearchService>('searchService');
/**
......@@ -31,21 +29,6 @@ export interface ISearchService {
registerSearchResultProvider(scheme: string, type: SearchProviderType, provider: ISearchResultProvider): IDisposable;
}
export interface ISearchHistoryValues {
search?: string[];
replace?: string[];
include?: string[];
exclude?: string[];
}
export interface ISearchHistoryService {
_serviceBrand: any;
onDidClearHistory: Event<void>;
clearHistory(): void;
load(): ISearchHistoryValues;
save(history: ISearchHistoryValues): void;
}
/**
* TODO@roblou - split text from file search entirely, or share code in a more natural way.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册