Skip to content
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

Enable dnd for file search results #33244

Merged
merged 1 commit into from
Aug 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/vs/workbench/parts/search/browser/searchViewlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { attachListStyler } from 'vs/platform/theme/common/styler';
import { IOutputService } from 'vs/workbench/parts/output/common/output';
import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search';
import { PreferencesEditor } from 'vs/workbench/parts/preferences/browser/preferencesEditor';
import { SimpleFileResourceDragAndDrop } from 'vs/base/parts/tree/browser/treeDnd';

export class SearchViewlet extends Viewlet {

Expand Down Expand Up @@ -469,13 +470,15 @@ export class SearchViewlet extends Viewlet {

let dataSource = new SearchDataSource(this.contextService.hasMultiFolderWorkspace());
let renderer = this.instantiationService.createInstance(SearchRenderer, this.getActionRunner(), this);
let dnd = new SimpleFileResourceDragAndDrop(obj => obj instanceof FileMatch ? obj.resource() : void 0);

this.tree = new Tree(div.getHTMLElement(), {
dataSource: dataSource,
renderer: renderer,
sorter: new SearchSorter(),
filter: new SearchFilter(),
accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider)
accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider),
dnd
}, {
ariaLabel: nls.localize('treeAriaLabel', "Search Results"),
keyboardSupport: false
Expand Down