Feat/search in books (#11117)

* clean up unsavedBooks to providedBooks

* added notebooks viewley contribution

* added notebookExporerAction context

* temp shortcut key B

* remove commenred code

* changes with master merge

* fix comments

* initial tests

* fix casing and description

* merged master and resolved errors

* initial commit

* search view changes

* remove extension point & add custom view container

* merge latest from master

* remove unused files

* move book images to common

* remove notebookExplorer contrib & move to notebook

* build fix

* remove explorer specific sryles from common

* vscode convention to define container actions

* rename notebooks/title

* show collapsible search view separately

* style changes

* rename method

* code cleanup

* enable search on type

* merged master and resolved compile errors

* highlight fix

* code cleanup

* rename interface

* fix hygiene floating promises errors

* more hygiene errors

* avoid circular dependency

* new ids for notebookSearch actions

* reuse SearchSortOrder from search

* merged main and resolved compile errors

* reuse search code

* vscode merge regression on highlight

* extend searchView

* missed resoved files

* null to undefined

* make treeView readonly

* revert carbon edit

* address PR comments

* convert async
This commit is contained in:
Maddy
2020-07-09 13:13:36 -07:00
committed by GitHub
parent a69032e317
commit 9c0f415bd9
11 changed files with 1570 additions and 74 deletions

View File

@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import * as glob from 'vs/base/common/glob';
import { SearchSortOrder } from 'vs/workbench/services/search/common/search';
export const FindInNotebooksActionId = 'workbench.action.findInNotebooks';
export const FocusActiveEditorCommandId = 'notebookSearch.action.focusActiveEditor';
export const FocusSearchFromResults = 'notebookSearch.action.focusSearchFromResults';
export const OpenMatchToSide = 'notebookSearch.action.openResultToSide';
export const CancelActionId = 'notebookSearch.action.cancel';
export const RemoveActionId = 'notebookSearch.action.remove';
export const CopyPathCommandId = 'notebookSearch.action.copyPath';
export const CopyMatchCommandId = 'notebookSearch.action.copyMatch';
export const CopyAllCommandId = 'notebookSearch.action.copyAll';
export const OpenInEditorCommandId = 'notebookSearch.action.openInEditor';
export const ClearSearchHistoryCommandId = 'notebookSearch.action.clearHistory';
export const FocusSearchListCommandID = 'notebookSearch.action.focusSearchList';
export const ToggleCaseSensitiveCommandId = 'toggleSearchCaseSensitive';
export const ToggleWholeWordCommandId = 'toggleSearchWholeWord';
export const ToggleRegexCommandId = 'toggleSearchRegex';
export const AddCursorsAtSearchResults = 'addCursorsAtSearchResults';
export const SearchViewFocusedKey = new RawContextKey<boolean>('notebookSearchViewletFocus', false);
export const InputBoxFocusedKey = new RawContextKey<boolean>('inputBoxFocus', false);
export const SearchInputBoxFocusedKey = new RawContextKey<boolean>('searchInputBoxFocus', false);
export interface INotebookSearchConfigurationProperties {
exclude: glob.IExpression;
useRipgrep: boolean;
/**
* Use ignore file for file search.
*/
useIgnoreFiles: boolean;
useGlobalIgnoreFiles: boolean;
followSymlinks: boolean;
smartCase: boolean;
globalFindClipboard: boolean;
location: 'sidebar' | 'panel';
useReplacePreview: boolean;
showLineNumbers: boolean;
usePCRE2: boolean;
actionsPosition: 'auto' | 'right';
maintainFileSearchCache: boolean;
collapseResults: 'auto' | 'alwaysCollapse' | 'alwaysExpand';
searchOnType: boolean;
seedOnFocus: boolean;
seedWithNearestWord: boolean;
searchOnTypeDebouncePeriod: number;
searchEditor: {
doubleClickBehaviour: 'selectWord' | 'goToLocation' | 'openLocationToSide',
experimental: { reusePriorSearchConfiguration: boolean }
};
sortOrder: SearchSortOrder;
}