Check with respective owners

This commit is contained in:
Sandeep Somavarapu 2018-07-19 19:23:24 +02:00
parent 9df292b522
commit e0d5a3d490
6 changed files with 6 additions and 0 deletions

View file

@ -268,6 +268,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape {
if (folders.length === 0) {
return undefined;
}
// #54483 @Joh Why are we still using fsPath?
return folders[0].uri.fsPath;
}

View file

@ -892,6 +892,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
private fetchDynamicWorkspaceRecommendations(): TPromise<void> {
if (this.contextService.getWorkbenchState() !== WorkbenchState.FOLDER
|| this.contextService.getWorkspace().folders[0].uri.scheme !== Schemas.file // #54483: check with @Ramya
|| this._dynamicWorkspaceRecommendations.length
|| !this._extensionsRecommendationsUrl) {
return TPromise.as(null);

View file

@ -353,6 +353,7 @@ CommandsRegistry.registerCommand({
});
function revealResourcesInOS(resources: URI[], windowsService: IWindowsService, notificationService: INotificationService, workspaceContextService: IWorkspaceContextService): void {
// 54483: Check with @Isi
if (resources.length) {
sequence(resources.map(r => () => windowsService.showItemInFolder(paths.normalize(r.fsPath, true))));
} else if (workspaceContextService.getWorkspace().folders.length) {

View file

@ -435,6 +435,7 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
// Update resource context based on focused element
this.disposables.push(this.explorerViewer.onDidChangeFocus((e: { focus: ExplorerItem }) => {
const isSingleFolder = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER;
// 54483: Check with Isi
const resource = e.focus ? e.focus.resource : isSingleFolder ? this.contextService.getWorkspace().folders[0].uri : undefined;
this.resourceContext.set(resource);
this.folderContext.set((isSingleFolder && !e.focus) || e.focus && e.focus.isDirectory);

View file

@ -997,6 +997,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
if (resources) {
resources.forEach(resource => {
let folderPath: string;
// #54483 Check with Rob
if (this.contextService.getWorkbenchState() === WorkbenchState.FOLDER) {
// Show relative path from the root for single-root mode
folderPath = paths.normalize(pathToRelative(workspace.folders[0].uri.fsPath, resource.fsPath));

View file

@ -268,6 +268,7 @@ export class QueryBuilder {
return [uri.file(paths.normalize(searchPath))];
}
// 54483 Check with Rob
if (this.workspaceContextService.getWorkbenchState() === WorkbenchState.FOLDER) { // TODO: @Sandy Try checking workspace folders length instead.
const workspaceUri = this.workspaceContextService.getWorkspace().folders[0].uri;
return [workspaceUri.with({ path: paths.normalize(paths.join(workspaceUri.path, searchPath)) })];