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

fix string.replace #168169

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion build/gulpfile.vscode.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const createVSCodeWebBuiltinExtensionsPatcher = (extensionsRoot) => {
// (2) Patch builtin extensions
if (path.endsWith('vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.js')) {
const builtinExtensions = JSON.stringify(extensions.scanBuiltinExtensions(extensionsRoot));
return content.replace('/*BUILD->INSERT_BUILTIN_EXTENSIONS*/', builtinExtensions.substr(1, builtinExtensions.length - 2) /* without [ and ]*/);
return content.replace('/*BUILD->INSERT_BUILTIN_EXTENSIONS*/', () => builtinExtensions.substr(1, builtinExtensions.length - 2) /* without [ and ]*/);
}

return content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ export class ExtensionTipsService extends BaseExtensionTipsService {
const exePaths: string[] = [];
if (isWindows) {
if (extensionTip.windowsPath) {
exePaths.push(extensionTip.windowsPath.replace('%USERPROFILE%', env['USERPROFILE']!)
.replace('%ProgramFiles(x86)%', env['ProgramFiles(x86)']!)
.replace('%ProgramFiles%', env['ProgramFiles']!)
.replace('%APPDATA%', env['APPDATA']!)
.replace('%WINDIR%', env['WINDIR']!));
exePaths.push(extensionTip.windowsPath.replace('%USERPROFILE%', () => env['USERPROFILE']!)
.replace('%ProgramFiles(x86)%', () => env['ProgramFiles(x86)']!)
.replace('%ProgramFiles%', () => env['ProgramFiles']!)
.replace('%APPDATA%', () => env['APPDATA']!)
.replace('%WINDIR%', () => env['WINDIR']!));
}
} else {
exePaths.push(join('/usr/local/bin', exeName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
}

const treatmentMessage = await this.tasExperimentService.getTreatment<string>('languageRecommendationMessage');
const message = treatmentMessage ? treatmentMessage.replace('{0}', name) : localize('reallyRecommended', "Do you want to install the recommended extensions for {0}?", name);
const message = treatmentMessage ? treatmentMessage.replace('{0}', () => name) : localize('reallyRecommended', "Do you want to install the recommended extensions for {0}?", name);

this.extensionRecommendationNotificationService.promptImportantExtensionsInstallNotification([extensionId], message, `@id:${extensionId}`, RecommendationSource.FILE)
.then(result => {
Expand Down