提交 0a08b58f 编写于 作者: S Sandeep Somavarapu

do not look for executables in web

上级 dad6117f
...@@ -22,7 +22,6 @@ import { IFileService } from 'vs/platform/files/common/files'; ...@@ -22,7 +22,6 @@ import { IFileService } from 'vs/platform/files/common/files';
import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, IExtensionsViewlet, IExtensionsWorkbenchService, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, IExtensionsViewlet, IExtensionsWorkbenchService, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as os from 'os';
import { flatten, distinct, shuffle, coalesce } from 'vs/base/common/arrays'; import { flatten, distinct, shuffle, coalesce } from 'vs/base/common/arrays';
import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { guessMimeTypes, MIME_UNKNOWN } from 'vs/base/common/mime'; import { guessMimeTypes, MIME_UNKNOWN } from 'vs/base/common/mime';
...@@ -42,6 +41,7 @@ import { extname } from 'vs/base/common/resources'; ...@@ -42,6 +41,7 @@ import { extname } from 'vs/base/common/resources';
import { IExeBasedExtensionTip, IProductService } from 'vs/platform/product/common/product'; import { IExeBasedExtensionTip, IProductService } from 'vs/platform/product/common/product';
import { timeout } from 'vs/base/common/async'; import { timeout } from 'vs/base/common/async';
import { IWorkspaceStatsService } from 'vs/workbench/contrib/stats/common/workspaceStats'; import { IWorkspaceStatsService } from 'vs/workbench/contrib/stats/common/workspaceStats';
import { Platform } from 'vs/base/common/platform';
const milliSecondsInADay = 1000 * 60 * 60 * 24; const milliSecondsInADay = 1000 * 60 * 60 * 24;
const choiceNever = localize('neverShowAgain', "Don't Show Again"); const choiceNever = localize('neverShowAgain', "Don't Show Again");
...@@ -982,11 +982,13 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe ...@@ -982,11 +982,13 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
/** /**
* If user has any of the tools listed in this.productService.productConfiguration.exeBasedExtensionTips, fetch corresponding recommendations * If user has any of the tools listed in this.productService.productConfiguration.exeBasedExtensionTips, fetch corresponding recommendations
*/ */
private fetchExecutableRecommendations(important: boolean): Promise<void> { private async fetchExecutableRecommendations(important: boolean): Promise<void> {
const homeDir = os.homedir(); if (Platform.Web) {
let foundExecutables: Set<string> = new Set<string>(); return;
}
let findExecutable = (exeName: string, tip: IExeBasedExtensionTip, path: string) => { const foundExecutables: Set<string> = new Set<string>();
const findExecutable = (exeName: string, tip: IExeBasedExtensionTip, path: string) => {
return this.fileService.exists(URI.file(path)).then(exists => { return this.fileService.exists(URI.file(path)).then(exists => {
if (exists && !foundExecutables.has(exeName)) { if (exists && !foundExecutables.has(exeName)) {
foundExecutables.add(exeName); foundExecutables.add(exeName);
...@@ -1002,7 +1004,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe ...@@ -1002,7 +1004,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
}); });
}; };
let promises: Promise<void>[] = []; const promises: Promise<void>[] = [];
// Loop through recommended extensions // Loop through recommended extensions
forEach(this.productService.productConfiguration.exeBasedExtensionTips, entry => { forEach(this.productService.productConfiguration.exeBasedExtensionTips, entry => {
if (typeof entry.value !== 'object' || !Array.isArray(entry.value['recommendations'])) { if (typeof entry.value !== 'object' || !Array.isArray(entry.value['recommendations'])) {
...@@ -1025,11 +1027,11 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe ...@@ -1025,11 +1027,11 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
promises.push(findExecutable(exeName, entry.value, windowsPath)); promises.push(findExecutable(exeName, entry.value, windowsPath));
} else { } else {
promises.push(findExecutable(exeName, entry.value, join('/usr/local/bin', exeName))); promises.push(findExecutable(exeName, entry.value, join('/usr/local/bin', exeName)));
promises.push(findExecutable(exeName, entry.value, join(homeDir, exeName))); promises.push(findExecutable(exeName, entry.value, join(this.environmentService.userHome, exeName)));
} }
}); });
return Promise.all(promises).then(() => undefined); await Promise.all(promises);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册