提交 db5e65b7 编写于 作者: S Sandeep Somavarapu

Fix #29760

上级 ac2d0704
......@@ -893,13 +893,33 @@ export class SearchViewlet extends Viewlet {
}
public searchInFolder(resource: URI): void {
let folderPath = null;
const workspace = this.contextService.getWorkspace2();
if (workspace) {
if (workspace.roots.length === 1) {
// Fallback to old way for single root workspace
folderPath = this.contextService.toWorkspaceRelativePath(resource);
if (folderPath && folderPath !== '.') {
folderPath = './' + folderPath;
}
} else {
folderPath = resource.fsPath;
}
}
if (!folderPath || folderPath === '.') {
this.inputPatternIncludes.setValue('');
this.searchWidget.focus();
return;
}
// Show 'files to include' box
if (!this.showsFileTypes()) {
this.toggleQueryDetails(true, true);
}
this.inputPatternIncludes.setIsGlobPattern(false);
this.inputPatternIncludes.setValue(resource.fsPath);
this.inputPatternIncludes.setValue(folderPath);
this.searchWidget.focus(false);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册