From b6b656b0fea7e678b83a2edd0744459978a1d897 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 13:26:20 -0700 Subject: [PATCH 01/39] Add localization (#18954) * Enable localization using nls * Add i18n files * Add current translations * Add export and import scripts * Fix import translation function * Clean code * Update package-lock.json * Delete i18n files * Update package-lock.json * Add news * Fix package files * Addd sourcemaps * Add missing translations * Remove localize test * Add paths in pre-release --- build/azure-pipeline.pre-release.yml | 22 + build/loc/ExportTranslations.yml | 72 + build/loc/ImportTranslations.yml | 41 + gulpfile.js | 126 +- news/1 Enhancements/18286.md | 1 + package-lock.json | 1183 ++++++++++++++++- package.json | 9 + package.nls.json | 37 +- .../common/languageServerChangeHandler.ts | 12 +- src/client/activation/common/outputChannel.ts | 2 +- src/client/activation/extensionSurvey.ts | 12 +- src/client/activation/partialModeStatus.ts | 10 +- .../checks/invalidLaunchJsonDebugger.ts | 10 +- .../checks/invalidPythonPathInDebugger.ts | 4 +- .../checks/jediPython27NotSupported.ts | 6 +- .../diagnostics/checks/pylanceDefault.ts | 4 +- .../checks/pythonPathDeprecated.ts | 4 +- .../diagnostics/checks/switchToDefaultLS.ts | 4 +- .../diagnostics/surceMapSupportService.ts | 4 +- src/client/browser/extension.ts | 6 +- src/client/browser/intellisenseStatus.ts | 8 +- src/client/browser/localize.ts | 9 +- .../application/commands/reloadCommand.ts | 4 +- src/client/common/cancellation.ts | 2 +- src/client/common/experiments/service.ts | 10 +- src/client/common/installer/channelManager.ts | 4 +- .../common/installer/moduleInstaller.ts | 2 +- .../common/installer/productInstaller.ts | 22 +- src/client/common/net/fileDownloader.ts | 4 +- src/client/common/process/logger.ts | 2 +- src/client/common/utils/localize.ts | 152 ++- src/client/common/utils/localizeHelpers.ts | 133 -- .../adapter/outdatedDebuggerPrompt.ts | 4 +- .../extension/attachQuickPick/picker.ts | 10 +- .../extension/attachQuickPick/provider.ts | 2 +- .../debugConfigurationService.ts | 36 +- .../launch.json/completionProvider.ts | 6 +- .../configuration/providers/djangoLaunch.ts | 8 +- .../configuration/providers/fastapiLaunch.ts | 8 +- .../configuration/providers/fileLaunch.ts | 2 +- .../configuration/providers/flaskLaunch.ts | 8 +- .../configuration/providers/moduleLaunch.ts | 12 +- .../configuration/providers/pidAttach.ts | 2 +- .../configuration/providers/pyramidLaunch.ts | 8 +- .../configuration/providers/remoteAttach.ts | 16 +- src/client/extension.ts | 2 +- src/client/extensionInit.ts | 4 +- .../interpreterSelector/commands/base.ts | 8 +- .../commands/setInterpreter.ts | 30 +- src/client/interpreter/display/index.ts | 8 +- .../interpreter/display/progressDisplay.ts | 2 +- src/client/interpreter/interpreterService.ts | 2 +- .../virtualEnvs/condaInheritEnvPrompt.ts | 4 +- .../virtualEnvs/virtualEnvPrompt.ts | 7 +- .../pylanceLSExtensionManager.ts | 2 +- src/client/languageServer/watcher.ts | 8 +- src/client/linters/linterCommands.ts | 2 +- src/client/providers/importSortProvider.ts | 10 +- src/client/sourceMapSupport.ts | 4 +- .../nbextensionCodeLensProvider.ts | 2 +- .../tensorBoardImportCodeLensProvider.ts | 2 +- src/client/tensorBoard/tensorBoardPrompt.ts | 8 +- src/client/tensorBoard/tensorBoardSession.ts | 54 +- .../tensorBoard/tensorBoardSessionProvider.ts | 2 +- src/client/testing/main.ts | 6 +- .../testController/workspaceTestAdapter.ts | 10 +- .../activation/extensionSurvey.unit.test.ts | 38 +- .../languageServerChangeHandler.unit.test.ts | 80 +- .../activation/outputChannel.unit.test.ts | 2 +- .../activation/partialModeStatus.unit.test.ts | 24 +- .../invalidLaunchJsonDebugger.unit.test.ts | 2 +- .../jediPython27NotSupported.unit.test.ts | 4 +- .../checks/pylanceDefault.unit.test.ts | 4 +- .../checks/pythonPathDeprecated.unit.test.ts | 8 +- .../sourceMapSupportService.unit.test.ts | 2 +- .../commands/reloadCommand.unit.test.ts | 10 +- .../common/experiments/service.unit.test.ts | 2 +- .../installer/channelManager.unit.test.ts | 10 +- .../installer/moduleInstaller.unit.test.ts | 2 +- .../installer/productInstaller.unit.test.ts | 58 +- .../common/net/fileDownloader.unit.test.ts | 4 +- src/test/common/process/logger.unit.test.ts | 22 +- .../common/utils/localize.functional.test.ts | 220 --- .../commands/resetInterpreter.unit.test.ts | 20 +- .../commands/setInterpreter.unit.test.ts | 46 +- .../outdatedDebuggerPrompt.unit.test.ts | 2 +- .../completionProvider.unit.test.ts | 6 +- .../providers/djangoLaunch.unit.test.ts | 6 +- .../providers/fastapiLaunch.unit.test.ts | 4 +- .../providers/fileLaunch.unit.test.ts | 2 +- .../providers/flaskLaunch.unit.test.ts | 6 +- .../providers/moduleLaunch.unit.test.ts | 6 +- .../providers/pidAttach.unit.test.ts | 2 +- .../providers/pyramidLaunch.unit.test.ts | 6 +- .../providers/remoteAttach.unit.test.ts | 4 +- src/test/interpreters/display.unit.test.ts | 6 +- .../display/progressDisplay.unit.test.ts | 8 +- .../condaInheritEnvPrompt.unit.test.ts | 18 +- .../virtualEnvs/virtualEnvPrompt.unit.test.ts | 14 +- src/test/languageServer/watcher.unit.test.ts | 2 +- .../providers/importSortProvider.unit.test.ts | 16 +- src/test/sourceMapSupport.test.ts | 2 +- src/test/sourceMapSupport.unit.test.ts | 2 +- .../tensorBoardPrompt.unit.test.ts | 2 +- .../tensorBoard/tensorBoardSession.test.ts | 58 +- translations_auto_pr.js | 248 ++++ 106 files changed, 2228 insertions(+), 970 deletions(-) create mode 100644 build/loc/ExportTranslations.yml create mode 100644 build/loc/ImportTranslations.yml create mode 100644 news/1 Enhancements/18286.md delete mode 100644 src/client/common/utils/localizeHelpers.ts delete mode 100644 src/test/common/utils/localize.functional.test.ts create mode 100644 translations_auto_pr.js diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index a1a1b9c0c137..04bd7515b67f 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -21,6 +21,28 @@ resources: extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: + locPushSteps: + - script: echo '$(SetTranslationsPath.EnglishStrings)' + - displayName: Install NPM dependencies + script: 'cd $(EXTENSION_DIR) && npm ci' + - script: npm run translations-export + displayName: Run translations-export + - publish: $(VSCODE_TRANSLATIONS_EXPORT_DIR) + artifact: translations-export + displayName: Publish translations-export + - pwsh: | + $Destination = "$(SetTranslationsPath.EnglishStrings)" + New-Item -ItemType Directory -Force "$(SetTranslationsPath.EnglishStrings)" + Move-Item "$(Pipeline.Workspace)/ms-python.python" $Destination + displayName: Move vscode-python-translations-export to translations path + + locPullSteps: + - script: echo '$(SetTranslationsPath.TranslatedStrings)' + - script: 'gulp translations-import --option "${SetTranslationsPath.TranslatedStrings}"' + - pwsh: ls + displayName: test if there is stuff + workingDirectory: '$(SetTranslationsPath.TranslatedStrings)' + buildSteps: - task: NodeTool@0 inputs: diff --git a/build/loc/ExportTranslations.yml b/build/loc/ExportTranslations.yml new file mode 100644 index 000000000000..a3d08ae2ef2c --- /dev/null +++ b/build/loc/ExportTranslations.yml @@ -0,0 +1,72 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +pr: none +trigger: + branches: + include: + - main +schedules: +- cron: "0 0 * * *" + displayName: Daily midnight build + branches: + include: + - main + +stages: +- stage: Localization + pool: + vmImage: windows-latest + variables: + skipComponentGovernanceDetection: true + VSCODE_EXTENSIONS_LOC_DIR: $(Pipeline.Workspace)/vscode-extensions-loc + EXTENSION_DIR: $(Build.SourcesDirectory) + VSCODE_TRANSLATIONS_EXPORT_DIR: $(Pipeline.Workspace)/ms-python.python + jobs: + - job: Localization + timeoutInMinutes: 180 + steps: + + # Clone extension Repository and run translations-export to get xlf file + - script: git clone https://github.com/microsoft/vscode-extensions-loc/ ${VSCODE_EXTENSIONS_LOC_DIR} + displayName: Clone Microsoft/vscode-extensions-loc + + + - task: NodeTool@0 + inputs: + versionSpec: '14.18.2' + displayName: Select Node version + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + architecture: 'x64' + displayName: Select Python version + - displayName: Install NPM dependencies + script: 'cd $(EXTENSION_DIR) && npm ci' + - script: npm run translations-export + displayName: Run translations-export + - publish: $(VSCODE_TRANSLATIONS_EXPORT_DIR) + artifact: translations-export + displayName: Publish translations-export + + - pwsh: | + $Destination = "$(VSCODE_EXTENSIONS_LOC_DIR)/src/en" + New-Item -ItemType Directory -Force "$(VSCODE_EXTENSIONS_LOC_DIR)/src/en" + Move-Item "$(VSCODE_TRANSLATIONS_EXPORT_DIR)" $Destination + displayName: Move vscode-python-translations-export to expected path + + - name: Create Pull Request on vscode-extensions-loc + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.REPO_PAT }} + path: ${{ github.workspace }}/vscode-extensions-loc + title: Update Localization xlf files + body: Automated changes based on Microsoft/vscode-python@${{ github.sha }} + branch: update-localization-files-microsoft-vscode-python-${{ github.sha }} + commit-message: update localization xlf files Microsoft/vscode-python@${{ github.sha }} + assignees: PaulaCamargo25 + delete-branch: true diff --git a/build/loc/ImportTranslations.yml b/build/loc/ImportTranslations.yml new file mode 100644 index 000000000000..791a7b935cbb --- /dev/null +++ b/build/loc/ImportTranslations.yml @@ -0,0 +1,41 @@ +# ================================================================================== +# Pipeline for VsCodeExtension-Localization build definition +# Runs OneLocBuild task to localize xlf file +# ================================================================================== + +resources: + repositories: + - repository: self + clean: true + +trigger: none +pr: none +schedules: +- cron: "0 7 * * *" + displayName: Daily 7 AM + branches: + include: + - main + always: true + +pool: + name: 'AzurePipelines-EO' + demands: + - ImageOverride -equals AzurePipelinesWindows2022compliant +variables: + VSCODE_EXTENSIONS_LOC_DIR: $(Pipeline.Workspace)/vscode-extensions-loc + EXTENSION_DIR: $(Build.SourcesDirectory) + +steps: +# Clone extension Repository and run translations-export to get xlf file +- script: git clone https://github.com/microsoft/vscode-extensions-loc/ ${VSCODE_EXTENSIONS_LOC_DIR} + displayName: Clone Microsoft/vscode-extensions-loc +- task: CmdLine@2 + inputs: + script: 'node ./translations_auto_pr.js microsoft vscode-python csigs csigs csigs@users.noreply.github.com "${Build.VSCODE_EXTENSIONS_LOC_DIR}/loc"' + +- task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' diff --git a/gulpfile.js b/gulpfile.js index 28ebde894027..ea72874df97d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,12 +21,19 @@ const flat = require('flat'); const { argv } = require('yargs'); const os = require('os'); const rmrf = require('rimraf'); +const nls = require('vscode-nls-dev'); +const sourcemaps = require('gulp-sourcemaps'); +const typescript = require('typescript'); +const es = require('event-stream'); +const minimist = require('minimist'); + +const tsProject = ts.createProject('./tsconfig.json', { typescript }); +const filter = require('gulp-filter'); const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined; gulp.task('compile', (done) => { let failed = false; - const tsProject = ts.createProject('tsconfig.json'); tsProject .src() .pipe(tsProject()) @@ -353,3 +360,120 @@ function hasNativeDependencies() { } return false; } + +const translationProjectName = 'ms-python.python'; +const translationExtensionName = 'vscode-python'; + +const defaultLanguages = [ + { id: 'de', folderName: 'de' }, + { id: 'fr', folderName: 'fr' }, + { id: 'es', folderName: 'es' }, + { id: 'cs', folderName: 'cs' }, + { id: 'it', folderName: 'it' }, + { id: 'ja', folderName: 'ja' }, + { id: 'ko', folderName: 'ko' }, + { id: 'pl', folderName: 'pl' }, + { id: 'pt-BR', folderName: 'pt-BR' }, + { id: 'ru', folderName: 'ru' }, + { id: 'tr', folderName: 'tr' }, + { id: 'zh-Hans', folderName: 'zh-Hans' }, + { id: 'zh-Hant', folderName: 'zh-Hant' }, + { id: 'qps-ploc', folderName: 'qps-ploc' }, +]; +// **************************** +// Command: translations-generate +// The following is used to import an i18n directory structure and generate files used at runtime. +// **************************** + +// Generate package.nls.*.json files from: ./i18n/*/package.i18n.json +// Outputs to root path, as these nls files need to be along side package.json + +const generateAdditionalLocFiles = () => + gulp + .src(['package.nls.json']) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n', 'out')) + .pipe(gulp.dest('out')); + +// Generates ./dist/nls.bundle..json from files in ./i18n/** *///.i18n.json +// Localized strings are read from these files at runtime. +const generateSrcLocBundle = () => + // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. + tsProject + .src() + .pipe(sourcemaps.init()) + .pipe(tsProject()) + .js.pipe(nls.createMetaDataFiles()) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n', 'out')) + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) + .pipe(nls.bundleLanguageFiles()) + .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) + .pipe(gulp.dest('out')); + +gulp.task('translations-generate', generateSrcLocBundle, generateAdditionalLocFiles); + +// **************************** +// Command: translations-export +// The following is used to export and XLF file containing english strings for translations. +// The result will be written to: ../vscode-extensions-localization-export/ms-vscode/ +// **************************** +const exportTranslations = (done) => { + const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); + + // Merge files from all source streams + jsStream + + // Filter down to only the files we need + .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) + + // Consoldate them into nls.metadata.json, which the xlf is built from. + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) + + // filter down to just the resulting metadata files + .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) + + // Add package.nls.json, used to localized package.json + .pipe(gulp.src(['package.nls.json'])) + + // package.nls.json and nls.metadata.json are used to generate the xlf file + // Does not re-queue any files to the stream. Outputs only the XLF file + .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) + .pipe(gulp.dest('../')) + .pipe( + es.wait(() => { + done(); + }), + ); +}; + +gulp.task('translations-export', exportTranslations); + +// **************************** +// Command: translations-import +// The following is used to import an XLF file containing all language strings. +// This results in a i18n directory, which should be checked in. +// **************************** + +// Imports translations from raw localized MLCP strings to VS Code .i18n.json files +gulp.task('translations-import', (done) => { + const options = minimist(process.argv.slice(2), { + string: 'location', + default: { + location: '../vscode-translations-import', + }, + }); + es.merge( + defaultLanguages.map((language) => { + const id = language.transifexId || language.id; + return gulp + .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) + .pipe(nls.prepareJsonFiles()) + .pipe(gulp.dest(path.join('./i18n', language.folderName))); + }), + ).pipe( + es.wait(() => { + done(); + }), + ); +}); + +gulp.task('create-i18n', gulp.series(generateSrcLocBundle, exportTranslations)); diff --git a/news/1 Enhancements/18286.md b/news/1 Enhancements/18286.md new file mode 100644 index 000000000000..11c312d18711 --- /dev/null +++ b/news/1 Enhancements/18286.md @@ -0,0 +1 @@ +Enable localization using vscode-nlsß diff --git a/package-lock.json b/package-lock.json index e68fa6fedc5f..120983111369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "vscode-languageclient": "8.0.0-next.13", "vscode-languageserver": "8.0.0-next.9", "vscode-languageserver-protocol": "3.17.0-next.15", + "vscode-nls": "^5.0.0", "vscode-tas-client": "^0.1.22", "winreg": "^1.2.4", "xml2js": "^0.4.19" @@ -86,11 +87,15 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.0", + "event-stream": "^4.0.1", "expose-loader": "^3.1.0", "flat": "^5.0.2", "get-port": "^5.1.1", "gulp": "^4.0.0", + "gulp-filter": "^7.0.0", + "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^5.0.0", + "minimist": "^1.2.6", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.1.7", @@ -98,6 +103,7 @@ "node-has-native-dependencies": "^1.0.2", "node-loader": "^1.0.2", "nyc": "^15.0.0", + "parse-git-config": "^3.0.0", "prettier": "^2.0.2", "rewiremock": "^3.13.0", "rimraf": "^3.0.2", @@ -113,6 +119,7 @@ "uuid": "^8.3.2", "vsce": "^2.6.6", "vscode-debugadapter-testsupport": "^1.27.0", + "vscode-nls-dev": "^4.0.0", "vscode-telemetry-extractor": "^1.9.5", "webpack": "^5.70.0", "webpack-bundle-analyzer": "^4.5.0", @@ -296,6 +303,69 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@gulp-sourcemaps/identity-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", + "integrity": "sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q==", + "dev": true, + "dependencies": { + "acorn": "^6.4.1", + "normalize-path": "^3.0.0", + "postcss": "^7.0.16", + "source-map": "^0.6.0", + "through2": "^3.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@gulp-sourcemaps/identity-map/node_modules/through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + }, + "node_modules/@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "dependencies": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -1583,6 +1653,15 @@ "node": ">=6" } }, + "node_modules/array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -1738,6 +1817,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -3001,6 +3089,15 @@ "node": ">=0.10.0" } }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/clone-buffer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", @@ -3417,6 +3514,28 @@ "node": "*" } }, + "node_modules/css": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", + "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "source-map": "^0.6.1", + "source-map-resolve": "^0.6.0" + } + }, + "node_modules/css/node_modules/source-map-resolve": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0" + } + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -3459,6 +3578,26 @@ "ms": "2.0.0" } }, + "node_modules/debug-fabulous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", + "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", + "dev": true, + "dependencies": { + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" + } + }, + "node_modules/debug-fabulous/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, "node_modules/debug/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3886,6 +4025,15 @@ "node": ">=0.10" } }, + "node_modules/detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -5110,6 +5258,31 @@ "node": ">=0.10.0" } }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/event-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", + "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "dev": true, + "dependencies": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -5942,6 +6115,12 @@ "node": ">=0.10.0" } }, + "node_modules/from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, "node_modules/from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -6205,6 +6384,15 @@ "assert-plus": "^1.0.0" } }, + "node_modules/git-config-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-2.0.0.tgz", + "integrity": "sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -6531,6 +6719,66 @@ "node": ">= 0.10" } }, + "node_modules/gulp-filter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz", + "integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==", + "dev": true, + "dependencies": { + "multimatch": "^5.0.0", + "plugin-error": "^1.0.1", + "streamfilter": "^3.0.0", + "to-absolute-glob": "^2.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + }, + "peerDependencies": { + "gulp": ">=4" + }, + "peerDependenciesMeta": { + "gulp": { + "optional": true + } + } + }, + "node_modules/gulp-sourcemaps": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz", + "integrity": "sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ==", + "dev": true, + "dependencies": { + "@gulp-sourcemaps/identity-map": "^2.0.1", + "@gulp-sourcemaps/map-sources": "^1.0.0", + "acorn": "^6.4.1", + "convert-source-map": "^1.0.0", + "css": "^3.0.0", + "debug-fabulous": "^1.0.0", + "detect-newline": "^2.0.0", + "graceful-fs": "^4.0.0", + "source-map": "^0.6.0", + "strip-bom-string": "^1.0.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gulp-sourcemaps/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/gulp-typescript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.1.tgz", @@ -7206,6 +7454,15 @@ "node": ">=0.10.0" } }, + "node_modules/is": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", @@ -7509,6 +7766,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -8652,6 +8915,15 @@ "node": ">=10" } }, + "node_modules/lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "dependencies": { + "es5-ext": "~0.10.2" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -8703,6 +8975,12 @@ "node": ">=0.10.0" } }, + "node_modules/map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, "node_modules/map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -8805,6 +9083,22 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "node_modules/memoizee": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", + "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.53", + "es6-weak-map": "^2.0.3", + "event-emitter": "^0.3.5", + "is-promise": "^2.2.2", + "lru-queue": "^0.1.0", + "next-tick": "^1.1.0", + "timers-ext": "^0.1.7" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -9420,6 +9714,37 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/multimatch": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", + "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", + "dev": true, + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/multimatch/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/mute-stdout": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", @@ -9493,6 +9818,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "dev": true + }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -10399,6 +10730,19 @@ "node": ">=0.8" } }, + "node_modules/parse-git-config": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", + "integrity": "sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==", + "dev": true, + "dependencies": { + "git-config-path": "^2.0.0", + "ini": "^1.3.5" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/parse-node-version": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", @@ -10548,6 +10892,15 @@ "node": "*" } }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "dependencies": { + "through": "~2.3" + } + }, "node_modules/pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -10659,6 +11012,29 @@ "node": ">=0.10.0" } }, + "node_modules/postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "dependencies": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/postcss/node_modules/picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + }, "node_modules/postinstall-build": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/postinstall-build/-/postinstall-build-5.0.3.tgz", @@ -12136,6 +12512,18 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "node_modules/split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, "node_modules/split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -12222,6 +12610,16 @@ "readable-stream": "^2.0.2" } }, + "node_modules/stream-combiner": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, + "dependencies": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, "node_modules/stream-exhaust": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", @@ -12247,21 +12645,47 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, - "node_modules/strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "node_modules/streamfilter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz", + "integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==", "dev": true, + "dependencies": { + "readable-stream": "^3.0.6" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8.12.0" } }, - "node_modules/string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "dev": true, - "dependencies": { + "node_modules/streamfilter/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "dependencies": { "safe-buffer": "~5.1.0" } }, @@ -12369,6 +12793,15 @@ "node": ">=0.10.0" } }, + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -12763,6 +13196,16 @@ "node": ">=0.6.0" } }, + "node_modules/timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dev": true, + "dependencies": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -13777,9 +14220,9 @@ } }, "node_modules/vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "dev": true, "dependencies": { "clone": "^2.1.1", @@ -13851,15 +14294,6 @@ "node": ">=0.10.0" } }, - "node_modules/vinyl/node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/vm-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", @@ -14051,6 +14485,187 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.0-next.8.tgz", "integrity": "sha512-Mwj+FemiEk4QUUms1GGvXwDC+laJGVFuA4glbMVJTxfXdfOFZaEuyVlLobjccBo+NzD+5oEzzejTX7nWGNajjQ==" }, + "node_modules/vscode-nls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz", + "integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==" + }, + "node_modules/vscode-nls-dev": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-nls-dev/-/vscode-nls-dev-4.0.0.tgz", + "integrity": "sha512-2JcEOy1EQKcF8JhtYfFdwAkzxFKrB2ZbHoQwKkzEFOc/RlLAPqO3laBvO2wK4k6G4XUCno/XLQjuDM33/+baRg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1", + "clone": "^2.1.2", + "event-stream": "^3.3.4", + "fancy-log": "^1.3.3", + "glob": "^7.2.0", + "iconv-lite": "^0.6.3", + "is": "^3.3.0", + "source-map": "^0.6.1", + "typescript": "^4.5.4", + "vinyl": "^2.2.1", + "xml2js": "^0.4.23", + "yargs": "^17.3.0" + }, + "bin": { + "vscl": "lib/vscl.js" + } + }, + "node_modules/vscode-nls-dev/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/vscode-nls-dev/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/vscode-nls-dev/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/vscode-nls-dev/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/vscode-nls-dev/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/vscode-nls-dev/node_modules/event-stream": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz", + "integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==", + "dev": true, + "dependencies": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, + "node_modules/vscode-nls-dev/node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/vscode-nls-dev/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/vscode-nls-dev/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/vscode-nls-dev/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/vscode-nls-dev/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/vscode-nls-dev/node_modules/yargs": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/vscode-nls-dev/node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/vscode-ripgrep": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-1.12.1.tgz", @@ -15013,6 +15628,58 @@ } } }, + "@gulp-sourcemaps/identity-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", + "integrity": "sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q==", + "dev": true, + "requires": { + "acorn": "^6.4.1", + "normalize-path": "^3.0.0", + "postcss": "^7.0.16", + "source-map": "^0.6.0", + "through2": "^3.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + } + } + }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "requires": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, "@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -16059,6 +16726,12 @@ "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, "array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -16172,6 +16845,12 @@ "es-abstract": "^1.19.0" } }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -17175,6 +17854,12 @@ } } }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, "clone-buffer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", @@ -17535,6 +18220,29 @@ "randomfill": "^1.0.3" } }, + "css": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", + "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "source-map": "^0.6.1", + "source-map-resolve": "^0.6.0" + }, + "dependencies": { + "source-map-resolve": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0" + } + } + } + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -17582,6 +18290,28 @@ } } }, + "debug-fabulous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", + "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", + "dev": true, + "requires": { + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -17913,6 +18643,12 @@ "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -18881,6 +19617,31 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "event-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", + "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -19522,6 +20283,12 @@ "map-cache": "^0.2.2" } }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", + "dev": true + }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -19734,6 +20501,12 @@ "assert-plus": "^1.0.0" } }, + "git-config-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-2.0.0.tgz", + "integrity": "sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==", + "dev": true + }, "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -20077,6 +20850,45 @@ } } }, + "gulp-filter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz", + "integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==", + "dev": true, + "requires": { + "multimatch": "^5.0.0", + "plugin-error": "^1.0.1", + "streamfilter": "^3.0.0", + "to-absolute-glob": "^2.0.2" + } + }, + "gulp-sourcemaps": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz", + "integrity": "sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ==", + "dev": true, + "requires": { + "@gulp-sourcemaps/identity-map": "^2.0.1", + "@gulp-sourcemaps/map-sources": "^1.0.0", + "acorn": "^6.4.1", + "convert-source-map": "^1.0.0", + "css": "^3.0.0", + "debug-fabulous": "^1.0.0", + "detect-newline": "^2.0.0", + "graceful-fs": "^4.0.0", + "source-map": "^0.6.0", + "strip-bom-string": "^1.0.0", + "through2": "^2.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + } + } + }, "gulp-typescript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.1.tgz", @@ -20518,6 +21330,12 @@ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, + "is": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", + "dev": true + }, "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", @@ -20742,6 +21560,12 @@ "isobject": "^3.0.1" } }, + "is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -21660,6 +22484,15 @@ "yallist": "^4.0.0" } }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "~0.10.2" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -21698,6 +22531,12 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -21789,6 +22628,22 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "memoizee": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", + "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "dev": true, + "requires": { + "d": "^1.0.1", + "es5-ext": "^0.10.53", + "es6-weak-map": "^2.0.3", + "event-emitter": "^0.3.5", + "is-promise": "^2.2.2", + "lru-queue": "^0.1.0", + "next-tick": "^1.1.0", + "timers-ext": "^0.1.7" + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -22240,6 +23095,30 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "multimatch": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", + "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, "mute-stdout": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", @@ -22307,6 +23186,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -23021,6 +23906,16 @@ "path-root": "^0.1.1" } }, + "parse-git-config": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", + "integrity": "sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==", + "dev": true, + "requires": { + "git-config-path": "^2.0.0", + "ini": "^1.3.5" + } + }, "parse-node-version": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", @@ -23144,6 +24039,15 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "~2.3" + } + }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -23228,6 +24132,24 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, + "postcss": { + "version": "7.0.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", + "dev": true, + "requires": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", + "dev": true + } + } + }, "postinstall-build": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/postinstall-build/-/postinstall-build-5.0.3.tgz", @@ -24385,6 +25307,15 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -24453,6 +25384,16 @@ "readable-stream": "^2.0.2" } }, + "stream-combiner": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "dev": true, + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, "stream-exhaust": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", @@ -24478,6 +25419,28 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, + "streamfilter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz", + "integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==", + "dev": true, + "requires": { + "readable-stream": "^3.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -24575,6 +25538,12 @@ "is-utf8": "^0.2.0" } }, + "strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true + }, "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -24886,6 +25855,16 @@ "setimmediate": "^1.0.4" } }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dev": true, + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -25685,9 +26664,9 @@ } }, "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "dev": true, "requires": { "clone": "^2.1.1", @@ -25696,14 +26675,6 @@ "cloneable-readable": "^1.0.0", "remove-trailing-separator": "^1.0.1", "replace-ext": "^1.0.0" - }, - "dependencies": { - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - } } }, "vinyl-fs": { @@ -25909,6 +26880,150 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.0-next.8.tgz", "integrity": "sha512-Mwj+FemiEk4QUUms1GGvXwDC+laJGVFuA4glbMVJTxfXdfOFZaEuyVlLobjccBo+NzD+5oEzzejTX7nWGNajjQ==" }, + "vscode-nls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz", + "integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==" + }, + "vscode-nls-dev": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-nls-dev/-/vscode-nls-dev-4.0.0.tgz", + "integrity": "sha512-2JcEOy1EQKcF8JhtYfFdwAkzxFKrB2ZbHoQwKkzEFOc/RlLAPqO3laBvO2wK4k6G4XUCno/XLQjuDM33/+baRg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "clone": "^2.1.2", + "event-stream": "^3.3.4", + "fancy-log": "^1.3.3", + "glob": "^7.2.0", + "iconv-lite": "^0.6.3", + "is": "^3.3.0", + "source-map": "^0.6.1", + "typescript": "^4.5.4", + "vinyl": "^2.2.1", + "xml2js": "^0.4.23", + "yargs": "^17.3.0" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "event-stream": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz", + "integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "dev": true + } + } + }, "vscode-ripgrep": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-1.12.1.tgz", diff --git a/package.json b/package.json index 5630802f9de2..b75921e39bbe 100644 --- a/package.json +++ b/package.json @@ -1796,6 +1796,8 @@ "prePublish": "gulp clean && gulp prePublishNonBundle", "compile": "tsc -watch -p ./", "compiled": "deemon npm run compile", + "translations-export": "gulp clean && gulp prePublishNonBundle && gulp translations-export", + "translations-import": "gulp clean && gulp prePublishNonBundle && gulp translations-import", "kill-compiled": "deemon --kill npm run compile", "checkDependencies": "gulp checkDependencies", "test": "node ./out/test/standardTest.js && node ./out/test/multiRootTest.js", @@ -1860,6 +1862,7 @@ "vscode-languageclient": "8.0.0-next.13", "vscode-languageserver": "8.0.0-next.9", "vscode-languageserver-protocol": "3.17.0-next.15", + "vscode-nls": "^5.0.0", "vscode-tas-client": "^0.1.22", "winreg": "^1.2.4", "xml2js": "^0.4.19" @@ -1905,11 +1908,15 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.0", + "event-stream": "^4.0.1", "expose-loader": "^3.1.0", "flat": "^5.0.2", "get-port": "^5.1.1", "gulp": "^4.0.0", + "gulp-filter": "^7.0.0", + "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^5.0.0", + "minimist": "^1.2.6", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.1.7", @@ -1917,6 +1924,7 @@ "node-has-native-dependencies": "^1.0.2", "node-loader": "^1.0.2", "nyc": "^15.0.0", + "parse-git-config": "^3.0.0", "prettier": "^2.0.2", "rewiremock": "^3.13.0", "rimraf": "^3.0.2", @@ -1932,6 +1940,7 @@ "uuid": "^8.3.2", "vsce": "^2.6.6", "vscode-debugadapter-testsupport": "^1.27.0", + "vscode-nls-dev": "^4.0.0", "vscode-telemetry-extractor": "^1.9.5", "webpack": "^5.70.0", "webpack-bundle-analyzer": "^4.5.0", diff --git a/package.nls.json b/package.nls.json index cd93d1a26861..8e2de632d687 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,32 +1,27 @@ { - "python.command.python.sortImports.title": "Sort Imports", - "python.command.python.startREPL.title": "Start REPL", - "python.command.python.createTerminal.title": "Create Terminal", "python.command.python.createNewFile.title": "New Python File", "python.command.python.execInTerminal.title": "Run Python File in Terminal", "python.command.python.debugInTerminal.title": "Debug Python File", "python.command.python.execInTerminalIcon.title": "Run Python File", "python.command.python.setInterpreter.title": "Select Interpreter", + "python.command.python.analysis.restartLanguageServer.title": "Restart Language Server", + "python.command.python.clearPersistentStorage.title": "Clear Internal Extension Cache", "python.command.python.clearWorkspaceInterpreter.title": "Clear Workspace Interpreter Setting", - "python.command.python.viewOutput.title": "Show Output", - "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", "python.command.python.configureTests.title": "Configure Tests", + "python.command.python.createTerminal.title": "Create Terminal", + "python.command.python.enableLinting.title": "Enable/Disable Linting", + "python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging", + "python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell", + "python.command.python.execSelectionInTerminal.title": "Run Selection/Line in Python Terminal", + "python.command.python.goToPythonObject.title": "Go to Python Object", + "python.command.python.launchTensorBoard.title": "Launch TensorBoard", + "python.command.python.refreshTensorBoard.title": "Refresh TensorBoard", "python.command.python.refreshTests.title": "Refresh Tests", "python.command.python.refreshingTests.title": "Refreshing Tests", "python.command.python.stopRefreshingTests.title": "Stop Refreshing Tests", - "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", - "python.command.python.execSelectionInTerminal.title": "Run Selection/Line in Python Terminal", - "python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell", - "python.command.python.goToPythonObject.title": "Go to Python Object", "python.command.python.reportIssue.title": "Report Issue...", - "python.command.python.setLinter.title": "Select Linter", - "python.command.python.enableLinting.title": "Enable/Disable Linting", + "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", "python.command.python.runLinting.title": "Run Linting", - "python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging", - "python.command.python.clearPersistentStorage.title": "Clear Internal Extension Cache", - "python.command.python.analysis.restartLanguageServer.title": "Restart Language Server", - "python.command.python.launchTensorBoard.title": "Launch TensorBoard", - "python.command.python.refreshTensorBoard.title": "Refresh TensorBoard", "python.menu.createNewFile.title": "Python File", "python.snippet.launch.standard.label": "Python: Current File", "python.snippet.launch.module.label": "Python: Module", @@ -220,5 +215,13 @@ "TensorBoard.launchNativeTensorBoardSessionCodeLens": "▶ Launch TensorBoard Session", "TensorBoard.enterRemoteUrl": "Enter remote URL", "TensorBoard.enterRemoteUrlDetail": "Enter a URL pointing to a remote directory containing your TensorBoard log files", - "SwitchToDefaultLS.bannerMessage": "The Microsoft Python Language Server has reached end of life. Your language server has been set to the default for Python in VS Code, Pylance. If you’d like to change your language server, you can learn about how to do so [here](https://devblogs.microsoft.com/python/python-in-visual-studio-code-may-2021-release/#configuring-your-language-server). Read Pylance’s license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license)." + "SwitchToDefaultLS.bannerMessage": "The Microsoft Python Language Server has reached end of life. Your language server has been set to the default for Python in VS Code, Pylance. If you’d like to change your language server, you can learn about how to do so [here](https://devblogs.microsoft.com/python/python-in-visual-studio-code-may-2021-release/#configuring-your-language-server). Read Pylance’s license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license).", + "python.command.python.setLinter.title": "Select Linter", + "python.command.python.sortImports.title": "Sort Imports", + "python.command.python.startREPL.title": "Start REPL", + "python.command.python.switchOffInsidersChannel.title": "Switch to Default Channel", + "python.command.python.switchToDailyChannel.title": "Switch to Insiders Daily Channel", + "python.command.python.switchToWeeklyChannel.title": "Switch to Insiders Weekly Channel", + "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", + "python.command.python.viewOutput.title": "Show Output" } diff --git a/src/client/activation/common/languageServerChangeHandler.ts b/src/client/activation/common/languageServerChangeHandler.ts index daae78a88d2b..83ff204ed6e7 100644 --- a/src/client/activation/common/languageServerChangeHandler.ts +++ b/src/client/activation/common/languageServerChangeHandler.ts @@ -16,15 +16,15 @@ export async function promptForPylanceInstall( configService: IConfigurationService, ): Promise { const response = await appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ); - if (response === Pylance.pylanceInstallPylance()) { + if (response === Pylance.pylanceInstallPylance) { commandManager.executeCommand('extension.open', PYLANCE_EXTENSION_ID); - } else if (response === Pylance.pylanceRevertToJedi()) { + } else if (response === Pylance.pylanceRevertToJedi) { const inspection = workspace.getConfiguration('python').inspect('languageServer'); let target: ConfigurationTarget | undefined; diff --git a/src/client/activation/common/outputChannel.ts b/src/client/activation/common/outputChannel.ts index cefe221b37dc..033f888cefdd 100644 --- a/src/client/activation/common/outputChannel.ts +++ b/src/client/activation/common/outputChannel.ts @@ -23,7 +23,7 @@ export class LanguageServerOutputChannel implements ILanguageServerOutputChannel public get channel(): IOutputChannel { if (!this.output) { - this.output = this.appShell.createOutputChannel(OutputChannelNames.languageServer()); + this.output = this.appShell.createOutputChannel(OutputChannelNames.languageServer); this.registerCommand().ignoreErrors(); } return this.output; diff --git a/src/client/activation/extensionSurvey.ts b/src/client/activation/extensionSurvey.ts index 885893e9f54e..6d1d784237ba 100644 --- a/src/client/activation/extensionSurvey.ts +++ b/src/client/activation/extensionSurvey.ts @@ -82,24 +82,20 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService @traceDecoratorError('Failed to display prompt for extension survey') public async showSurvey() { - const prompts = [ - ExtensionSurveyBanner.bannerLabelYes(), - ExtensionSurveyBanner.maybeLater(), - Common.doNotShowAgain(), - ]; + const prompts = [ExtensionSurveyBanner.bannerLabelYes, ExtensionSurveyBanner.maybeLater, Common.doNotShowAgain]; const telemetrySelections: ['Yes', 'Maybe later', 'Do not show again'] = [ 'Yes', 'Maybe later', 'Do not show again', ]; - const selection = await this.appShell.showInformationMessage(ExtensionSurveyBanner.bannerMessage(), ...prompts); + const selection = await this.appShell.showInformationMessage(ExtensionSurveyBanner.bannerMessage, ...prompts); sendTelemetryEvent(EventName.EXTENSION_SURVEY_PROMPT, undefined, { selection: selection ? telemetrySelections[prompts.indexOf(selection)] : undefined, }); if (!selection) { return; } - if (selection === ExtensionSurveyBanner.bannerLabelYes()) { + if (selection === ExtensionSurveyBanner.bannerLabelYes) { this.launchSurvey(); // Disable survey for a few weeks await this.persistentState @@ -109,7 +105,7 @@ export class ExtensionSurveyPrompt implements IExtensionSingleActivationService timeToDisableSurveyFor, ) .updateValue(true); - } else if (selection === Common.doNotShowAgain()) { + } else if (selection === Common.doNotShowAgain) { // Never show the survey again await this.persistentState .createGlobalPersistentState(extensionSurveyStateKeys.doNotShowAgain, false) diff --git a/src/client/activation/partialModeStatus.ts b/src/client/activation/partialModeStatus.ts index 0bc999d82acf..1105f6529ac8 100644 --- a/src/client/activation/partialModeStatus.ts +++ b/src/client/activation/partialModeStatus.ts @@ -40,14 +40,14 @@ export class PartialModeStatusItem implements IExtensionSingleActivationService const statusItem = vscode.languages.createLanguageStatusItem('python.projectStatus', { language: 'python', }); - statusItem.name = LanguageService.statusItem.name(); + statusItem.name = LanguageService.statusItem.name; statusItem.severity = vscode.LanguageStatusSeverity.Warning; - statusItem.text = LanguageService.statusItem.text(); + statusItem.text = LanguageService.statusItem.text; statusItem.detail = !this.workspace.isTrusted - ? LanguageService.statusItem.detail() - : LanguageService.virtualWorkspaceStatusItem.detail(); + ? LanguageService.statusItem.detail + : LanguageService.virtualWorkspaceStatusItem.detail; statusItem.command = { - title: Common.learnMore(), + title: Common.learnMore, command: 'vscode.open', arguments: [vscode.Uri.parse('https://aka.ms/AAdzyh4')], }; diff --git a/src/client/application/diagnostics/checks/invalidLaunchJsonDebugger.ts b/src/client/application/diagnostics/checks/invalidLaunchJsonDebugger.ts index 0034564a632f..d6757d5a844e 100644 --- a/src/client/application/diagnostics/checks/invalidLaunchJsonDebugger.ts +++ b/src/client/application/diagnostics/checks/invalidLaunchJsonDebugger.ts @@ -17,9 +17,9 @@ import { DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from '. import { DiagnosticScope, IDiagnostic, IDiagnosticHandlerService } from '../types'; const messages = { - [DiagnosticCodes.InvalidDebuggerTypeDiagnostic]: Diagnostics.invalidDebuggerTypeDiagnostic(), - [DiagnosticCodes.JustMyCodeDiagnostic]: Diagnostics.justMyCodeDiagnostic(), - [DiagnosticCodes.ConsoleTypeDiagnostic]: Diagnostics.consoleTypeDiagnostic(), + [DiagnosticCodes.InvalidDebuggerTypeDiagnostic]: Diagnostics.invalidDebuggerTypeDiagnostic, + [DiagnosticCodes.JustMyCodeDiagnostic]: Diagnostics.justMyCodeDiagnostic, + [DiagnosticCodes.ConsoleTypeDiagnostic]: Diagnostics.consoleTypeDiagnostic, [DiagnosticCodes.ConfigPythonPathDiagnostic]: '', }; @@ -140,7 +140,7 @@ export class InvalidLaunchJsonDebuggerService extends BaseDiagnosticsService { } const commandPrompts = [ { - prompt: Diagnostics.yesUpdateLaunch(), + prompt: Diagnostics.yesUpdateLaunch, command: { diagnostic, invoke: async (): Promise => { @@ -149,7 +149,7 @@ export class InvalidLaunchJsonDebuggerService extends BaseDiagnosticsService { }, }, { - prompt: Common.noIWillDoItLater(), + prompt: Common.noIWillDoItLater, }, ]; diff --git a/src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts b/src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts index 61460f9db701..d74cd7403e73 100644 --- a/src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts +++ b/src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts @@ -27,8 +27,8 @@ import { } from '../types'; const messages = { - [DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic]: Diagnostics.invalidPythonPathInDebuggerSettings(), - [DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic]: Diagnostics.invalidPythonPathInDebuggerLaunch(), + [DiagnosticCodes.InvalidPythonPathInDebuggerSettingsDiagnostic]: Diagnostics.invalidPythonPathInDebuggerSettings, + [DiagnosticCodes.InvalidPythonPathInDebuggerLaunchDiagnostic]: Diagnostics.invalidPythonPathInDebuggerLaunch, }; class InvalidPythonPathInDebuggerDiagnostic extends BaseDiagnostic { diff --git a/src/client/application/diagnostics/checks/jediPython27NotSupported.ts b/src/client/application/diagnostics/checks/jediPython27NotSupported.ts index cc53c49689bc..3d358325032e 100644 --- a/src/client/application/diagnostics/checks/jediPython27NotSupported.ts +++ b/src/client/application/diagnostics/checks/jediPython27NotSupported.ts @@ -53,7 +53,7 @@ export class JediPython27NotSupportedDiagnosticService extends BaseDiagnosticsSe // We don't need to check for JediLSP here, because we retrieve the setting from the configuration service, // Which already switched the JediLSP option to Jedi. if (interpreter && (interpreter.version?.major ?? 0) < 3 && languageServer === LanguageServerType.Jedi) { - return [new JediPython27NotSupportedDiagnostic(Python27Support.jediMessage(), resource)]; + return [new JediPython27NotSupportedDiagnostic(Python27Support.jediMessage, resource)]; } return []; @@ -71,10 +71,10 @@ export class JediPython27NotSupportedDiagnosticService extends BaseDiagnosticsSe const commandFactory = this.serviceContainer.get(IDiagnosticsCommandFactory); const options = [ { - prompt: Common.gotIt(), + prompt: Common.gotIt, }, { - prompt: Common.doNotShowAgain(), + prompt: Common.doNotShowAgain, command: commandFactory.createCommand(diagnostic, { type: 'ignore', options: DiagnosticScope.Global }), }, ]; diff --git a/src/client/application/diagnostics/checks/pylanceDefault.ts b/src/client/application/diagnostics/checks/pylanceDefault.ts index eec3082f8165..16ee2968c8d6 100644 --- a/src/client/application/diagnostics/checks/pylanceDefault.ts +++ b/src/client/application/diagnostics/checks/pylanceDefault.ts @@ -50,7 +50,7 @@ export class PylanceDefaultDiagnosticService extends BaseDiagnosticsService { return []; } - return [new PylanceDefaultDiagnostic(Diagnostics.pylanceDefaultMessage(), resource)]; + return [new PylanceDefaultDiagnostic(Diagnostics.pylanceDefaultMessage, resource)]; } protected async onHandle(diagnostics: IDiagnostic[]): Promise { @@ -63,7 +63,7 @@ export class PylanceDefaultDiagnosticService extends BaseDiagnosticsService { return; } - const options = [{ prompt: Common.ok() }]; + const options = [{ prompt: Common.ok }]; await this.messageService.handle(diagnostic, { commandPrompts: options, diff --git a/src/client/application/diagnostics/checks/pythonPathDeprecated.ts b/src/client/application/diagnostics/checks/pythonPathDeprecated.ts index 1cb516cd79a9..f88347f33fe4 100644 --- a/src/client/application/diagnostics/checks/pythonPathDeprecated.ts +++ b/src/client/application/diagnostics/checks/pythonPathDeprecated.ts @@ -50,7 +50,7 @@ export class PythonPathDeprecatedDiagnosticService extends BaseDiagnosticsServic const isCodeWorkspaceSettingSet = this.workspaceService.workspaceFile && setting.workspaceValue !== undefined; const isSettingsJsonSettingSet = setting.workspaceFolderValue !== undefined; if (isCodeWorkspaceSettingSet || isSettingsJsonSettingSet) { - return [new PythonPathDeprecatedDiagnostic(Diagnostics.removedPythonPathFromSettings(), resource)]; + return [new PythonPathDeprecatedDiagnostic(Diagnostics.removedPythonPathFromSettings, resource)]; } return []; } @@ -66,7 +66,7 @@ export class PythonPathDeprecatedDiagnosticService extends BaseDiagnosticsServic const commandFactory = this.serviceContainer.get(IDiagnosticsCommandFactory); const options = [ { - prompt: Common.ok(), + prompt: Common.ok, }, ]; const command = commandFactory.createCommand(diagnostic, { type: 'ignore', options: DiagnosticScope.Global }); diff --git a/src/client/application/diagnostics/checks/switchToDefaultLS.ts b/src/client/application/diagnostics/checks/switchToDefaultLS.ts index 76830ea6fdf7..bd93a684d9a2 100644 --- a/src/client/application/diagnostics/checks/switchToDefaultLS.ts +++ b/src/client/application/diagnostics/checks/switchToDefaultLS.ts @@ -56,7 +56,7 @@ export class SwitchToDefaultLanguageServerDiagnosticService extends BaseDiagnost } return Promise.resolve( - changed ? [new SwitchToDefaultLanguageServerDiagnostic(SwitchToDefaultLS.bannerMessage(), resource)] : [], + changed ? [new SwitchToDefaultLanguageServerDiagnostic(SwitchToDefaultLS.bannerMessage, resource)] : [], ); } @@ -72,7 +72,7 @@ export class SwitchToDefaultLanguageServerDiagnosticService extends BaseDiagnost await this.messageService.handle(diagnostic, { commandPrompts: [ { - prompt: Common.gotIt(), + prompt: Common.gotIt, }, ], }); diff --git a/src/client/application/diagnostics/surceMapSupportService.ts b/src/client/application/diagnostics/surceMapSupportService.ts index 02ff47375411..8ff491e4cb06 100644 --- a/src/client/application/diagnostics/surceMapSupportService.ts +++ b/src/client/application/diagnostics/surceMapSupportService.ts @@ -34,9 +34,9 @@ export class SourceMapSupportService implements ISourceMapSupportService { await this.commandManager.executeCommand('workbench.action.reloadWindow'); } protected async onEnable(): Promise { - const enableSourceMapsAndReloadVSC = Diagnostics.enableSourceMapsAndReloadVSC(); + const enableSourceMapsAndReloadVSC = Diagnostics.enableSourceMapsAndReloadVSC; const selection = await this.shell.showWarningMessage( - Diagnostics.warnBeforeEnablingSourceMaps(), + Diagnostics.warnBeforeEnablingSourceMaps, enableSourceMapsAndReloadVSC, ); if (selection === enableSourceMapsAndReloadVSC) { diff --git a/src/client/browser/extension.ts b/src/client/browser/extension.ts index 88506e95df90..cc0dc8b44f37 100644 --- a/src/client/browser/extension.ts +++ b/src/client/browser/extension.ts @@ -5,20 +5,20 @@ import * as vscode from 'vscode'; import TelemetryReporter from 'vscode-extension-telemetry'; import { LanguageClientOptions, State } from 'vscode-languageclient'; import { LanguageClient } from 'vscode-languageclient/browser'; +import * as nls from 'vscode-nls'; import { LanguageClientMiddlewareBase } from '../activation/languageClientMiddlewareBase'; import { LanguageServerType } from '../activation/types'; import { AppinsightsKey, PVSC_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../common/constants'; -import { loadLocalizedStringsForBrowser } from '../common/utils/localizeHelpers'; import { EventName } from '../telemetry/constants'; import { createStatusItem } from './intellisenseStatus'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); + interface BrowserConfig { distUrl: string; // URL to Pylance's dist folder. } export async function activate(context: vscode.ExtensionContext): Promise { - // Run in a promise and return early so that VS Code can go activate Pylance. - await loadLocalizedStringsForBrowser(); const pylanceExtension = vscode.extensions.getExtension(PYLANCE_EXTENSION_ID); if (pylanceExtension) { runPylance(context, pylanceExtension); diff --git a/src/client/browser/intellisenseStatus.ts b/src/client/browser/intellisenseStatus.ts index 89258dedac9b..b7a49e86dbb0 100644 --- a/src/client/browser/intellisenseStatus.ts +++ b/src/client/browser/intellisenseStatus.ts @@ -10,12 +10,12 @@ export function createStatusItem(): vscode.Disposable { const statusItem = vscode.languages.createLanguageStatusItem('python.projectStatus', { language: 'python', }); - statusItem.name = LanguageService.statusItem.name(); + statusItem.name = LanguageService.statusItem.name; statusItem.severity = vscode.LanguageStatusSeverity.Warning; - statusItem.text = LanguageService.statusItem.text(); - statusItem.detail = LanguageService.statusItem.detail(); + statusItem.text = LanguageService.statusItem.text; + statusItem.detail = LanguageService.statusItem.detail; statusItem.command = { - title: Common.learnMore(), + title: Common.learnMore, command: 'vscode.open', arguments: [vscode.Uri.parse('https://aka.ms/AAdzyh4')], }; diff --git a/src/client/browser/localize.ts b/src/client/browser/localize.ts index ca66b01266ac..24f2cde53c9a 100644 --- a/src/client/browser/localize.ts +++ b/src/client/browser/localize.ts @@ -6,7 +6,9 @@ /* eslint-disable @typescript-eslint/no-namespace */ // IMPORTANT: Do not import any node fs related modules here, as they do not work in browser. -import { getLocalizedString } from '../common/utils/localizeHelpers'; +import * as nls from 'vscode-nls'; + +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export namespace LanguageService { export const statusItem = { @@ -19,8 +21,3 @@ export namespace LanguageService { export namespace Common { export const learnMore = localize('Common.learnMore', 'Learn more'); } - -function localize(key: string, defValue?: string) { - // Return a pointer to function so that we refetch it on each call. - return (): string => getLocalizedString(key, defValue); -} diff --git a/src/client/common/application/commands/reloadCommand.ts b/src/client/common/application/commands/reloadCommand.ts index fa07f212c5db..ebad15dbb70d 100644 --- a/src/client/common/application/commands/reloadCommand.ts +++ b/src/client/common/application/commands/reloadCommand.ts @@ -23,8 +23,8 @@ export class ReloadVSCodeCommandHandler implements IExtensionSingleActivationSer this.commandManager.registerCommand('python.reloadVSCode', this.onReloadVSCode, this); } private async onReloadVSCode(message: string) { - const item = await this.appShell.showInformationMessage(message, Common.reload()); - if (item === Common.reload()) { + const item = await this.appShell.showInformationMessage(message, Common.reload); + if (item === Common.reload) { this.commandManager.executeCommand('workbench.action.reloadWindow').then(noop, noop); } } diff --git a/src/client/common/cancellation.ts b/src/client/common/cancellation.ts index 20878993b6e3..c820c1ad4324 100644 --- a/src/client/common/cancellation.ts +++ b/src/client/common/cancellation.ts @@ -11,7 +11,7 @@ import * as localize from './utils/localize'; */ export class CancellationError extends Error { constructor() { - super(localize.Common.canceled()); + super(localize.Common.canceled); } } /** diff --git a/src/client/common/experiments/service.ts b/src/client/common/experiments/service.ts index 3b989ce4e85c..61fae29877d6 100644 --- a/src/client/common/experiments/service.ts +++ b/src/client/common/experiments/service.ts @@ -162,7 +162,7 @@ export class ExperimentService implements IExperimentService { if (this._optOutFrom.includes('All')) { // We prioritize opt out first - traceLog(Experiments.optedOutOf().format('All')); + traceLog(Experiments.optedOutOf.format('All')); // Since we are in the Opt Out all case, this means when checking for experiment we // short circuit and return. So, printing out additional experiment info might cause @@ -171,7 +171,7 @@ export class ExperimentService implements IExperimentService { } if (this._optInto.includes('All')) { // Only if 'All' is not in optOut then check if it is in Opt In. - traceLog(Experiments.inGroup().format('All')); + traceLog(Experiments.inGroup.format('All')); // Similar to the opt out case. If user is opting into to all experiments we short // circuit the experiment checks. So, skip printing any additional details to the logs. @@ -182,14 +182,14 @@ export class ExperimentService implements IExperimentService { this._optOutFrom .filter((exp) => exp !== 'All' && exp.toLowerCase().startsWith('python')) .forEach((exp) => { - traceLog(Experiments.optedOutOf().format(exp)); + traceLog(Experiments.optedOutOf.format(exp)); }); // Log experiments that users manually opt into, these are experiments which are added using the exp framework. this._optInto .filter((exp) => exp !== 'All' && exp.toLowerCase().startsWith('python')) .forEach((exp) => { - traceLog(Experiments.inGroup().format(exp)); + traceLog(Experiments.inGroup.format(exp)); }); if (!experimentsDisabled) { @@ -202,7 +202,7 @@ export class ExperimentService implements IExperimentService { !this._optOutFrom.includes(exp) && !this._optInto.includes(exp) ) { - traceLog(Experiments.inGroup().format(exp)); + traceLog(Experiments.inGroup.format(exp)); } }); } diff --git a/src/client/common/installer/channelManager.ts b/src/client/common/installer/channelManager.ts index 76624aaddfb9..d2950859ab80 100644 --- a/src/client/common/installer/channelManager.ts +++ b/src/client/common/installer/channelManager.ts @@ -85,9 +85,9 @@ export class InstallationChannelManager implements IInstallationChannelManager { const search = 'Search for help'; let result: string | undefined; if (interpreter.envType === EnvironmentType.Conda) { - result = await appShell.showErrorMessage(Installer.noCondaOrPipInstaller(), Installer.searchForHelp()); + result = await appShell.showErrorMessage(Installer.noCondaOrPipInstaller, Installer.searchForHelp); } else { - result = await appShell.showErrorMessage(Installer.noPipInstaller(), Installer.searchForHelp()); + result = await appShell.showErrorMessage(Installer.noPipInstaller, Installer.searchForHelp); } if (result === search) { const platform = this.serviceContainer.get(IPlatformService); diff --git a/src/client/common/installer/moduleInstaller.ts b/src/client/common/installer/moduleInstaller.ts index e859eeb2e900..61648a1c7272 100644 --- a/src/client/common/installer/moduleInstaller.ts +++ b/src/client/common/installer/moduleInstaller.ts @@ -128,7 +128,7 @@ export abstract class ModuleInstaller implements IModuleInstaller { const options: ProgressOptions = { location: ProgressLocation.Notification, cancellable: true, - title: Products.installingModule().format(name), + title: Products.installingModule.format(name), }; await shell.withProgress(options, async (_, token: CancellationToken) => install(wrapCancellationTokens(token, cancel)), diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index 4ff1371a8ff4..99ab4f6b077b 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -249,16 +249,16 @@ export class FormatterInstaller extends BaseInstaller { const formatterNames = formatters.map((formatter) => ProductNames.get(formatter)!); const productName = ProductNames.get(product)!; formatterNames.splice(formatterNames.indexOf(productName), 1); - const useOptions = formatterNames.map((name) => Products.useFormatter().format(name)); - const yesChoice = Common.bannerLabelYes(); + const useOptions = formatterNames.map((name) => Products.useFormatter.format(name)); + const yesChoice = Common.bannerLabelYes; - const options = [...useOptions, Common.doNotShowAgain()]; - let message = Products.formatterNotInstalled().format(productName); + const options = [...useOptions, Common.doNotShowAgain]; + let message = Products.formatterNotInstalled.format(productName); if (this.isExecutableAModule(product, resource)) { options.splice(0, 0, yesChoice); } else { const executable = this.getExecutableNameFromSettings(product, resource); - message = Products.invalidFormatterPath().format(productName, executable); + message = Products.invalidFormatterPath.format(productName, executable); } const item = await this.appShell.showErrorMessage(message, ...options); @@ -266,7 +266,7 @@ export class FormatterInstaller extends BaseInstaller { return this.install(product, resource, cancel); } - if (item === Common.doNotShowAgain()) { + if (item === Common.doNotShowAgain) { neverShowAgain.updateValue(true); return InstallerResponse.Ignore; } @@ -316,10 +316,10 @@ export class LinterInstaller extends BaseInstaller { private async oldPromptForInstallation(product: Product, resource?: Uri, cancel?: CancellationToken) { const productName = ProductNames.get(product)!; - const install = Common.install(); - const doNotShowAgain = Common.doNotShowAgain(); + const { install } = Common; + const { doNotShowAgain } = Common; const disableLinterInstallPromptKey = `${productName}_DisableLinterInstallPrompt`; - const selectLinter = Linters.selectLinter(); + const { selectLinter } = Linters; if (this.getStoredResponse(disableLinterInstallPromptKey) === true) { return InstallerResponse.Ignore; @@ -501,7 +501,7 @@ export class DataScienceInstaller extends BaseInstaller { const installerModule: IModuleInstaller | undefined = channels.find((v) => v.type === requiredInstaller); if (!installerModule) { - this.appShell.showErrorMessage(Installer.couldNotInstallLibrary().format(moduleName)).then(noop, noop); + this.appShell.showErrorMessage(Installer.couldNotInstallLibrary.format(moduleName)).then(noop, noop); sendTelemetryEvent(EventName.PYTHON_INSTALL_PACKAGE, undefined, { installer: 'unavailable', requiredInstaller, @@ -541,7 +541,7 @@ export class DataScienceInstaller extends BaseInstaller { ): Promise { const productName = ProductNames.get(product)!; const item = await this.appShell.showErrorMessage( - Installer.dataScienceInstallPrompt().format(productName), + Installer.dataScienceInstallPrompt.format(productName), 'Yes', 'No', ); diff --git a/src/client/common/net/fileDownloader.ts b/src/client/common/net/fileDownloader.ts index 6b0da675b0d3..2e147a280023 100644 --- a/src/client/common/net/fileDownloader.ts +++ b/src/client/common/net/fileDownloader.ts @@ -22,7 +22,7 @@ export class FileDownloader implements IFileDownloader { @inject(IApplicationShell) private readonly appShell: IApplicationShell, ) {} public async downloadFile(uri: string, options: DownloadOptions): Promise { - traceLog(Http.downloadingFile().format(uri)); + traceLog(Http.downloadingFile.format(uri)); const tempFile = await this.fs.createTemporaryFile(options.extension); await this.downloadFileWithStatusBarProgress(uri, options.progressMessagePrefix, tempFile.filePath).then( @@ -97,7 +97,7 @@ function formatProgressMessageWithState(progressMessagePrefix: string, state: Re const total = Math.round(state.size.total / 1024); const percentage = Math.round(100 * state.percent); - return Http.downloadingFileProgress().format( + return Http.downloadingFileProgress.format( progressMessagePrefix, received.toString(), total.toString(), diff --git a/src/client/common/process/logger.ts b/src/client/common/process/logger.ts index 827cd031991b..cf8014cb18d7 100644 --- a/src/client/common/process/logger.ts +++ b/src/client/common/process/logger.ts @@ -27,7 +27,7 @@ export class ProcessLogger implements IProcessLogger { : fileOrCommand; const info = [`> ${this.getDisplayCommands(command)}`]; if (options && options.cwd) { - info.push(`${Logging.currentWorkingDirectory()} ${this.getDisplayCommands(options.cwd)}`); + info.push(`${Logging.currentWorkingDirectory} ${this.getDisplayCommands(options.cwd)}`); } info.forEach((line) => { diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 327db695ef12..78aae1b0b043 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -3,8 +3,9 @@ 'use strict'; -import { FileSystem } from '../platform/fileSystem'; -import { getLocalizedString, loadLocalizedStringsUsingNodeFS, shouldLoadUsingNodeFS } from './localizeHelpers'; +import * as nls from 'vscode-nls'; + +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ @@ -386,129 +387,159 @@ export namespace Products { } export namespace DebugConfigStrings { export const selectConfiguration = { - title: localize('debug.selectConfigurationTitle'), - placeholder: localize('debug.selectConfigurationPlaceholder'), + title: localize('debug.selectConfigurationTitle', 'Select a debug configuration'), + placeholder: localize('debug.selectConfigurationPlaceholder', 'Debug Configuration'), }; export const launchJsonCompletions = { - label: localize('debug.launchJsonConfigurationsCompletionLabel'), - description: localize('debug.launchJsonConfigurationsCompletionDescription'), + label: localize('debug.launchJsonConfigurationsCompletionLabel', 'Python'), + description: localize( + 'debug.launchJsonConfigurationsCompletionDescription', + 'Select a Python debug configuration', + ), }; export namespace file { export const snippet = { - name: localize('python.snippet.launch.standard.label'), + name: localize('python.snippet.launch.standard.label', 'Python: Current File'), }; export const selectConfiguration = { - label: localize('debug.debugFileConfigurationLabel'), - description: localize('debug.debugFileConfigurationDescription'), + label: localize('debug.debugFileConfigurationLabel', 'Python File'), + description: localize('debug.debugFileConfigurationDescription', 'Debug the currently active Python file'), }; } export namespace module { export const snippet = { - name: localize('python.snippet.launch.module.label'), - default: localize('python.snippet.launch.module.default'), + name: localize('python.snippet.launch.module.label', 'Python: Module'), + default: localize('python.snippet.launch.module.default', 'enter-your-module-name'), }; export const selectConfiguration = { - label: localize('debug.debugModuleConfigurationLabel'), - description: localize('debug.debugModuleConfigurationDescription'), + label: localize('debug.debugModuleConfigurationLabel', 'Module'), + description: localize( + 'debug.debugModuleConfigurationDescription', + "Debug a Python module by invoking it with '-m'", + ), }; export const enterModule = { - title: localize('debug.moduleEnterModuleTitle'), - prompt: localize('debug.moduleEnterModulePrompt'), - default: localize('debug.moduleEnterModuleDefault'), - invalid: localize('debug.moduleEnterModuleInvalidNameError'), + title: localize('debug.moduleEnterModuleTitle', 'Debug Module'), + prompt: localize('debug.moduleEnterModulePrompt', 'Enter a Python module/package name'), + default: localize('debug.moduleEnterModuleDefault', 'enter-your-module-name'), + invalid: localize('debug.moduleEnterModuleInvalidNameError', 'Enter a valid module name'), }; } export namespace attach { export const snippet = { - name: localize('python.snippet.launch.attach.label'), + name: localize('python.snippet.launch.attach.label', 'Python: Remote Attach'), }; export const selectConfiguration = { - label: localize('debug.remoteAttachConfigurationLabel'), - description: localize('debug.remoteAttachConfigurationDescription'), + label: localize('debug.remoteAttachConfigurationLabel', 'Remote Attach'), + description: localize('debug.remoteAttachConfigurationDescription', 'Attach to a remote debug server'), }; export const enterRemoteHost = { - title: localize('debug.attachRemoteHostTitle'), - prompt: localize('debug.attachRemoteHostPrompt'), - invalid: localize('debug.attachRemoteHostValidationError'), + title: localize('debug.attachRemoteHostTitle', 'Remote Debugging'), + prompt: localize('debug.attachRemoteHostPrompt', 'Enter a valid host name or IP address'), + invalid: localize('debug.attachRemoteHostValidationError', 'Enter a valid host name or IP address'), }; export const enterRemotePort = { - title: localize('debug.attachRemotePortTitle'), - prompt: localize('debug.attachRemotePortPrompt'), - invalid: localize('debug.attachRemotePortValidationError'), + title: localize('debug.attachRemotePortTitle', 'Remote Debugging'), + prompt: localize( + 'debug.attachRemotePortPrompt', + 'Enter the port number that the debug server is listening on', + ), + invalid: localize('debug.attachRemotePortValidationError', 'Enter a valid port number'), }; } export namespace attachPid { export const snippet = { - name: localize('python.snippet.launch.attachpid.label'), + name: localize('python.snippet.launch.attachpid.label', 'Python: Attach using Process Id'), }; export const selectConfiguration = { - label: localize('debug.attachPidConfigurationLabel'), - description: localize('debug.attachPidConfigurationDescription'), + label: localize('debug.attachPidConfigurationLabel', 'Attach using Process ID'), + description: localize('debug.attachPidConfigurationDescription', 'Attach to a local process'), }; } export namespace django { export const snippet = { - name: localize('python.snippet.launch.django.label'), + name: localize('python.snippet.launch.django.label', 'Python: Django'), }; export const selectConfiguration = { - label: localize('debug.debugDjangoConfigurationLabel'), - description: localize('debug.debugDjangoConfigurationDescription'), + label: localize('debug.debugDjangoConfigurationLabel', 'Django'), + description: localize( + 'debug.debugDjangoConfigurationDescription', + 'Launch and debug a Django web application', + ), }; export const enterManagePyPath = { - title: localize('debug.djangoEnterManagePyPathTitle'), - prompt: localize('debug.djangoEnterManagePyPathPrompt'), - invalid: localize('debug.djangoEnterManagePyPathInvalidFilePathError'), + title: localize('debug.djangoEnterManagePyPathTitle', 'Debug Django'), + prompt: localize( + 'debug.djangoEnterManagePyPathPrompt', + "Enter the path to manage.py ('${workspaceFolderToken}' points to the root of the current workspace folder)", + ), + invalid: localize('debug.djangoEnterManagePyPathInvalidFilePathError', 'Enter a valid Python file path'), }; } export namespace fastapi { export const snippet = { - name: localize('python.snippet.launch.fastapi.label'), + name: localize('python.snippet.launch.fastapi.label', 'Python: FastAPI'), }; export const selectConfiguration = { - label: localize('debug.debugFastAPIConfigurationLabel'), - description: localize('debug.debugFastAPIConfigurationDescription'), + label: localize('debug.debugFastAPIConfigurationLabel', 'FastAPI'), + description: localize( + 'debug.debugFastAPIConfigurationDescription', + 'Launch and debug a FastAPI web application', + ), }; export const enterAppPathOrNamePath = { - title: localize('debug.fastapiEnterAppPathOrNamePathTitle'), - prompt: localize('debug.fastapiEnterAppPathOrNamePathPrompt'), - invalid: localize('debug.fastapiEnterAppPathOrNamePathInvalidNameError'), + title: localize('debug.fastapiEnterAppPathOrNamePathTitle', 'Debug FastAPI'), + prompt: localize( + 'debug.fastapiEnterAppPathOrNamePathPrompt', + "Enter the path to the application, e.g. 'main.py' or 'main'", + ), + invalid: localize('debug.fastapiEnterAppPathOrNamePathInvalidNameError', 'Enter a valid name'), }; } export namespace flask { export const snippet = { - name: localize('python.snippet.launch.flask.label'), + name: localize('python.snippet.launch.flask.label', 'Python: Flask'), }; export const selectConfiguration = { - label: localize('debug.debugFlaskConfigurationLabel'), - description: localize('debug.debugFlaskConfigurationDescription'), + label: localize('debug.debugFlaskConfigurationLabel', 'Flask'), + description: localize( + 'debug.debugFlaskConfigurationDescription', + 'Launch and debug a Flask web application', + ), }; export const enterAppPathOrNamePath = { - title: localize('debug.flaskEnterAppPathOrNamePathTitle'), - prompt: localize('debug.flaskEnterAppPathOrNamePathPrompt'), - invalid: localize('debug.flaskEnterAppPathOrNamePathInvalidNameError'), + title: localize('debug.flaskEnterAppPathOrNamePathTitle', 'Debug Flask'), + prompt: localize('debug.flaskEnterAppPathOrNamePathPrompt', 'Python: Flask'), + invalid: localize('debug.flaskEnterAppPathOrNamePathInvalidNameError', 'Enter a valid name'), }; } export namespace pyramid { export const snippet = { - name: localize('python.snippet.launch.pyramid.label'), + name: localize('python.snippet.launch.pyramid.label', 'Python: Pyramid Application'), }; export const selectConfiguration = { - label: localize('debug.debugPyramidConfigurationLabel'), - description: localize('debug.debugPyramidConfigurationDescription'), + label: localize('debug.debugPyramidConfigurationLabel', 'Pyramid'), + description: localize( + 'debug.debugPyramidConfigurationDescription', + 'Launch and debug a Pyramid web application', + ), }; export const enterDevelopmentIniPath = { - title: localize('debug.pyramidEnterDevelopmentIniPathTitle'), - prompt: localize('debug.pyramidEnterDevelopmentIniPathPrompt'), - invalid: localize('debug.pyramidEnterDevelopmentIniPathInvalidFilePathError'), + title: localize('debug.pyramidEnterDevelopmentIniPathTitle', 'Debug Pyramid'), + prompt: localize( + 'debug.pyramidEnterDevelopmentIniPathPrompt', + "`Enter the path to development.ini ('${workspaceFolderToken}' points to the root of the current workspace folder)`", + ), + invalid: localize('debug.pyramidEnterDevelopmentIniPathInvalidFilePathError', 'Enter a valid file path'), }; } } @@ -544,18 +575,3 @@ export namespace SwitchToDefaultLS { "The Microsoft Python Language Server has reached end of life. Your language server has been set to the default for Python in VS Code, Pylance.\n\nIf you'd like to change your language server, you can learn about how to do so [here](https://devblogs.microsoft.com/python/python-in-visual-studio-code-may-2021-release/#configuring-your-language-server).\n\nRead Pylance's license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license).", ); } - -function localize(key: string, defValue?: string) { - // Return a pointer to function so that we refetch it on each call. - return (): string => getString(key, defValue); -} - -function getString(key: string, defValue?: string) { - if (shouldLoadUsingNodeFS()) { - loadLocalizedStringsUsingNodeFS(new FileSystem()); - } - return getLocalizedString(key, defValue); -} - -// Default to loading the current locale -loadLocalizedStringsUsingNodeFS(new FileSystem()); diff --git a/src/client/common/utils/localizeHelpers.ts b/src/client/common/utils/localizeHelpers.ts deleted file mode 100644 index 5a4eed6d98e6..000000000000 --- a/src/client/common/utils/localizeHelpers.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -// IMPORTANT: Do not import any node fs related modules here, as they do not work in browser. - -import * as vscode from 'vscode'; -import * as path from 'path'; -import { EXTENSION_ROOT_DIR } from '../../constants'; -import { IFileSystem } from '../platform/types'; - -// Skip using vscode-nls and instead just compute our strings based on key values. Key values -// can be loaded out of the nls..json files -let loadedCollection: Record | undefined; -let defaultCollection: Record | undefined; -let askedForCollection: Record = {}; -let loadedLocale: string; - -// This is exported only for testing purposes. -export function _resetCollections(): void { - loadedLocale = ''; - loadedCollection = undefined; - askedForCollection = {}; -} - -// This is exported only for testing purposes. -export function _getAskedForCollection(): Record { - return askedForCollection; -} - -export function shouldLoadUsingNodeFS(): boolean { - return !loadedCollection || parseLocale() !== loadedLocale; -} - -declare let navigator: { language: string } | undefined; - -function parseLocale(): string { - try { - if (navigator?.language) { - return navigator.language.toLowerCase(); - } - } catch { - // Fall through - } - // Attempt to load from the vscode locale. If not there, use english - const vscodeConfigString = process.env.VSCODE_NLS_CONFIG; - return vscodeConfigString ? JSON.parse(vscodeConfigString).locale : 'en-us'; -} - -export function getLocalizedString(key: string, defValue?: string): string { - // The default collection (package.nls.json) is the fallback. - // Note that we are guaranteed the following (during shipping) - // 1. defaultCollection was initialized by the load() call above - // 2. defaultCollection has the key (see the "keys exist" test) - let collection = defaultCollection; - - // Use the current locale if the key is defined there. - if (loadedCollection && loadedCollection.hasOwnProperty(key)) { - collection = loadedCollection; - } - if (collection === undefined) { - throw new Error(`Localizations haven't been loaded yet for key: ${key}`); - } - let result = collection[key]; - if (!result && defValue) { - // This can happen during development if you haven't fixed up the nls file yet or - // if for some reason somebody broke the functional test. - result = defValue; - } - askedForCollection[key] = result; - - return result; -} - -/** - * Can be used to synchronously load localized strings, useful if we want localized strings at module level itself. - * Cannot be used in VSCode web or any browser. Must be called before any use of the locale. - */ -export function loadLocalizedStringsUsingNodeFS(fs: IFileSystem): void { - // Figure out our current locale. - loadedLocale = parseLocale(); - - // Find the nls file that matches (if there is one) - const nlsFile = path.join(EXTENSION_ROOT_DIR, `package.nls.${loadedLocale}.json`); - if (fs.fileExistsSync(nlsFile)) { - const contents = fs.readFileSync(nlsFile); - loadedCollection = JSON.parse(contents); - } else { - // If there isn't one, at least remember that we looked so we don't try to load a second time - loadedCollection = {}; - } - - // Get the default collection if necessary. Strings may be in the default or the locale json - if (!defaultCollection) { - const defaultNlsFile = path.join(EXTENSION_ROOT_DIR, 'package.nls.json'); - if (fs.fileExistsSync(defaultNlsFile)) { - const contents = fs.readFileSync(defaultNlsFile); - defaultCollection = JSON.parse(contents); - } else { - defaultCollection = {}; - } - } -} - -/** - * Only uses the VSCode APIs to query filesystem and not the node fs APIs, as - * they're not available in browser. Must be called before any use of the locale. - */ -export async function loadLocalizedStringsForBrowser(): Promise { - // Figure out our current locale. - loadedLocale = parseLocale(); - - loadedCollection = await parseNLS(loadedLocale); - - // Get the default collection if necessary. Strings may be in the default or the locale json - if (!defaultCollection) { - defaultCollection = await parseNLS(); - } -} - -async function parseNLS(locale?: string) { - try { - const filename = locale ? `package.nls.${locale}.json` : `package.nls.json`; - const nlsFile = vscode.Uri.joinPath(vscode.Uri.file(EXTENSION_ROOT_DIR), filename); - const buffer = await vscode.workspace.fs.readFile(nlsFile); - const contents = new TextDecoder().decode(buffer); - return JSON.parse(contents); - } catch { - // If there isn't one, at least remember that we looked so we don't try to load a second time. - return {}; - } -} diff --git a/src/client/debugger/extension/adapter/outdatedDebuggerPrompt.ts b/src/client/debugger/extension/adapter/outdatedDebuggerPrompt.ts index a492dd85a33b..c86f3a9ef206 100644 --- a/src/client/debugger/extension/adapter/outdatedDebuggerPrompt.ts +++ b/src/client/debugger/extension/adapter/outdatedDebuggerPrompt.ts @@ -22,9 +22,9 @@ class OutdatedDebuggerPrompt implements DebugAdapterTracker { public onDidSendMessage(message: DebugProtocol.ProtocolMessage) { if (this.promptCheck.shouldShowPrompt() && this.isPtvsd(message)) { - const prompts = [Common.moreInfo()]; + const prompts = [Common.moreInfo]; this.appShell - .showInformationMessage(OutdatedDebugger.outdatedDebuggerMessage(), ...prompts) + .showInformationMessage(OutdatedDebugger.outdatedDebuggerMessage, ...prompts) .then((selection) => { if (selection === prompts[0]) { this.browserService.launch('https://aka.ms/migrateToDebugpy'); diff --git a/src/client/debugger/extension/attachQuickPick/picker.ts b/src/client/debugger/extension/attachQuickPick/picker.ts index a2a995c6848e..a296a9b3163a 100644 --- a/src/client/debugger/extension/attachQuickPick/picker.ts +++ b/src/client/debugger/extension/attachQuickPick/picker.ts @@ -23,12 +23,12 @@ export class AttachPicker implements IAttachPicker { const refreshButton = { iconPath: getIcon(REFRESH_BUTTON_ICON), - tooltip: AttachProcess.refreshList(), + tooltip: AttachProcess.refreshList, }; const quickPick = this.applicationShell.createQuickPick(); - quickPick.title = AttachProcess.attachTitle(); - quickPick.placeholder = AttachProcess.selectProcessPlaceholder(); + quickPick.title = AttachProcess.attachTitle; + quickPick.placeholder = AttachProcess.selectProcessPlaceholder; quickPick.canSelectMany = false; quickPick.matchOnDescription = true; quickPick.matchOnDetail = true; @@ -51,7 +51,7 @@ export class AttachPicker implements IAttachPicker { quickPick.onDidAccept( () => { if (quickPick.selectedItems.length !== 1) { - reject(new Error(AttachProcess.noProcessSelected())); + reject(new Error(AttachProcess.noProcessSelected)); } const selectedId = quickPick.selectedItems[0].id; @@ -70,7 +70,7 @@ export class AttachPicker implements IAttachPicker { disposables.forEach((item) => item.dispose()); quickPick.dispose(); - reject(new Error(AttachProcess.noProcessSelected())); + reject(new Error(AttachProcess.noProcessSelected)); }, undefined, disposables, diff --git a/src/client/debugger/extension/attachQuickPick/provider.ts b/src/client/debugger/extension/attachQuickPick/provider.ts index ad6ccafee530..ff39d712ad2a 100644 --- a/src/client/debugger/extension/attachQuickPick/provider.ts +++ b/src/client/debugger/extension/attachQuickPick/provider.ts @@ -69,7 +69,7 @@ export class AttachProcessProvider implements IAttachProcessProvider { } else if (this.platformService.isWindows) { processCmd = WmicProcessParser.wmicCommand; } else { - throw new Error(AttachProcessLocalization.unsupportedOS().format(this.platformService.osType)); + throw new Error(AttachProcessLocalization.unsupportedOS.format(this.platformService.osType)); } const processService = await this.processServiceFactory.create(); diff --git a/src/client/debugger/extension/configuration/debugConfigurationService.ts b/src/client/debugger/extension/configuration/debugConfigurationService.ts index 2de0fc682d55..103fd15969f5 100644 --- a/src/client/debugger/extension/configuration/debugConfigurationService.ts +++ b/src/client/debugger/extension/configuration/debugConfigurationService.ts @@ -108,44 +108,44 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi type DebugConfigurationQuickPickItem = QuickPickItem & { type: DebugConfigurationType }; const items: DebugConfigurationQuickPickItem[] = [ { - label: DebugConfigStrings.file.selectConfiguration.label(), + label: DebugConfigStrings.file.selectConfiguration.label, type: DebugConfigurationType.launchFile, - description: DebugConfigStrings.file.selectConfiguration.description(), + description: DebugConfigStrings.file.selectConfiguration.description, }, { - label: DebugConfigStrings.module.selectConfiguration.label(), + label: DebugConfigStrings.module.selectConfiguration.label, type: DebugConfigurationType.launchModule, - description: DebugConfigStrings.module.selectConfiguration.description(), + description: DebugConfigStrings.module.selectConfiguration.description, }, { - label: DebugConfigStrings.attach.selectConfiguration.label(), + label: DebugConfigStrings.attach.selectConfiguration.label, type: DebugConfigurationType.remoteAttach, - description: DebugConfigStrings.attach.selectConfiguration.description(), + description: DebugConfigStrings.attach.selectConfiguration.description, }, { - label: DebugConfigStrings.attachPid.selectConfiguration.label(), + label: DebugConfigStrings.attachPid.selectConfiguration.label, type: DebugConfigurationType.pidAttach, - description: DebugConfigStrings.attachPid.selectConfiguration.description(), + description: DebugConfigStrings.attachPid.selectConfiguration.description, }, { - label: DebugConfigStrings.django.selectConfiguration.label(), + label: DebugConfigStrings.django.selectConfiguration.label, type: DebugConfigurationType.launchDjango, - description: DebugConfigStrings.django.selectConfiguration.description(), + description: DebugConfigStrings.django.selectConfiguration.description, }, { - label: DebugConfigStrings.fastapi.selectConfiguration.label(), + label: DebugConfigStrings.fastapi.selectConfiguration.label, type: DebugConfigurationType.launchFastAPI, - description: DebugConfigStrings.fastapi.selectConfiguration.description(), + description: DebugConfigStrings.fastapi.selectConfiguration.description, }, { - label: DebugConfigStrings.flask.selectConfiguration.label(), + label: DebugConfigStrings.flask.selectConfiguration.label, type: DebugConfigurationType.launchFlask, - description: DebugConfigStrings.flask.selectConfiguration.description(), + description: DebugConfigStrings.flask.selectConfiguration.description, }, { - label: DebugConfigStrings.pyramid.selectConfiguration.label(), + label: DebugConfigStrings.pyramid.selectConfiguration.label, type: DebugConfigurationType.launchPyramid, - description: DebugConfigStrings.pyramid.selectConfiguration.description(), + description: DebugConfigStrings.pyramid.selectConfiguration.description, }, ]; state.config = {}; @@ -153,8 +153,8 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi DebugConfigurationQuickPickItem, IQuickPickParameters >({ - title: DebugConfigStrings.selectConfiguration.title(), - placeholder: DebugConfigStrings.selectConfiguration.placeholder(), + title: DebugConfigStrings.selectConfiguration.title, + placeholder: DebugConfigStrings.selectConfiguration.placeholder, activeItem: items[0], items: items, }); diff --git a/src/client/debugger/extension/configuration/launch.json/completionProvider.ts b/src/client/debugger/extension/configuration/launch.json/completionProvider.ts index da6595c5bb2a..d89201b940ee 100644 --- a/src/client/debugger/extension/configuration/launch.json/completionProvider.ts +++ b/src/client/debugger/extension/configuration/launch.json/completionProvider.ts @@ -54,14 +54,14 @@ export class LaunchJsonCompletionProvider implements CompletionItemProvider, IEx { command: { command: 'python.SelectAndInsertDebugConfiguration', - title: DebugConfigStrings.launchJsonCompletions.description(), + title: DebugConfigStrings.launchJsonCompletions.description, arguments: [document, position, token], }, - documentation: DebugConfigStrings.launchJsonCompletions.description(), + documentation: DebugConfigStrings.launchJsonCompletions.description, sortText: 'AAAA', preselect: true, kind: CompletionItemKind.Enum, - label: DebugConfigStrings.launchJsonCompletions.label(), + label: DebugConfigStrings.launchJsonCompletions.label, insertText: new SnippetString(), }, ]; diff --git a/src/client/debugger/extension/configuration/providers/djangoLaunch.ts b/src/client/debugger/extension/configuration/providers/djangoLaunch.ts index 3ea7039e82f8..0b80f9e0cf14 100644 --- a/src/client/debugger/extension/configuration/providers/djangoLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/djangoLaunch.ts @@ -32,7 +32,7 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati let manuallyEnteredAValue: boolean | undefined; const defaultProgram = `${workspaceFolderToken}${this.pathUtils.separator}manage.py`; const config: Partial = { - name: DebugConfigStrings.django.snippet.name(), + name: DebugConfigStrings.django.snippet.name, type: DebuggerTypeName, request: 'launch', program: program || defaultProgram, @@ -42,9 +42,9 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati }; if (!program) { const selectedProgram = await input.showInputBox({ - title: DebugConfigStrings.django.enterManagePyPath.title(), + title: DebugConfigStrings.django.enterManagePyPath.title, value: defaultProgram, - prompt: DebugConfigStrings.django.enterManagePyPath.prompt(), + prompt: DebugConfigStrings.django.enterManagePyPath.prompt, validate: (value) => this.validateManagePy(state.folder, defaultProgram, value), }); if (selectedProgram) { @@ -65,7 +65,7 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati defaultValue: string, selected?: string, ): Promise { - const error = DebugConfigStrings.django.enterManagePyPath.invalid(); + const error = DebugConfigStrings.django.enterManagePyPath.invalid; if (!selected || selected.trim().length === 0) { return error; } diff --git a/src/client/debugger/extension/configuration/providers/fastapiLaunch.ts b/src/client/debugger/extension/configuration/providers/fastapiLaunch.ts index 5e7c09177b21..a534ec21379c 100644 --- a/src/client/debugger/extension/configuration/providers/fastapiLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/fastapiLaunch.ts @@ -25,7 +25,7 @@ export class FastAPILaunchDebugConfigurationProvider implements IDebugConfigurat const application = await this.getApplicationPath(state.folder); let manuallyEnteredAValue: boolean | undefined; const config: Partial = { - name: DebugConfigStrings.fastapi.snippet.name(), + name: DebugConfigStrings.fastapi.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'uvicorn', @@ -36,14 +36,14 @@ export class FastAPILaunchDebugConfigurationProvider implements IDebugConfigurat if (!application) { const selectedPath = await input.showInputBox({ - title: DebugConfigStrings.fastapi.enterAppPathOrNamePath.title(), + title: DebugConfigStrings.fastapi.enterAppPathOrNamePath.title, value: 'main.py', - prompt: DebugConfigStrings.fastapi.enterAppPathOrNamePath.prompt(), + prompt: DebugConfigStrings.fastapi.enterAppPathOrNamePath.prompt, validate: (value) => Promise.resolve( value && value.trim().length > 0 ? undefined - : DebugConfigStrings.fastapi.enterAppPathOrNamePath.invalid(), + : DebugConfigStrings.fastapi.enterAppPathOrNamePath.invalid, ), }); if (selectedPath) { diff --git a/src/client/debugger/extension/configuration/providers/fileLaunch.ts b/src/client/debugger/extension/configuration/providers/fileLaunch.ts index a6cfcc42cbc9..d6d51cb0528c 100644 --- a/src/client/debugger/extension/configuration/providers/fileLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/fileLaunch.ts @@ -21,7 +21,7 @@ export class FileLaunchDebugConfigurationProvider implements IDebugConfiguration ) public async buildConfiguration(_input: MultiStepInput, state: DebugConfigurationState) { const config: Partial = { - name: DebugConfigStrings.file.snippet.name(), + name: DebugConfigStrings.file.snippet.name, type: DebuggerTypeName, request: 'launch', program: '${file}', diff --git a/src/client/debugger/extension/configuration/providers/flaskLaunch.ts b/src/client/debugger/extension/configuration/providers/flaskLaunch.ts index 69d4019dd55a..07d5522f27ca 100644 --- a/src/client/debugger/extension/configuration/providers/flaskLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/flaskLaunch.ts @@ -25,7 +25,7 @@ export class FlaskLaunchDebugConfigurationProvider implements IDebugConfiguratio const application = await this.getApplicationPath(state.folder); let manuallyEnteredAValue: boolean | undefined; const config: Partial = { - name: DebugConfigStrings.flask.snippet.name(), + name: DebugConfigStrings.flask.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'flask', @@ -40,14 +40,14 @@ export class FlaskLaunchDebugConfigurationProvider implements IDebugConfiguratio if (!application) { const selectedApp = await input.showInputBox({ - title: DebugConfigStrings.flask.enterAppPathOrNamePath.title(), + title: DebugConfigStrings.flask.enterAppPathOrNamePath.title, value: 'app.py', - prompt: DebugConfigStrings.flask.enterAppPathOrNamePath.prompt(), + prompt: DebugConfigStrings.flask.enterAppPathOrNamePath.prompt, validate: (value) => Promise.resolve( value && value.trim().length > 0 ? undefined - : DebugConfigStrings.flask.enterAppPathOrNamePath.invalid(), + : DebugConfigStrings.flask.enterAppPathOrNamePath.invalid, ), }); if (selectedApp) { diff --git a/src/client/debugger/extension/configuration/providers/moduleLaunch.ts b/src/client/debugger/extension/configuration/providers/moduleLaunch.ts index 972633282b7c..9134655e1143 100644 --- a/src/client/debugger/extension/configuration/providers/moduleLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/moduleLaunch.ts @@ -17,19 +17,19 @@ export class ModuleLaunchDebugConfigurationProvider implements IDebugConfigurati public async buildConfiguration(input: MultiStepInput, state: DebugConfigurationState) { let manuallyEnteredAValue: boolean | undefined; const config: Partial = { - name: DebugConfigStrings.module.snippet.name(), + name: DebugConfigStrings.module.snippet.name, type: DebuggerTypeName, request: 'launch', - module: DebugConfigStrings.module.snippet.default(), + module: DebugConfigStrings.module.snippet.default, justMyCode: true, }; const selectedModule = await input.showInputBox({ - title: DebugConfigStrings.module.enterModule.title(), - value: config.module || DebugConfigStrings.module.enterModule.default(), - prompt: DebugConfigStrings.module.enterModule.prompt(), + title: DebugConfigStrings.module.enterModule.title, + value: config.module || DebugConfigStrings.module.enterModule.default, + prompt: DebugConfigStrings.module.enterModule.prompt, validate: (value) => Promise.resolve( - value && value.trim().length > 0 ? undefined : DebugConfigStrings.module.enterModule.invalid(), + value && value.trim().length > 0 ? undefined : DebugConfigStrings.module.enterModule.invalid, ), }); if (selectedModule) { diff --git a/src/client/debugger/extension/configuration/providers/pidAttach.ts b/src/client/debugger/extension/configuration/providers/pidAttach.ts index 808d9feb1789..8225ec175e65 100644 --- a/src/client/debugger/extension/configuration/providers/pidAttach.ts +++ b/src/client/debugger/extension/configuration/providers/pidAttach.ts @@ -21,7 +21,7 @@ export class PidAttachDebugConfigurationProvider implements IDebugConfigurationP ) public async buildConfiguration(_input: MultiStepInput, state: DebugConfigurationState) { const config: Partial = { - name: DebugConfigStrings.attachPid.snippet.name(), + name: DebugConfigStrings.attachPid.snippet.name, type: DebuggerTypeName, request: 'attach', processId: '${command:pickProcess}', diff --git a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts index ecc7fcd14bc4..1c38161aa27a 100644 --- a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts @@ -33,7 +33,7 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat let manuallyEnteredAValue: boolean | undefined; const config: Partial = { - name: DebugConfigStrings.pyramid.snippet.name(), + name: DebugConfigStrings.pyramid.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'pyramid.scripts.pserve', @@ -45,9 +45,9 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat if (!iniPath) { const selectedIniPath = await input.showInputBox({ - title: DebugConfigStrings.pyramid.enterDevelopmentIniPath.title(), + title: DebugConfigStrings.pyramid.enterDevelopmentIniPath.title, value: defaultIni, - prompt: DebugConfigStrings.pyramid.enterDevelopmentIniPath.prompt(), + prompt: DebugConfigStrings.pyramid.enterDevelopmentIniPath.prompt, validate: (value) => this.validateIniPath(state ? state.folder : undefined, defaultIni, value), }); if (selectedIniPath) { @@ -71,7 +71,7 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat if (!folder) { return; } - const error = DebugConfigStrings.pyramid.enterDevelopmentIniPath.invalid(); + const error = DebugConfigStrings.pyramid.enterDevelopmentIniPath.invalid; if (!selected || selected.trim().length === 0) { return error; } diff --git a/src/client/debugger/extension/configuration/providers/remoteAttach.ts b/src/client/debugger/extension/configuration/providers/remoteAttach.ts index 3939ab0aea0b..d8ecb16016d2 100644 --- a/src/client/debugger/extension/configuration/providers/remoteAttach.ts +++ b/src/client/debugger/extension/configuration/providers/remoteAttach.ts @@ -22,7 +22,7 @@ export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurati state: DebugConfigurationState, ): Promise | void> { const config: Partial = { - name: DebugConfigStrings.attach.snippet.name(), + name: DebugConfigStrings.attach.snippet.name, type: DebuggerTypeName, request: 'attach', connect: { @@ -40,14 +40,14 @@ export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurati const connect = config.connect!; connect.host = await input.showInputBox({ - title: DebugConfigStrings.attach.enterRemoteHost.title(), + title: DebugConfigStrings.attach.enterRemoteHost.title, step: 1, totalSteps: 2, value: connect.host || defaultHost, - prompt: DebugConfigStrings.attach.enterRemoteHost.prompt(), + prompt: DebugConfigStrings.attach.enterRemoteHost.prompt, validate: (value) => Promise.resolve( - value && value.trim().length > 0 ? undefined : DebugConfigStrings.attach.enterRemoteHost.invalid(), + value && value.trim.length > 0 ? undefined : DebugConfigStrings.attach.enterRemoteHost.invalid, ), }); if (!connect.host) { @@ -68,16 +68,14 @@ export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurati ) { const connect = config.connect || (config.connect = {}); const port = await input.showInputBox({ - title: DebugConfigStrings.attach.enterRemotePort.title(), + title: DebugConfigStrings.attach.enterRemotePort.title, step: 2, totalSteps: 2, value: (connect.port || defaultPort).toString(), - prompt: DebugConfigStrings.attach.enterRemotePort.prompt(), + prompt: DebugConfigStrings.attach.enterRemotePort.prompt, validate: (value) => Promise.resolve( - value && /^\d+$/.test(value.trim()) - ? undefined - : DebugConfigStrings.attach.enterRemotePort.invalid(), + value && /^\d+$/.test(value.trim()) ? undefined : DebugConfigStrings.attach.enterRemotePort.invalid, ), }); if (port && /^\d+$/.test(port.trim())) { diff --git a/src/client/extension.ts b/src/client/extension.ts index 4c2c37467877..13c5039b6c5e 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -164,7 +164,7 @@ async function activateUnsafe( } function displayProgress(promise: Promise) { - const progressOptions: ProgressOptions = { location: ProgressLocation.Window, title: Common.loadingExtension() }; + const progressOptions: ProgressOptions = { location: ProgressLocation.Window, title: Common.loadingExtension }; window.withProgress(progressOptions, () => promise); } diff --git a/src/client/extensionInit.ts b/src/client/extensionInit.ts index 1644fbdf1e99..506679d66fc2 100644 --- a/src/client/extensionInit.ts +++ b/src/client/extensionInit.ts @@ -53,7 +53,7 @@ export function initializeGlobals( serviceManager.addSingletonInstance(IMemento, context.workspaceState, WORKSPACE_MEMENTO); serviceManager.addSingletonInstance(IExtensionContext, context); - const standardOutputChannel = window.createOutputChannel(OutputChannelNames.python()); + const standardOutputChannel = window.createOutputChannel(OutputChannelNames.python); context.subscriptions.push(registerLogger(new OutputChannelLogger(standardOutputChannel))); const workspaceService = new WorkspaceService(); @@ -61,7 +61,7 @@ export function initializeGlobals( workspaceService.isVirtualWorkspace || !workspaceService.isTrusted ? // Do not create any test related output UI when using virtual workspaces. instance(mock()) - : window.createOutputChannel(OutputChannelNames.pythonTest()); + : window.createOutputChannel(OutputChannelNames.pythonTest); serviceManager.addSingletonInstance(IOutputChannel, standardOutputChannel, STANDARD_OUTPUT_CHANNEL); serviceManager.addSingletonInstance(IOutputChannel, unitTestOutChannel, TEST_OUTPUT_CHANNEL); diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/base.ts b/src/client/interpreter/configuration/interpreterSelector/commands/base.ts index e549745ff58f..6ed2dee36c89 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/base.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/base.ts @@ -67,7 +67,7 @@ export abstract class BaseInterpreterSelectorCommand implements IExtensionSingle let quickPickItems: WorkspaceSelectionQuickPickItem[] = options?.resetTarget ? [ { - label: Common.clearAll(), + label: Common.clearAll, }, ] : []; @@ -85,7 +85,7 @@ export abstract class BaseInterpreterSelectorCommand implements IExtensionSingle }; }), { - label: options?.resetTarget ? Interpreters.clearAtWorkspace() : Interpreters.entireWorkspace(), + label: options?.resetTarget ? Interpreters.clearAtWorkspace : Interpreters.entireWorkspace, uri: workspaceFolders[0].uri, }, ); @@ -96,7 +96,7 @@ export abstract class BaseInterpreterSelectorCommand implements IExtensionSingle : 'Select the workspace folder to set the interpreter', }); - if (selection?.label === Common.clearAll()) { + if (selection?.label === Common.clearAll) { const folderTargets: { folderUri: Resource; configTarget: ConfigurationTarget; @@ -111,7 +111,7 @@ export abstract class BaseInterpreterSelectorCommand implements IExtensionSingle } return selection - ? selection.label === Interpreters.entireWorkspace() || selection.label === Interpreters.clearAtWorkspace() + ? selection.label === Interpreters.entireWorkspace || selection.label === Interpreters.clearAtWorkspace ? [{ folderUri: selection.uri, configTarget: ConfigurationTarget.Workspace }] : [{ folderUri: selection.uri, configTarget: ConfigurationTarget.WorkspaceFolder }] : undefined; diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index 09e149809570..ac906ffc4eeb 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -53,22 +53,22 @@ function isSeparatorItem(item: QuickPickType): item is QuickPickItem { // eslint-disable-next-line @typescript-eslint/no-namespace export namespace EnvGroups { - export const Workspace = InterpreterQuickPickList.workspaceGroupName(); + export const Workspace = InterpreterQuickPickList.workspaceGroupName; export const Conda = 'Conda'; - export const Global = InterpreterQuickPickList.globalGroupName(); + export const Global = InterpreterQuickPickList.globalGroupName; export const VirtualEnv = 'VirtualEnv'; export const PipEnv = 'PipEnv'; export const Pyenv = 'Pyenv'; export const Venv = 'Venv'; export const Poetry = 'Poetry'; export const VirtualEnvWrapper = 'VirtualEnvWrapper'; - export const Recommended = Common.recommended(); + export const Recommended = Common.recommended; } @injectable() export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { private readonly manualEntrySuggestion: ISpecialQuickPickItem = { - label: `${Octicons.Add} ${InterpreterQuickPickList.enterPath.label()}`, + label: `${Octicons.Add} ${InterpreterQuickPickList.enterPath.label}`, alwaysShow: true, }; @@ -115,18 +115,18 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { state.workspace ? state.workspace.fsPath : undefined, ); const selection = await input.showQuickPick>({ - placeholder: InterpreterQuickPickList.quickPickListPlaceholder().format(currentInterpreterPathDisplay), + placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentInterpreterPathDisplay), items: suggestions, sortByLabel: !preserveOrderWhenFiltering, keepScrollPosition: true, activeItem: await this.getActiveItem(state.workspace, suggestions), matchOnDetail: true, matchOnDescription: true, - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, customButtonSetup: { button: { iconPath: getIcon(REFRESH_BUTTON_ICON), - tooltip: InterpreterQuickPickList.refreshInterpreterList(), + tooltip: InterpreterQuickPickList.refreshInterpreterList, }, callback: () => this.interpreterService.triggerRefresh().ignoreErrors(), }, @@ -213,7 +213,7 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { const defaultInterpreterPathValue = systemVariables.resolveAny(config.get('defaultInterpreterPath')); if (defaultInterpreterPathValue && defaultInterpreterPathValue !== 'python') { return { - label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label()}`, + label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label}`, description: this.pathUtils.getDisplayName( defaultInterpreterPathValue, resource ? resource.fsPath : undefined, @@ -311,7 +311,7 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { recommended.description = areItemsGrouped ? // No need to add a tag as "Recommended" group already exists. recommended.description - : `${recommended.description ?? ''} - ${Common.recommended()}`; + : `${recommended.description ?? ''} - ${Common.recommended}`; const index = items.findIndex( (item) => isInterpreterQuickPickItem(item) && item.interpreter.id === recommended.interpreter.id, ); @@ -329,13 +329,13 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { ): Promise> { const items: QuickPickItem[] = [ { - label: InterpreterQuickPickList.browsePath.label(), - detail: InterpreterQuickPickList.browsePath.detail(), + label: InterpreterQuickPickList.browsePath.label, + detail: InterpreterQuickPickList.browsePath.detail, }, ]; const selection = await input.showQuickPick({ - placeholder: InterpreterQuickPickList.enterPath.placeholder(), + placeholder: InterpreterQuickPickList.enterPath.placeholder, items, acceptFilterBoxTextAsSelection: true, }); @@ -345,16 +345,16 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { sendTelemetryEvent(EventName.SELECT_INTERPRETER_ENTER_CHOICE, undefined, { choice: 'enter' }); state.path = selection; this.sendInterpreterEntryTelemetry(selection, state.workspace, suggestions); - } else if (selection && selection.label === InterpreterQuickPickList.browsePath.label()) { + } else if (selection && selection.label === InterpreterQuickPickList.browsePath.label) { sendTelemetryEvent(EventName.SELECT_INTERPRETER_ENTER_CHOICE, undefined, { choice: 'browse' }); const filtersKey = 'Executables'; const filtersObject: { [name: string]: string[] } = {}; filtersObject[filtersKey] = ['exe']; const uris = await this.applicationShell.showOpenDialog({ filters: this.platformService.isWindows ? filtersObject : undefined, - openLabel: InterpreterQuickPickList.browsePath.openButtonLabel(), + openLabel: InterpreterQuickPickList.browsePath.openButtonLabel, canSelectMany: false, - title: InterpreterQuickPickList.browsePath.title(), + title: InterpreterQuickPickList.browsePath.title, }); if (uris && uris.length > 0) { state.path = uris[0].fsPath; diff --git a/src/client/interpreter/display/index.ts b/src/client/interpreter/display/index.ts index cf48c580126f..3e40c3aa023c 100644 --- a/src/client/interpreter/display/index.ts +++ b/src/client/interpreter/display/index.ts @@ -64,7 +64,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle }); this.languageStatus.severity = LanguageStatusSeverity.Information; this.languageStatus.command = { - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, command: Commands.Set_Interpreter, }; this.disposableRegistry.push(this.languageStatus); @@ -114,7 +114,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle this.statusBar.tooltip = this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath); if (this.currentlySelectedInterpreterPath !== interpreter.path) { traceLog( - Interpreters.pythonInterpreterPath().format( + Interpreters.pythonInterpreterPath.format( this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath), ), ); @@ -127,7 +127,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle } else { this.statusBar.tooltip = ''; this.statusBar.color = ''; - this.statusBar.text = `$(alert) ${InterpreterQuickPickList.browsePath.openButtonLabel()}`; + this.statusBar.text = `$(alert) ${InterpreterQuickPickList.browsePath.openButtonLabel}`; this.currentlySelectedInterpreterDisplay = undefined; } } else if (this.languageStatus) { @@ -135,7 +135,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle this.languageStatus.detail = this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath); if (this.currentlySelectedInterpreterPath !== interpreter.path) { traceLog( - Interpreters.pythonInterpreterPath().format( + Interpreters.pythonInterpreterPath.format( this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath), ), ); diff --git a/src/client/interpreter/display/progressDisplay.ts b/src/client/interpreter/display/progressDisplay.ts index 2f54a03074e3..09e8c9db0cb2 100644 --- a/src/client/interpreter/display/progressDisplay.ts +++ b/src/client/interpreter/display/progressDisplay.ts @@ -61,7 +61,7 @@ export class InterpreterLocatorProgressStatubarHandler implements IExtensionSing const progressOptions: ProgressOptions = { location: ProgressLocation.Window, title: `[${ - this.isFirstTimeLoadingInterpreters ? Interpreters.discovering() : Interpreters.refreshing() + this.isFirstTimeLoadingInterpreters ? Interpreters.discovering : Interpreters.refreshing }](command:${Commands.Set_Interpreter})`, }; this.isFirstTimeLoadingInterpreters = false; diff --git a/src/client/interpreter/interpreterService.ts b/src/client/interpreter/interpreterService.ts index b9ef85bf0f5c..9bdbafdc3bf6 100644 --- a/src/client/interpreter/interpreterService.ts +++ b/src/client/interpreter/interpreterService.ts @@ -205,7 +205,7 @@ export class InterpreterService implements Disposable, IInterpreterService { const shell = this.serviceContainer.get(IApplicationShell); const progressOptions: ProgressOptions = { location: ProgressLocation.Window, - title: `[${Interpreters.installingPython()}](command:${Commands.ViewOutput})`, + title: `[${Interpreters.installingPython}](command:${Commands.ViewOutput})`, }; traceLog('Conda envs without Python are known to not work well; fixing conda environment...'); const promise = installer.install(Product.python, await this.getInterpreterDetails(pythonPath)); diff --git a/src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts b/src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts index 495e7181264b..da3d22a72bee 100644 --- a/src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts +++ b/src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts @@ -52,9 +52,9 @@ export class CondaInheritEnvPrompt implements IExtensionActivationService { if (!notificationPromptEnabled.value) { return; } - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.moreInfo()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.moreInfo]; const telemetrySelections: ['Yes', 'No', 'More Info'] = ['Yes', 'No', 'More Info']; - const selection = await this.appShell.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts); + const selection = await this.appShell.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts); sendTelemetryEvent(EventName.CONDA_INHERIT_ENV_PROMPT, undefined, { selection: selection ? telemetrySelections[prompts.indexOf(selection)] : undefined, }); diff --git a/src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts b/src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts index 492c850ae542..889e0205747b 100644 --- a/src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts +++ b/src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts @@ -64,12 +64,9 @@ export class VirtualEnvironmentPrompt implements IExtensionActivationService { if (!notificationPromptEnabled.value) { return; } - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const telemetrySelections: ['Yes', 'No', 'Ignore'] = ['Yes', 'No', 'Ignore']; - const selection = await this.appShell.showInformationMessage( - Interpreters.environmentPromptMessage(), - ...prompts, - ); + const selection = await this.appShell.showInformationMessage(Interpreters.environmentPromptMessage, ...prompts); sendTelemetryEvent(EventName.PYTHON_INTERPRETER_ACTIVATE_ENVIRONMENT_PROMPT, undefined, { selection: selection ? telemetrySelections[prompts.indexOf(selection)] : undefined, }); diff --git a/src/client/languageServer/pylanceLSExtensionManager.ts b/src/client/languageServer/pylanceLSExtensionManager.ts index 34c94af1eb66..f740eb74e059 100644 --- a/src/client/languageServer/pylanceLSExtensionManager.ts +++ b/src/client/languageServer/pylanceLSExtensionManager.ts @@ -102,6 +102,6 @@ export class PylanceLSExtensionManager extends LanguageServerCapabilities this.configurationService, ); - traceLog(Pylance.pylanceNotInstalledMessage()); + traceLog(Pylance.pylanceNotInstalledMessage); } } diff --git a/src/client/languageServer/watcher.ts b/src/client/languageServer/watcher.ts index 25f0c9ae7195..44cdef53507f 100644 --- a/src/client/languageServer/watcher.ts +++ b/src/client/languageServer/watcher.ts @@ -138,7 +138,7 @@ export class LanguageServerWatcher serverType !== LanguageServerType.Node && serverType !== LanguageServerType.None ) { - traceLog(LanguageService.untrustedWorkspaceMessage()); + traceLog(LanguageService.untrustedWorkspaceMessage); serverType = LanguageServerType.None; } @@ -287,13 +287,13 @@ function logStartup(languageServerType: LanguageServerType, resource: Uri): void switch (languageServerType) { case LanguageServerType.Jedi: - outputLine = LanguageService.startingJedi().format(basename); + outputLine = LanguageService.startingJedi.format(basename); break; case LanguageServerType.Node: - outputLine = LanguageService.startingPylance().format(basename); + outputLine = LanguageService.startingPylance.format(basename); break; case LanguageServerType.None: - outputLine = LanguageService.startingNone().format(basename); + outputLine = LanguageService.startingNone.format(basename); break; default: throw new Error(`Unknown language server type: ${languageServerType}`); diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index 9011bbeaf7bb..60d0a4f3bbef 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -71,7 +71,7 @@ export class LinterCommands implements IDisposable { const index = linters.findIndex((x) => x.id === selection); if (activeLinters.length > 1) { const response = await this.appShell.showWarningMessage( - Linters.replaceWithSelectedLinter().format(selection), + Linters.replaceWithSelectedLinter.format(selection), 'Yes', 'No', ); diff --git a/src/client/providers/importSortProvider.ts b/src/client/providers/importSortProvider.ts index de09d4cae8fd..684f1b5ccae1 100644 --- a/src/client/providers/importSortProvider.ts +++ b/src/client/providers/importSortProvider.ts @@ -161,14 +161,14 @@ export class SortImportsEditingProvider implements ISortImportsEditingProvider { return; } const selection = await this.shell.showWarningMessage( - Diagnostics.checkIsort5UpgradeGuide(), - Common.openOutputPanel(), - Common.doNotShowAgain(), + Diagnostics.checkIsort5UpgradeGuide, + Common.openOutputPanel, + Common.doNotShowAgain, ); - if (selection === Common.openOutputPanel()) { + if (selection === Common.openOutputPanel) { const cmdManager = this.serviceContainer.get(ICommandManager); await cmdManager.executeCommand(Commands.ViewOutput); - } else if (selection === Common.doNotShowAgain()) { + } else if (selection === Common.doNotShowAgain) { await neverShowAgain.updateValue(true); } } diff --git a/src/client/sourceMapSupport.ts b/src/client/sourceMapSupport.ts index 8800fd7d3e29..0d1ba39eb941 100644 --- a/src/client/sourceMapSupport.ts +++ b/src/client/sourceMapSupport.ts @@ -26,8 +26,8 @@ export class SourceMapSupport { await this.enableSourceMaps(true); require('source-map-support').install(); const localize = require('./common/utils/localize') as typeof import('./common/utils/localize'); - const disable = localize.Diagnostics.disableSourceMaps(); - this.vscode.window.showWarningMessage(localize.Diagnostics.warnSourceMaps(), disable).then((selection) => { + const disable = localize.Diagnostics.disableSourceMaps; + this.vscode.window.showWarningMessage(localize.Diagnostics.warnSourceMaps, disable).then((selection) => { if (selection === disable) { this.disable().ignoreErrors(); } diff --git a/src/client/tensorBoard/nbextensionCodeLensProvider.ts b/src/client/tensorBoard/nbextensionCodeLensProvider.ts index ec5653e4ac7a..6d4c844cd392 100644 --- a/src/client/tensorBoard/nbextensionCodeLensProvider.ts +++ b/src/client/tensorBoard/nbextensionCodeLensProvider.ts @@ -44,7 +44,7 @@ export class TensorBoardNbextensionCodeLensProvider implements IExtensionSingleA public provideCodeLenses(document: TextDocument, cancelToken: CancellationToken): CodeLens[] { const command: Command = { - title: TensorBoard.launchNativeTensorBoardSessionCodeLens(), + title: TensorBoard.launchNativeTensorBoardSessionCodeLens, command: Commands.LaunchTensorBoard, arguments: [ { trigger: TensorBoardEntrypointTrigger.nbextension, entrypoint: TensorBoardEntrypoint.codelens }, diff --git a/src/client/tensorBoard/tensorBoardImportCodeLensProvider.ts b/src/client/tensorBoard/tensorBoardImportCodeLensProvider.ts index 388a79cfb244..cac29b1d7e7a 100644 --- a/src/client/tensorBoard/tensorBoardImportCodeLensProvider.ts +++ b/src/client/tensorBoard/tensorBoardImportCodeLensProvider.ts @@ -33,7 +33,7 @@ export class TensorBoardImportCodeLensProvider implements IExtensionSingleActiva // eslint-disable-next-line class-methods-use-this public provideCodeLenses(document: TextDocument, cancelToken: CancellationToken): CodeLens[] { const command: Command = { - title: TensorBoard.launchNativeTensorBoardSessionCodeLens(), + title: TensorBoard.launchNativeTensorBoardSessionCodeLens, command: Commands.LaunchTensorBoard, arguments: [ { trigger: TensorBoardEntrypointTrigger.fileimport, entrypoint: TensorBoardEntrypoint.codelens }, diff --git a/src/client/tensorBoard/tensorBoardPrompt.ts b/src/client/tensorBoard/tensorBoardPrompt.ts index d0c026411ecf..1c03a696dc1d 100644 --- a/src/client/tensorBoard/tensorBoardPrompt.ts +++ b/src/client/tensorBoard/tensorBoardPrompt.ts @@ -46,14 +46,14 @@ export class TensorBoardPrompt { public async showNativeTensorBoardPrompt(trigger: TensorBoardEntrypointTrigger): Promise { if (this.enabled && this.enabledInCurrentSession && !this.waitingForUserSelection) { - const yes = Common.bannerLabelYes(); - const no = Common.bannerLabelNo(); - const doNotAskAgain = Common.doNotShowAgain(); + const yes = Common.bannerLabelYes; + const no = Common.bannerLabelNo; + const doNotAskAgain = Common.doNotShowAgain; const options = [yes, no, doNotAskAgain]; this.waitingForUserSelection = true; this.sendTelemetryOnce(trigger); const selection = await this.applicationShell.showInformationMessage( - TensorBoard.nativeTensorBoardPrompt(), + TensorBoard.nativeTensorBoardPrompt, ...options, ); this.waitingForUserSelection = false; diff --git a/src/client/tensorBoard/tensorBoardSession.ts b/src/client/tensorBoard/tensorBoardSession.ts index c71119006792..0ffc21e178e2 100644 --- a/src/client/tensorBoard/tensorBoardSession.ts +++ b/src/client/tensorBoard/tensorBoardSession.ts @@ -147,8 +147,8 @@ export class TensorBoardSession { profilerPluginInstallStatus: ProductInstallStatus, ) { sendTelemetryEvent(EventName.TENSORBOARD_INSTALL_PROMPT_SHOWN); - const yes = Common.bannerLabelYes(); - const no = Common.bannerLabelNo(); + const yes = Common.bannerLabelYes; + const no = Common.bannerLabelNo; const isUpgrade = tensorBoardInstallStatus === ProductInstallStatus.NeedsUpgrade; let message; @@ -157,16 +157,16 @@ export class TensorBoardSession { profilerPluginInstallStatus !== ProductInstallStatus.Installed ) { // PyTorch user already has TensorBoard, just ask if they want the profiler plugin - message = TensorBoard.installProfilerPluginPrompt(); + message = TensorBoard.installProfilerPluginPrompt; } else if (profilerPluginInstallStatus !== ProductInstallStatus.Installed) { // PyTorch user doesn't have compatible TensorBoard or the profiler plugin - message = TensorBoard.installTensorBoardAndProfilerPluginPrompt(); + message = TensorBoard.installTensorBoardAndProfilerPluginPrompt; } else if (isUpgrade) { // Not a PyTorch user and needs upgrade, don't need to mention profiler plugin - message = TensorBoard.upgradePrompt(); + message = TensorBoard.upgradePrompt; } else { // Not a PyTorch user and needs install, again don't need to mention profiler plugin - message = TensorBoard.installPrompt(); + message = TensorBoard.installPrompt; } const selection = await this.applicationShell.showErrorMessage(message, ...[yes, no]); let telemetrySelection = TensorBoardPromptSelection.None; @@ -222,10 +222,10 @@ export class TensorBoardSession { tensorboardInstallStatus, isTorchUser ? profilerPluginInstallStatus : ProductInstallStatus.Installed, ); - if (selection !== Common.bannerLabelYes() && !needsTensorBoardInstall) { + if (selection !== Common.bannerLabelYes && !needsTensorBoardInstall) { return true; } - if (selection !== Common.bannerLabelYes()) { + if (selection !== Common.bannerLabelYes) { return false; } @@ -309,25 +309,25 @@ export class TensorBoardSession { if (logDir) { const useCwd = { - label: TensorBoard.useCurrentWorkingDirectory(), - detail: TensorBoard.useCurrentWorkingDirectoryDetail(), + label: TensorBoard.useCurrentWorkingDirectory, + detail: TensorBoard.useCurrentWorkingDirectoryDetail, }; const selectAnotherFolder = { - label: TensorBoard.selectAnotherFolder(), - detail: TensorBoard.selectAnotherFolderDetail(), + label: TensorBoard.selectAnotherFolder, + detail: TensorBoard.selectAnotherFolderDetail, }; items.push(useCwd, selectAnotherFolder); } else { const selectAFolder = { - label: TensorBoard.selectAFolder(), - detail: TensorBoard.selectAFolderDetail(), + label: TensorBoard.selectAFolder, + detail: TensorBoard.selectAFolderDetail, }; items.push(selectAFolder); } items.push({ - label: TensorBoard.enterRemoteUrl(), - detail: TensorBoard.enterRemoteUrlDetail(), + label: TensorBoard.enterRemoteUrl, + detail: TensorBoard.enterRemoteUrlDetail, }); return items; @@ -346,15 +346,15 @@ export class TensorBoardSession { } // No log directory in settings. Ask the user which directory to use const logDir = this.autopopulateLogDirectoryPath(); - const useCurrentWorkingDirectory = TensorBoard.useCurrentWorkingDirectory(); - const selectAFolder = TensorBoard.selectAFolder(); - const selectAnotherFolder = TensorBoard.selectAnotherFolder(); - const enterRemoteUrl = TensorBoard.enterRemoteUrl(); + const { useCurrentWorkingDirectory } = TensorBoard; + const { selectAFolder } = TensorBoard; + const { selectAnotherFolder } = TensorBoard; + const { enterRemoteUrl } = TensorBoard; const items: QuickPickItem[] = this.getQuickPickItems(logDir); const item = await this.applicationShell.showQuickPick(items, { canPickMany: false, ignoreFocusOut: false, - placeHolder: logDir ? TensorBoard.currentDirectory().format(logDir) : undefined, + placeHolder: logDir ? TensorBoard.currentDirectory.format(logDir) : undefined, }); switch (item?.label) { case useCurrentWorkingDirectory: @@ -364,7 +364,7 @@ export class TensorBoardSession { return this.showFilePicker(); case enterRemoteUrl: return this.applicationShell.showInputBox({ - prompt: TensorBoard.enterRemoteUrlDetail(), + prompt: TensorBoard.enterRemoteUrlDetail, }); default: return undefined; @@ -387,7 +387,7 @@ export class TensorBoardSession { // Display a progress indicator as TensorBoard takes at least a couple seconds to launch const progressOptions: ProgressOptions = { - title: TensorBoard.progressMessage(), + title: TensorBoard.progressMessage, location: ProgressLocation.Notification, cancellable: true, }; @@ -550,8 +550,8 @@ export class TensorBoardSession { // Prompt the user to pick the file on disk const items: QuickPickItem[] = [ { - label: TensorBoard.selectMissingSourceFile(), - description: TensorBoard.selectMissingSourceFileDescription(), + label: TensorBoard.selectMissingSourceFile, + description: TensorBoard.selectMissingSourceFileDescription, }, ]; // Using a multistep so that we can add a title to the quickpick @@ -559,11 +559,11 @@ export class TensorBoardSession { await multiStep.run(async (input) => { const selection = await input.showQuickPick({ items, - title: TensorBoard.missingSourceFile(), + title: TensorBoard.missingSourceFile, placeholder: fsPath, }); switch (selection?.label) { - case TensorBoard.selectMissingSourceFile(): { + case TensorBoard.selectMissingSourceFile: { const filePickerSelection = await this.applicationShell.showOpenDialog({ canSelectFiles: true, canSelectFolders: false, diff --git a/src/client/tensorBoard/tensorBoardSessionProvider.ts b/src/client/tensorBoard/tensorBoardSessionProvider.ts index 1b7085803940..352ec3dff585 100644 --- a/src/client/tensorBoard/tensorBoardSessionProvider.ts +++ b/src/client/tensorBoard/tensorBoardSessionProvider.ts @@ -109,7 +109,7 @@ export class TensorBoardSessionProvider implements IExtensionSingleActivationSer } catch (e) { traceError(`Encountered error while starting new TensorBoard session: ${e}`); await this.applicationShell.showErrorMessage( - TensorBoard.failedToStartSessionError().format((e as Error).message), + TensorBoard.failedToStartSessionError.format((e as Error).message), ); } return undefined; diff --git a/src/client/testing/main.ts b/src/client/testing/main.ts index 482538a38789..dc8165556609 100644 --- a/src/client/testing/main.ts +++ b/src/client/testing/main.ts @@ -98,10 +98,10 @@ export class UnitTestManagementService implements IExtensionActivationService { // Once that is fixed delete this notification and test should be configured from the test view. const app = this.serviceContainer.get(IApplicationShell); const response = await app.showInformationMessage( - Testing.testNotConfigured(), - Testing.configureTests(), + Testing.testNotConfigured, + Testing.configureTests, ); - if (response === Testing.configureTests()) { + if (response === Testing.configureTests) { await commandManager.executeCommand( constants.Commands.Tests_Configure, undefined, diff --git a/src/client/testing/testController/workspaceTestAdapter.ts b/src/client/testing/testController/workspaceTestAdapter.ts index 1aa5e707d88a..69fcea9ce03c 100644 --- a/src/client/testing/testController/workspaceTestAdapter.ts +++ b/src/client/testing/testController/workspaceTestAdapter.ts @@ -62,13 +62,13 @@ export class WorkspaceTestAdapter { sendTelemetryEvent(EventName.UNITTEST_DISCOVERY_DONE, undefined, { tool: this.testProvider, failed: true }); const cancel = token?.isCancellationRequested - ? Testing.cancelUnittestDiscovery() - : Testing.errorUnittestDiscovery(); + ? Testing.cancelUnittestDiscovery + : Testing.errorUnittestDiscovery; traceError(`${cancel}\r\n`, ex); // Report also on the test view. - const message = util.format(`${cancel} ${Testing.seePythonOutput()}\r\n`, ex); + const message = util.format(`${cancel} ${Testing.seePythonOutput}\r\n`, ex); const options = buildErrorNodeOptions(this.workspaceUri, message); const errorNode = createErrorTestItem(testController, options); testController.items.add(errorNode); @@ -88,11 +88,11 @@ export class WorkspaceTestAdapter { // Check if there were any errors in the discovery process. if (rawTestData.status === 'error') { const { errors } = rawTestData; - traceError(Testing.errorUnittestDiscovery(), '\r\n', errors!.join('\r\n\r\n')); + traceError(Testing.errorUnittestDiscovery, '\r\n', errors!.join('\r\n\r\n')); let errorNode = testController.items.get(`DiscoveryError:${workspacePath}`); const message = util.format( - `${Testing.errorUnittestDiscovery()} ${Testing.seePythonOutput()}\r\n`, + `${Testing.errorUnittestDiscovery} ${Testing.seePythonOutput}\r\n`, errors!.join('\r\n\r\n'), ); diff --git a/src/test/activation/extensionSurvey.unit.test.ts b/src/test/activation/extensionSurvey.unit.test.ts index e3618ce4bfb9..6449eae24f31 100644 --- a/src/test/activation/extensionSurvey.unit.test.ts +++ b/src/test/activation/extensionSurvey.unit.test.ts @@ -222,11 +222,7 @@ suite('Extension survey prompt - showSurvey()', () => { const packageJson = { version: 'extensionVersion', }; - const prompts = [ - ExtensionSurveyBanner.bannerLabelYes(), - ExtensionSurveyBanner.maybeLater(), - Common.doNotShowAgain(), - ]; + const prompts = [ExtensionSurveyBanner.bannerLabelYes, ExtensionSurveyBanner.maybeLater, Common.doNotShowAgain]; const expectedUrl = `https://aka.ms/AA5rjx5?o=Windows&v=vscodeVersion&e=extensionVersion&m=sessionId`; appEnvironment .setup((a) => a.packageJson) @@ -245,8 +241,8 @@ suite('Extension survey prompt - showSurvey()', () => { .returns(() => OSType.Windows) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage(), ...prompts)) - .returns(() => Promise.resolve(ExtensionSurveyBanner.bannerLabelYes())) + .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage, ...prompts)) + .returns(() => Promise.resolve(ExtensionSurveyBanner.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); browserService .setup((s) => s.launch(expectedUrl)) @@ -282,15 +278,11 @@ suite('Extension survey prompt - showSurvey()', () => { }); test("Do nothing if 'Maybe later' option is clicked", async () => { - const prompts = [ - ExtensionSurveyBanner.bannerLabelYes(), - ExtensionSurveyBanner.maybeLater(), - Common.doNotShowAgain(), - ]; + const prompts = [ExtensionSurveyBanner.bannerLabelYes, ExtensionSurveyBanner.maybeLater, Common.doNotShowAgain]; platformService.setup((p) => p.osType).verifiable(TypeMoq.Times.never()); appShell - .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage(), ...prompts)) - .returns(() => Promise.resolve(ExtensionSurveyBanner.maybeLater())) + .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage, ...prompts)) + .returns(() => Promise.resolve(ExtensionSurveyBanner.maybeLater)) .verifiable(TypeMoq.Times.once()); browserService .setup((s) => s.launch(TypeMoq.It.isAny())) @@ -325,14 +317,10 @@ suite('Extension survey prompt - showSurvey()', () => { }); test('Do nothing if no option is clicked', async () => { - const prompts = [ - ExtensionSurveyBanner.bannerLabelYes(), - ExtensionSurveyBanner.maybeLater(), - Common.doNotShowAgain(), - ]; + const prompts = [ExtensionSurveyBanner.bannerLabelYes, ExtensionSurveyBanner.maybeLater, Common.doNotShowAgain]; platformService.setup((p) => p.osType).verifiable(TypeMoq.Times.never()); appShell - .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage(), ...prompts)) + .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage, ...prompts)) .returns(() => Promise.resolve(undefined)) .verifiable(TypeMoq.Times.once()); browserService @@ -368,15 +356,11 @@ suite('Extension survey prompt - showSurvey()', () => { }); test("Disable prompt if 'Do not show again' option is clicked", async () => { - const prompts = [ - ExtensionSurveyBanner.bannerLabelYes(), - ExtensionSurveyBanner.maybeLater(), - Common.doNotShowAgain(), - ]; + const prompts = [ExtensionSurveyBanner.bannerLabelYes, ExtensionSurveyBanner.maybeLater, Common.doNotShowAgain]; platformService.setup((p) => p.osType).verifiable(TypeMoq.Times.never()); appShell - .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage(), ...prompts)) - .returns(() => Promise.resolve(Common.doNotShowAgain())) + .setup((a) => a.showInformationMessage(ExtensionSurveyBanner.bannerMessage, ...prompts)) + .returns(() => Promise.resolve(Common.doNotShowAgain)) .verifiable(TypeMoq.Times.once()); browserService .setup((s) => s.launch(TypeMoq.It.isAny())) diff --git a/src/test/activation/node/languageServerChangeHandler.unit.test.ts b/src/test/activation/node/languageServerChangeHandler.unit.test.ts index 0b06cccae812..7f1dffaf848b 100644 --- a/src/test/activation/node/languageServerChangeHandler.unit.test.ts +++ b/src/test/activation/node/languageServerChangeHandler.unit.test.ts @@ -52,25 +52,23 @@ suite('Language Server - Change Handler', () => { test('Handler should prompt for install when language server changes to Pylance and Pylance is not installed', async () => { when( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), ).thenReturn(Promise.resolve(undefined)); handler = makeHandler(undefined); await handler.handleLanguageServerChange(LanguageServerType.Node); - verify( - appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange(), Common.reload()), - ).never(); + verify(appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange, Common.reload)).never(); verify( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), ).once(); }); @@ -78,12 +76,12 @@ suite('Language Server - Change Handler', () => { test('Handler should open Pylance store page when language server changes to Pylance, Pylance is not installed and user clicks Yes', async () => { when( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), - ).thenReturn(Promise.resolve(Pylance.pylanceInstallPylance())); + ).thenReturn(Promise.resolve(Pylance.pylanceInstallPylance)); handler = makeHandler(undefined); await handler.handleLanguageServerChange(LanguageServerType.Node); @@ -95,12 +93,12 @@ suite('Language Server - Change Handler', () => { test('Handler should not open Pylance store page when language server changes to Pylance, Pylance is not installed and user clicks No', async () => { when( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), - ).thenReturn(Promise.resolve(Pylance.remindMeLater())); + ).thenReturn(Promise.resolve(Pylance.remindMeLater)); handler = makeHandler(undefined); await handler.handleLanguageServerChange(LanguageServerType.Node); @@ -116,12 +114,12 @@ suite('Language Server - Change Handler', () => { when( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), - ).thenReturn(Promise.resolve(Pylance.pylanceRevertToJedi())); + ).thenReturn(Promise.resolve(Pylance.pylanceRevertToJedi)); when(workspace.getConfiguration('python')).thenReturn(instance(configuration)); @@ -137,14 +135,14 @@ suite('Language Server - Change Handler', () => { await handler.handleLanguageServerChange(LanguageServerType.Node); verify( - appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange(), Common.reload()), + appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange, Common.reload), ).never(); verify( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), ).once(); verify(configService.updateSetting('languageServer', LanguageServerType.Jedi, undefined, target)).once(); @@ -158,12 +156,12 @@ suite('Language Server - Change Handler', () => { when( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), - ).thenReturn(Promise.resolve(Pylance.pylanceRevertToJedi())); + ).thenReturn(Promise.resolve(Pylance.pylanceRevertToJedi)); when(workspace.getConfiguration('python')).thenReturn(instance(configuration)); @@ -179,14 +177,14 @@ suite('Language Server - Change Handler', () => { await handler.handleLanguageServerChange(LanguageServerType.Node); verify( - appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange(), Common.reload()), + appShell.showInformationMessage(LanguageService.reloadAfterLanguageServerChange, Common.reload), ).never(); verify( appShell.showWarningMessage( - Pylance.pylanceRevertToJediPrompt(), - Pylance.pylanceInstallPylance(), - Pylance.pylanceRevertToJedi(), - Pylance.remindMeLater(), + Pylance.pylanceRevertToJediPrompt, + Pylance.pylanceInstallPylance, + Pylance.pylanceRevertToJedi, + Pylance.remindMeLater, ), ).once(); verify(configService.updateSetting(anything(), anything(), anything(), anything())).never(); diff --git a/src/test/activation/outputChannel.unit.test.ts b/src/test/activation/outputChannel.unit.test.ts index 87dace221985..9d54ef4cea17 100644 --- a/src/test/activation/outputChannel.unit.test.ts +++ b/src/test/activation/outputChannel.unit.test.ts @@ -25,7 +25,7 @@ suite('Language Server Output Channel', () => { test('Create output channel if one does not exist before and return it', async () => { appShell - .setup((a) => a.createOutputChannel(OutputChannelNames.languageServer())) + .setup((a) => a.createOutputChannel(OutputChannelNames.languageServer)) .returns(() => output.object) .verifiable(TypeMoq.Times.once()); const { channel } = languageServerOutputChannel; diff --git a/src/test/activation/partialModeStatus.unit.test.ts b/src/test/activation/partialModeStatus.unit.test.ts index 28f134379c87..12e4b6fc0c5b 100644 --- a/src/test/activation/partialModeStatus.unit.test.ts +++ b/src/test/activation/partialModeStatus.unit.test.ts @@ -79,12 +79,12 @@ suite('Partial Mode Status', async () => { language: 'python', }); assert.deepEqual(languageItem, ({ - name: LanguageService.statusItem.name(), + name: LanguageService.statusItem.name, severity: vscodeMock.LanguageStatusSeverity.Warning, - text: LanguageService.statusItem.text(), - detail: LanguageService.statusItem.detail(), + text: LanguageService.statusItem.text, + detail: LanguageService.statusItem.detail, command: { - title: Common.learnMore(), + title: Common.learnMore, command: 'vscode.open', arguments: ['https://aka.ms/AAdzyh4'], }, @@ -105,12 +105,12 @@ suite('Partial Mode Status', async () => { language: 'python', }); assert.deepEqual(languageItem, ({ - name: LanguageService.statusItem.name(), + name: LanguageService.statusItem.name, severity: vscodeMock.LanguageStatusSeverity.Warning, - text: LanguageService.statusItem.text(), - detail: LanguageService.virtualWorkspaceStatusItem.detail(), + text: LanguageService.statusItem.text, + detail: LanguageService.virtualWorkspaceStatusItem.detail, command: { - title: Common.learnMore(), + title: Common.learnMore, command: 'vscode.open', arguments: ['https://aka.ms/AAdzyh4'], }, @@ -131,12 +131,12 @@ suite('Partial Mode Status', async () => { language: 'python', }); assert.deepEqual(languageItem, ({ - name: LanguageService.statusItem.name(), + name: LanguageService.statusItem.name, severity: vscodeMock.LanguageStatusSeverity.Warning, - text: LanguageService.statusItem.text(), - detail: LanguageService.statusItem.detail(), + text: LanguageService.statusItem.text, + detail: LanguageService.statusItem.detail, command: { - title: Common.learnMore(), + title: Common.learnMore, command: 'vscode.open', arguments: ['https://aka.ms/AAdzyh4'], }, diff --git a/src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts b/src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts index e70046e9f6b6..d4eefd69dd5f 100644 --- a/src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts +++ b/src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts @@ -271,7 +271,7 @@ suite('Application Diagnostics - Checks if launch.json is invalid', () => { messageHandler.verifyAll(); baseWorkspaceService.verifyAll(); expect(options!.commandPrompts).to.be.lengthOf(2); - expect(options!.commandPrompts[0].prompt).to.be.equal(Diagnostics.yesUpdateLaunch()); + expect(options!.commandPrompts[0].prompt).to.be.equal(Diagnostics.yesUpdateLaunch); expect(options!.commandPrompts[0].command).not.to.be.equal(undefined, 'Command not set'); } }); diff --git a/src/test/application/diagnostics/checks/jediPython27NotSupported.unit.test.ts b/src/test/application/diagnostics/checks/jediPython27NotSupported.unit.test.ts index 21c60d7860fe..d4af2e5ca901 100644 --- a/src/test/application/diagnostics/checks/jediPython27NotSupported.unit.test.ts +++ b/src/test/application/diagnostics/checks/jediPython27NotSupported.unit.test.ts @@ -141,7 +141,7 @@ suite('Application Diagnostics - Jedi with Python 2.7 deprecated', () => { const diagnostic = result[0]; assert.strictEqual(result.length, 1); - assert.strictEqual(diagnostic.message, Python27Support.jediMessage()); + assert.strictEqual(diagnostic.message, Python27Support.jediMessage); }); test('Should return a diagnostics array with one diagnostic if the language server is Jedi', async () => { @@ -175,7 +175,7 @@ suite('Application Diagnostics - Jedi with Python 2.7 deprecated', () => { const diagnostic = result[0]; assert.strictEqual(result.length, 1); - assert.strictEqual(diagnostic.message, Python27Support.jediMessage()); + assert.strictEqual(diagnostic.message, Python27Support.jediMessage); }); test('Should return an empty diagnostics array if the language server is Pylance', async () => { diff --git a/src/test/application/diagnostics/checks/pylanceDefault.unit.test.ts b/src/test/application/diagnostics/checks/pylanceDefault.unit.test.ts index 9fe4863db483..85dc5a4fb8af 100644 --- a/src/test/application/diagnostics/checks/pylanceDefault.unit.test.ts +++ b/src/test/application/diagnostics/checks/pylanceDefault.unit.test.ts @@ -72,7 +72,7 @@ suite('Application Diagnostics - Pylance informational prompt', () => { const diagnostics = await diagnosticService.diagnose(undefined); assert.deepStrictEqual(diagnostics, [ - new PylanceDefaultDiagnostic(Diagnostics.pylanceDefaultMessage(), undefined), + new PylanceDefaultDiagnostic(Diagnostics.pylanceDefaultMessage, undefined), ]); }); @@ -111,7 +111,7 @@ suite('Application Diagnostics - Pylance informational prompt', () => { assert.notDeepStrictEqual(messagePrompt, undefined); assert.notDeepStrictEqual(messagePrompt!.onClose, undefined); - assert.deepStrictEqual(messagePrompt!.commandPrompts, [{ prompt: Common.ok() }]); + assert.deepStrictEqual(messagePrompt!.commandPrompts, [{ prompt: Common.ok }]); }); test('Should return empty diagnostics if the diagnostic code has been ignored', async () => { diff --git a/src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts b/src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts index 82495623af3b..9feab57af375 100644 --- a/src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts +++ b/src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts @@ -177,7 +177,7 @@ suite('Application Diagnostics - Python Path Deprecated', () => { expect(messagePrompt).to.be.deep.equal({ commandPrompts: [ { - prompt: Common.ok(), + prompt: Common.ok, }, ], }); @@ -244,7 +244,7 @@ suite('Application Diagnostics - Python Path Deprecated', () => { const diagnostics = await diagnosticService.diagnose(resource); expect(diagnostics.length).to.equal(1); - expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings()); + expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings); expect(diagnostics[0].resource).to.equal(resource); workspaceService.verifyAll(); @@ -269,7 +269,7 @@ suite('Application Diagnostics - Python Path Deprecated', () => { const diagnostics = await diagnosticService.diagnose(resource); expect(diagnostics.length).to.equal(1); - expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings()); + expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings); expect(diagnostics[0].resource).to.equal(resource); workspaceService.verifyAll(); @@ -294,7 +294,7 @@ suite('Application Diagnostics - Python Path Deprecated', () => { const diagnostics = await diagnosticService.diagnose(resource); expect(diagnostics.length).to.equal(1); - expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings()); + expect(diagnostics[0].message).to.equal(Diagnostics.removedPythonPathFromSettings); expect(diagnostics[0].resource).to.equal(resource); workspaceService.verifyAll(); diff --git a/src/test/application/diagnostics/sourceMapSupportService.unit.test.ts b/src/test/application/diagnostics/sourceMapSupportService.unit.test.ts index 2f34e302156b..3ff429742eb8 100644 --- a/src/test/application/diagnostics/sourceMapSupportService.unit.test.ts +++ b/src/test/application/diagnostics/sourceMapSupportService.unit.test.ts @@ -68,7 +68,7 @@ suite('Diagnostisc - Source Maps', () => { configService.updateSetting('diagnostics.sourceMapsEnabled', true, undefined, ConfigurationTarget.Global), ).thenResolve(); when(shell.showWarningMessage(anything(), anything())).thenResolve( - Diagnostics.enableSourceMapsAndReloadVSC() as any, + Diagnostics.enableSourceMapsAndReloadVSC as any, ); when(commandManager.executeCommand('workbench.action.reloadWindow')).thenResolve(); diff --git a/src/test/common/application/commands/reloadCommand.unit.test.ts b/src/test/common/application/commands/reloadCommand.unit.test.ts index 6b2e598b569a..dfcc6a4ad434 100644 --- a/src/test/common/application/commands/reloadCommand.unit.test.ts +++ b/src/test/common/application/commands/reloadCommand.unit.test.ts @@ -33,29 +33,29 @@ suite('Common Commands ReloadCommand', () => { await commandHandler.call(reloadCommandHandler, message); - verify(appShell.showInformationMessage(message, Common.reload())).once(); + verify(appShell.showInformationMessage(message, Common.reload)).once(); }); test('Do not reload VS Code if user selects `Reload` option', async () => { const message = 'Hello World!'; const commandHandler = capture(cmdManager.registerCommand as any).first()[1] as Function; - when(appShell.showInformationMessage(message, Common.reload())).thenResolve(Common.reload() as any); + when(appShell.showInformationMessage(message, Common.reload)).thenResolve(Common.reload as any); await commandHandler.call(reloadCommandHandler, message); - verify(appShell.showInformationMessage(message, Common.reload())).once(); + verify(appShell.showInformationMessage(message, Common.reload)).once(); verify(cmdManager.executeCommand('workbench.action.reloadWindow')).once(); }); test('Do not reload VS Code if user does not select `Reload` option', async () => { const message = 'Hello World!'; const commandHandler = capture(cmdManager.registerCommand as any).first()[1] as Function; - when(appShell.showInformationMessage(message, Common.reload())).thenResolve(); + when(appShell.showInformationMessage(message, Common.reload)).thenResolve(); await commandHandler.call(reloadCommandHandler, message); - verify(appShell.showInformationMessage(message, Common.reload())).once(); + verify(appShell.showInformationMessage(message, Common.reload)).once(); verify(cmdManager.executeCommand('workbench.action.reloadWindow')).never(); }); }); diff --git a/src/test/common/experiments/service.unit.test.ts b/src/test/common/experiments/service.unit.test.ts index 452b4d46d95b..48fd9075286b 100644 --- a/src/test/common/experiments/service.unit.test.ts +++ b/src/test/common/experiments/service.unit.test.ts @@ -158,7 +158,7 @@ suite('Experimentation service', () => { instance(stateFactory), ); await exp.activate(); - const output = `${Experiments.inGroup().format('pythonExperiment')}\n`; + const output = `${Experiments.inGroup.format('pythonExperiment')}\n`; assert.strictEqual(outputChannel.output, output); }); diff --git a/src/test/common/installer/channelManager.unit.test.ts b/src/test/common/installer/channelManager.unit.test.ts index ce593751c62c..319a9647fec7 100644 --- a/src/test/common/installer/channelManager.unit.test.ts +++ b/src/test/common/installer/channelManager.unit.test.ts @@ -207,7 +207,7 @@ suite('InstallationChannelManager - showNoInstallersMessage()', () => { .returns(() => Promise.resolve(activeInterpreter as any)); appShell - .setup((a) => a.showErrorMessage(Installer.noCondaOrPipInstaller(), Installer.searchForHelp())) + .setup((a) => a.showErrorMessage(Installer.noCondaOrPipInstaller, Installer.searchForHelp)) .verifiable(TypeMoq.Times.once()); installChannelManager = new InstallationChannelManager(serviceContainer.object); await installChannelManager.showNoInstallersMessage(resource); @@ -232,7 +232,7 @@ suite('InstallationChannelManager - showNoInstallersMessage()', () => { .returns(() => Promise.resolve(activeInterpreter as any)); appShell - .setup((a) => a.showErrorMessage(Installer.noPipInstaller(), Installer.searchForHelp())) + .setup((a) => a.showErrorMessage(Installer.noPipInstaller, Installer.searchForHelp)) .verifiable(TypeMoq.Times.once()); installChannelManager = new InstallationChannelManager(serviceContainer.object); await installChannelManager.showNoInstallersMessage(resource); @@ -289,8 +289,8 @@ suite('InstallationChannelManager - showNoInstallersMessage()', () => { platformService.setup((p) => p.isWindows).returns(() => testParams.isWindows); platformService.setup((p) => p.isMac).returns(() => testParams.isMac); appShell - .setup((a) => a.showErrorMessage(TypeMoq.It.isAny(), Installer.searchForHelp())) - .returns(() => Promise.resolve(Installer.searchForHelp())) + .setup((a) => a.showErrorMessage(TypeMoq.It.isAny(), Installer.searchForHelp)) + .returns(() => Promise.resolve(Installer.searchForHelp)) .verifiable(TypeMoq.Times.once()); appShell .setup((a) => a.openUrl(expectedURL)) @@ -326,7 +326,7 @@ suite('InstallationChannelManager - showNoInstallersMessage()', () => { .returns(() => Promise.resolve(activeInterpreter as any)); platformService.setup((p) => p.isWindows).returns(() => true); appShell - .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), Installer.searchForHelp())) + .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), Installer.searchForHelp)) .returns(() => Promise.resolve(undefined)) .verifiable(TypeMoq.Times.once()); appShell diff --git a/src/test/common/installer/moduleInstaller.unit.test.ts b/src/test/common/installer/moduleInstaller.unit.test.ts index 65e92ed4ace1..e45da92daaee 100644 --- a/src/test/common/installer/moduleInstaller.unit.test.ts +++ b/src/test/common/installer/moduleInstaller.unit.test.ts @@ -540,7 +540,7 @@ suite('Module Installer', () => { const options = { location: ProgressLocation.Notification, cancellable: true, - title: Products.installingModule().format(product.name), + title: Products.installingModule.format(product.name), }; appShell .setup((a) => a.withProgress(TypeMoq.It.isAny(), TypeMoq.It.isAny())) diff --git a/src/test/common/installer/productInstaller.unit.test.ts b/src/test/common/installer/productInstaller.unit.test.ts index 60fa0e5fed5d..7e5f5389e7f6 100644 --- a/src/test/common/installer/productInstaller.unit.test.ts +++ b/src/test/common/installer/productInstaller.unit.test.ts @@ -291,15 +291,15 @@ suite('Formatter installer', async () => { test('If black is not installed, offer autopep8 and yapf as options', async () => { const messageOptions = [ - Common.bannerLabelYes(), - Products.useFormatter().format(ProductNames.get(Product.autopep8)!), - Products.useFormatter().format(ProductNames.get(Product.yapf)!), - Common.doNotShowAgain(), + Common.bannerLabelYes, + Products.useFormatter.format(ProductNames.get(Product.autopep8)!), + Products.useFormatter.format(ProductNames.get(Product.yapf)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); productPathService .setup((p) => p.isExecutableAModule(TypeMoq.It.isAny(), TypeMoq.It.isAny())) @@ -323,15 +323,15 @@ suite('Formatter installer', async () => { test('If autopep8 is not installed, offer black and yapf as options', async () => { const messageOptions = [ - Common.bannerLabelYes(), - Products.useFormatter().format(ProductNames.get(Product.black)!), - Products.useFormatter().format(ProductNames.get(Product.yapf)!), - Common.doNotShowAgain(), + Common.bannerLabelYes, + Products.useFormatter.format(ProductNames.get(Product.black)!), + Products.useFormatter.format(ProductNames.get(Product.yapf)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); productPathService .setup((p) => p.isExecutableAModule(TypeMoq.It.isAny(), TypeMoq.It.isAny())) @@ -355,15 +355,15 @@ suite('Formatter installer', async () => { test('If yapf is not installed, offer autopep8 and black as options', async () => { const messageOptions = [ - Common.bannerLabelYes(), - Products.useFormatter().format(ProductNames.get(Product.autopep8)!), - Products.useFormatter().format(ProductNames.get(Product.black)!), - Common.doNotShowAgain(), + Common.bannerLabelYes, + Products.useFormatter.format(ProductNames.get(Product.autopep8)!), + Products.useFormatter.format(ProductNames.get(Product.black)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); productPathService .setup((p) => p.isExecutableAModule(TypeMoq.It.isAny(), TypeMoq.It.isAny())) @@ -387,14 +387,14 @@ suite('Formatter installer', async () => { test('If the formatter is not executable as a module, display an error message', async () => { const messageOptions = [ - Products.useFormatter().format(ProductNames.get(Product.autopep8)!), - Products.useFormatter().format(ProductNames.get(Product.yapf)!), - Common.doNotShowAgain(), + Products.useFormatter.format(ProductNames.get(Product.autopep8)!), + Products.useFormatter.format(ProductNames.get(Product.yapf)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); productPathService .setup((p) => p.isExecutableAModule(TypeMoq.It.isAny(), TypeMoq.It.isAny())) @@ -420,15 +420,15 @@ suite('Formatter installer', async () => { test('If "Do not show again" has been selected earlier, do not display the prompt', async () => { const messageOptions = [ - Common.bannerLabelYes(), - Products.useFormatter().format(ProductNames.get(Product.autopep8)!), - Products.useFormatter().format(ProductNames.get(Product.yapf)!), - Common.doNotShowAgain(), + Common.bannerLabelYes, + Products.useFormatter.format(ProductNames.get(Product.autopep8)!), + Products.useFormatter.format(ProductNames.get(Product.yapf)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.never()); persistentStateFactory .setup((p) => p.createGlobalPersistentState(TypeMoq.It.isAnyString(), false)) @@ -448,15 +448,15 @@ suite('Formatter installer', async () => { test('If "Do not show again" is selected, do not install the formatter and do not show the prompt again', async () => { let value = false; const messageOptions = [ - Common.bannerLabelYes(), - Products.useFormatter().format(ProductNames.get(Product.autopep8)!), - Products.useFormatter().format(ProductNames.get(Product.yapf)!), - Common.doNotShowAgain(), + Common.bannerLabelYes, + Products.useFormatter.format(ProductNames.get(Product.autopep8)!), + Products.useFormatter.format(ProductNames.get(Product.yapf)!), + Common.doNotShowAgain, ]; appShell .setup((a) => a.showErrorMessage(TypeMoq.It.isAnyString(), ...messageOptions)) - .returns(() => Promise.resolve(Common.doNotShowAgain())) + .returns(() => Promise.resolve(Common.doNotShowAgain)) .verifiable(TypeMoq.Times.once()); productPathService .setup((p) => p.isExecutableAModule(TypeMoq.It.isAny(), TypeMoq.It.isAny())) diff --git a/src/test/common/net/fileDownloader.unit.test.ts b/src/test/common/net/fileDownloader.unit.test.ts index c9f4e916460d..8c84fe12a014 100644 --- a/src/test/common/net/fileDownloader.unit.test.ts +++ b/src/test/common/net/fileDownloader.unit.test.ts @@ -212,7 +212,7 @@ suite('File Downloader', () => { expect(progressReportStub.args[4][0].message).to.equal(getProgressMessage(50, 100)); function getProgressMessage(downloadedKb: number, percentage: number) { - return Http.downloadingFileProgress().format( + return Http.downloadingFileProgress.format( 'Downloading-something', downloadedKb.toFixed(), totalKb.toFixed(), @@ -255,7 +255,7 @@ suite('File Downloader', () => { extension: '.pdf', }); - traceLogStub.calledWithExactly(Http.downloadingFile().format('file to download')); + traceLogStub.calledWithExactly(Http.downloadingFile.format('file to download')); }); test('Display progress when downloading', async () => { const tmpFile = { filePath: 'my temp file', dispose: noop }; diff --git a/src/test/common/process/logger.unit.test.ts b/src/test/common/process/logger.unit.test.ts index 48d8bca82220..c65c179966b3 100644 --- a/src/test/common/process/logger.unit.test.ts +++ b/src/test/common/process/logger.unit.test.ts @@ -41,7 +41,7 @@ suite('ProcessLogger suite', () => { logger.logProcess('test', ['--foo', '--bar'], options); sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar`); - sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory()} ${options.cwd}`); + sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory} ${options.cwd}`); }); test('Logger adds quotes around arguments if they contain spaces', async () => { @@ -51,7 +51,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar "import test"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} ${path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} ${path.join('debug', 'path')}`, ); }); @@ -62,7 +62,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar "import test"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} ${path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} ${path.join('debug', 'path')}`, ); }); @@ -73,7 +73,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar "import test"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} ${path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} ${path.join('debug', 'path')}`, ); }); @@ -84,7 +84,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar importtest`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} ${path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} ${path.join('debug', 'path')}`, ); }); @@ -95,7 +95,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> test --foo --bar`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} ${path.join('~', 'debug', 'path')}`, + `${Logging.currentWorkingDirectory} ${path.join('~', 'debug', 'path')}`, ); }); @@ -104,7 +104,7 @@ suite('ProcessLogger suite', () => { logger.logProcess(path.join(untildify('~'), 'test'), ['--foo', '--bar'], options); sinon.assert.calledWithExactly(traceLogStub, `> ${path.join('~', 'test')} --foo --bar`); - sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory()} ${options.cwd}`); + sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory} ${options.cwd}`); }); test('Logger replaces the path/to/home with ~ if shell command is provided', async () => { @@ -112,7 +112,7 @@ suite('ProcessLogger suite', () => { logger.logProcess(`"${path.join(untildify('~'), 'test')}" "--foo" "--bar"`, undefined, options); sinon.assert.calledWithExactly(traceLogStub, `> "${path.join('~', 'test')}" "--foo" "--bar"`); - sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory()} ${options.cwd}`); + sinon.assert.calledWithExactly(traceLogStub, `${Logging.currentWorkingDirectory} ${options.cwd}`); }); test('Logger replaces the path to workspace with . if exactly one workspace folder is opened', async () => { @@ -122,7 +122,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> ".${path.sep}test" "--foo" "--bar"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} .${path.sep + path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} .${path.sep + path.join('debug', 'path')}`, ); }); @@ -137,7 +137,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> ".${path.sep}test" "--foo" "--bar"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} .${path.sep + path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} .${path.sep + path.join('debug', 'path')}`, ); traceLogStub.resetHistory(); @@ -147,7 +147,7 @@ suite('ProcessLogger suite', () => { sinon.assert.calledWithExactly(traceLogStub, `> ".${path.sep}test" "--foo" "--bar"`); sinon.assert.calledWithExactly( traceLogStub, - `${Logging.currentWorkingDirectory()} .${path.sep + path.join('debug', 'path')}`, + `${Logging.currentWorkingDirectory} .${path.sep + path.join('debug', 'path')}`, ); }); diff --git a/src/test/common/utils/localize.functional.test.ts b/src/test/common/utils/localize.functional.test.ts deleted file mode 100644 index 2388234c3424..000000000000 --- a/src/test/common/utils/localize.functional.test.ts +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import * as assert from 'assert'; -import * as fs from 'fs'; -import * as path from 'path'; -import { EXTENSION_ROOT_DIR } from '../../../client/common/constants'; -import * as localize from '../../../client/common/utils/localize'; -import * as localizeHelpers from '../../../client/common/utils/localizeHelpers'; - -const defaultNLSFile = path.join(EXTENSION_ROOT_DIR, 'package.nls.json'); - -// Defines a Mocha test suite to group tests of similar kind together -suite('Localization', () => { - // Note: We use package.nls.json by default for tests. Use the - // setLocale() helper to switch to a different locale. - - let localeFiles: string[]; - let nls_orig: string | undefined; - - setup(() => { - localeFiles = []; - - nls_orig = process.env.VSCODE_NLS_CONFIG; - setLocale('en-us'); - - // Ensure each test starts fresh. - localizeHelpers._resetCollections(); - }); - - teardown(() => { - if (nls_orig) { - process.env.VSCODE_NLS_CONFIG = nls_orig; - } else { - delete process.env.VSCODE_NLS_CONFIG; - } - - const filenames = localeFiles; - localeFiles = []; - for (const filename of filenames) { - fs.unlinkSync(filename); - } - }); - - function addLocale(locale: string, nls: Record) { - const filename = addLocaleFile(locale, nls); - localeFiles.push(filename); - } - - test('keys', (done) => { - const val = localize.ExtensionSurveyBanner.bannerMessage(); - assert.strictEqual( - val, - 'Can you please take 2 minutes to tell us how the Python extension is working for you?', - 'LanguageService string doesnt match', - ); - done(); - }); - - test('keys italian', (done) => { - // Force a config change - setLocale('it'); - - const val = localize.ExtensionSurveyBanner.bannerLabelYes(); - assert.strictEqual(val, 'Sì, prenderò il sondaggio ora', 'bannerLabelYes is not being translated'); - done(); - }); - - test('key found for locale', (done) => { - addLocale('spam', { - 'debug.selectConfigurationTitle': '???', - 'Common.gotIt': '!!!', - }); - setLocale('spam'); - - const title = localize.DebugConfigStrings.selectConfiguration.title(); - const gotIt = localize.Common.gotIt(); - - assert.strictEqual(title, '???', 'not used'); - assert.strictEqual(gotIt, '!!!', 'not used'); - done(); - }); - - test('key not found for locale (default used)', (done) => { - addLocale('spam', { - 'debug.selectConfigurationTitle': '???', - }); - setLocale('spam'); - - const gotIt = localize.Common.gotIt(); - - assert.strictEqual(gotIt, 'Got it!', `default not used (got ${gotIt})`); - done(); - }); - - test('keys exist', (done) => { - // Read in the JSON object for the package.nls.json - const nlsCollection = getDefaultCollection(); - - // Now match all of our namespace entries to our nls entries - useEveryLocalization(localize); - - // Now verify all of the asked for keys exist - const askedFor = localizeHelpers._getAskedForCollection(); - const missing: Record = {}; - Object.keys(askedFor).forEach((key: string) => { - // Now check that this key exists somewhere in the nls collection - if (!nlsCollection[key]) { - missing[key] = askedFor[key]; - } - }); - - // If any missing keys, output an error - const missingKeys = Object.keys(missing); - if (missingKeys && missingKeys.length > 0) { - let message = 'Missing keys. Add the following to package.nls.json:\n'; - missingKeys.forEach((k: string) => { - message = message.concat(`\t"${k}" : "${missing[k]}",\n`); - }); - assert.fail(message); - } - - done(); - }); - - test('all keys used', function (done) { - // TODO: Unused keys need to be cleaned up. - - this.skip(); - //test('all keys used', done => { - const nlsCollection = getDefaultCollection(); - useEveryLocalization(localize); - - // Now verify all of the asked for keys exist - const askedFor = localizeHelpers._getAskedForCollection(); - const extra: Record = {}; - Object.keys(nlsCollection).forEach((key: string) => { - // Now check that this key exists somewhere in the nls collection - if (askedFor[key]) { - return; - } - extra[key] = nlsCollection[key]; - }); - - // If any missing keys, output an error - const extraKeys = Object.keys(extra); - if (extraKeys && extraKeys.length > 0) { - let message = 'Unused keys. Remove the following from package.nls.json:\n'; - extraKeys.forEach((k: string) => { - message = message.concat(`\t"${k}" : "${extra[k]}",\n`); - }); - assert.fail(message); - } - - done(); - }); -}); - -function addLocaleFile(locale: string, nls: Record) { - const filename = path.join(EXTENSION_ROOT_DIR, `package.nls.${locale}.json`); - if (fs.existsSync(filename)) { - throw Error(`NLS file ${filename} already exists`); - } - const contents = JSON.stringify(nls); - fs.writeFileSync(filename, contents); - return filename; -} - -function setLocale(locale: string) { - let nls: Record; - if (process.env.VSCODE_NLS_CONFIG) { - nls = JSON.parse(process.env.VSCODE_NLS_CONFIG); - nls.locale = locale; - } else { - nls = { locale: locale }; - } - process.env.VSCODE_NLS_CONFIG = JSON.stringify(nls); -} - -function getDefaultCollection() { - if (!fs.existsSync(defaultNLSFile)) { - throw Error('package.nls.json is missing'); - } - const contents = fs.readFileSync(defaultNLSFile, 'utf8'); - return JSON.parse(contents); -} - -function useEveryLocalization(topns: any) { - // Read all of the namespaces from the localize import. - const entries = Object.keys(topns); - - // Now match all of our namespace entries to our nls entries. - entries.forEach((e: string) => { - // @ts-ignore - if (typeof topns[e] === 'function') { - return; - } - // It must be a namespace. - useEveryLocalizationInNS(topns[e]); - }); -} - -function useEveryLocalizationInNS(ns: any) { - // The namespace should have functions inside of it. - // @ts-ignore - const props = Object.keys(ns); - - // Run every function and cover every sub-namespace. - // This should fill up our "asked-for keys" collection. - props.forEach((key: string) => { - if (typeof ns[key] === 'function') { - const func = ns[key]; - func(); - } else { - useEveryLocalizationInNS(ns[key]); - } - }); -} diff --git a/src/test/configuration/interpreterSelector/commands/resetInterpreter.unit.test.ts b/src/test/configuration/interpreterSelector/commands/resetInterpreter.unit.test.ts index c555734e5165..e1c3a960b99f 100644 --- a/src/test/configuration/interpreterSelector/commands/resetInterpreter.unit.test.ts +++ b/src/test/configuration/interpreterSelector/commands/resetInterpreter.unit.test.ts @@ -91,7 +91,7 @@ suite('Reset Interpreter Command', () => { test('Update selected workspace folder settings when there is more than one workspace folder', async () => { workspace.setup((w) => w.workspaceFolders).returns(() => [folder1, folder2]); const expectedItems = [ - { label: Common.clearAll() }, + { label: Common.clearAll }, { label: 'one', description: path.dirname(folder1.uri.fsPath), @@ -105,7 +105,7 @@ suite('Reset Interpreter Command', () => { detail: 'pythonPath', }, { - label: Interpreters.clearAtWorkspace(), + label: Interpreters.clearAtWorkspace, uri: folder1.uri, }, ]; @@ -141,7 +141,7 @@ suite('Reset Interpreter Command', () => { test('Update entire workspace settings when there is more than one workspace folder and `Select at workspace level` is selected', async () => { workspace.setup((w) => w.workspaceFolders).returns(() => [folder1, folder2]); const expectedItems = [ - { label: Common.clearAll() }, + { label: Common.clearAll }, { label: 'one', description: path.dirname(folder1.uri.fsPath), @@ -155,7 +155,7 @@ suite('Reset Interpreter Command', () => { detail: 'pythonPath', }, { - label: Interpreters.clearAtWorkspace(), + label: Interpreters.clearAtWorkspace, uri: folder1.uri, }, ]; @@ -163,7 +163,7 @@ suite('Reset Interpreter Command', () => { .setup((s) => s.showQuickPick(TypeMoq.It.isValue(expectedItems), TypeMoq.It.isAny())) .returns(() => Promise.resolve({ - label: Interpreters.clearAtWorkspace(), + label: Interpreters.clearAtWorkspace, uri: folder1.uri, }), ) @@ -189,7 +189,7 @@ suite('Reset Interpreter Command', () => { test('Update all folders and workspace scope if `Clear all` is selected', async () => { workspace.setup((w) => w.workspaceFolders).returns(() => [folder1, folder2]); const expectedItems = [ - { label: Common.clearAll() }, + { label: Common.clearAll }, { label: 'one', description: path.dirname(folder1.uri.fsPath), @@ -203,7 +203,7 @@ suite('Reset Interpreter Command', () => { detail: 'pythonPath', }, { - label: Interpreters.clearAtWorkspace(), + label: Interpreters.clearAtWorkspace, uri: folder1.uri, }, ]; @@ -211,7 +211,7 @@ suite('Reset Interpreter Command', () => { .setup((s) => s.showQuickPick(TypeMoq.It.isValue(expectedItems), TypeMoq.It.isAny())) .returns(() => Promise.resolve({ - label: Common.clearAll(), + label: Common.clearAll, uri: folder1.uri, }), ) @@ -260,7 +260,7 @@ suite('Reset Interpreter Command', () => { workspace.setup((w) => w.workspaceFolders).returns(() => [folder1, folder2]); const expectedItems = [ - { label: Common.clearAll() }, + { label: Common.clearAll }, { label: 'one', description: path.dirname(folder1.uri.fsPath), @@ -274,7 +274,7 @@ suite('Reset Interpreter Command', () => { detail: 'pythonPath', }, { - label: Interpreters.clearAtWorkspace(), + label: Interpreters.clearAtWorkspace, uri: folder1.uri, }, ]; diff --git a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts index da3b862cbf92..f84099f2d207 100644 --- a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts +++ b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts @@ -122,7 +122,7 @@ suite('Set Interpreter Command', () => { }; const defaultInterpreterPath = 'defaultInterpreterPath'; const defaultInterpreterPathSuggestion = { - label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label()}`, + label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label}`, description: defaultInterpreterPath, path: defaultInterpreterPath, alwaysShow: true, @@ -141,7 +141,7 @@ suite('Set Interpreter Command', () => { } as PythonEnvironment, }; const expectedEnterInterpreterPathSuggestion = { - label: `${Octicons.Add} ${InterpreterQuickPickList.enterPath.label()}`, + label: `${Octicons.Add} ${InterpreterQuickPickList.enterPath.label}`, alwaysShow: true, }; const currentPythonPath = 'python'; @@ -228,12 +228,12 @@ suite('Set Interpreter Command', () => { recommended, ]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder().format(currentPythonPath), + placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, matchOnDescription: true, - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, sortByLabel: true, keepScrollPosition: true, }; @@ -343,12 +343,12 @@ suite('Set Interpreter Command', () => { interpreterItems[5], ]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder().format(currentPythonPath), + placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, matchOnDescription: true, - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, sortByLabel: true, keepScrollPosition: true, }; @@ -418,7 +418,7 @@ suite('Set Interpreter Command', () => { const separator = { label: EnvGroups.Recommended, kind: QuickPickItemKind.Separator }; const defaultPathSuggestion = { - label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label()}`, + label: `${Octicons.Gear} ${InterpreterQuickPickList.defaultInterpreterPath.label}`, description: expandedDetail, path: expandedPath, alwaysShow: true, @@ -426,12 +426,12 @@ suite('Set Interpreter Command', () => { const suggestions = [expectedEnterInterpreterPathSuggestion, defaultPathSuggestion, separator, recommended]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder().format(currentPythonPath), + placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, matchOnDescription: true, - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, sortByLabel: true, keepScrollPosition: true, }; @@ -549,7 +549,7 @@ suite('Set Interpreter Command', () => { const recommended = cloneDeep(refreshedItem); recommended.label = `${Octicons.Star} ${refreshedItem.label}`; - recommended.description = `${interpreterPath} - ${Common.recommended()}`; + recommended.description = `${interpreterPath} - ${Common.recommended}`; assert.deepStrictEqual( quickPick, { @@ -676,12 +676,12 @@ suite('Set Interpreter Command', () => { suite('Test method _enterOrBrowseInterpreterPath()', async () => { const items: QuickPickItem[] = [ { - label: InterpreterQuickPickList.browsePath.label(), - detail: InterpreterQuickPickList.browsePath.detail(), + label: InterpreterQuickPickList.browsePath.label, + detail: InterpreterQuickPickList.browsePath.detail, }, ]; const expectedParameters = { - placeholder: InterpreterQuickPickList.enterPath.placeholder(), + placeholder: InterpreterQuickPickList.enterPath.placeholder, items, acceptFilterBoxTextAsSelection: true, }; @@ -732,9 +732,9 @@ suite('Set Interpreter Command', () => { filtersObject[filtersKey] = ['exe']; const expectedParams = { filters: filtersObject, - openLabel: InterpreterQuickPickList.browsePath.openButtonLabel(), + openLabel: InterpreterQuickPickList.browsePath.openButtonLabel, canSelectMany: false, - title: InterpreterQuickPickList.browsePath.title(), + title: InterpreterQuickPickList.browsePath.title, }; const multiStepInput = TypeMoq.Mock.ofType>(); multiStepInput.setup((i) => i.showQuickPick(TypeMoq.It.isAny())).returns(() => Promise.resolve(items[0])); @@ -753,9 +753,9 @@ suite('Set Interpreter Command', () => { const multiStepInput = TypeMoq.Mock.ofType>(); const expectedParams = { filters: undefined, - openLabel: InterpreterQuickPickList.browsePath.openButtonLabel(), + openLabel: InterpreterQuickPickList.browsePath.openButtonLabel, canSelectMany: false, - title: InterpreterQuickPickList.browsePath.title(), + title: InterpreterQuickPickList.browsePath.title, }; multiStepInput.setup((i) => i.showQuickPick(TypeMoq.It.isAny())).returns(() => Promise.resolve(items[0])); appShell.setup((a) => a.showOpenDialog(expectedParams)).verifiable(TypeMoq.Times.once()); @@ -806,9 +806,9 @@ suite('Set Interpreter Command', () => { const multiStepInput = TypeMoq.Mock.ofType>(); const expectedParams = { filters: undefined, - openLabel: InterpreterQuickPickList.browsePath.openButtonLabel(), + openLabel: InterpreterQuickPickList.browsePath.openButtonLabel, canSelectMany: false, - title: InterpreterQuickPickList.browsePath.title(), + title: InterpreterQuickPickList.browsePath.title, }; multiStepInput .setup((i) => i.showQuickPick(TypeMoq.It.isAny())) @@ -1004,7 +1004,7 @@ suite('Set Interpreter Command', () => { detail: 'python', }, { - label: Interpreters.entireWorkspace(), + label: Interpreters.entireWorkspace, uri: folder1.uri, }, ]; @@ -1073,7 +1073,7 @@ suite('Set Interpreter Command', () => { detail: 'python', }, { - label: Interpreters.entireWorkspace(), + label: Interpreters.entireWorkspace, uri: folder1.uri, }, ]; @@ -1090,7 +1090,7 @@ suite('Set Interpreter Command', () => { .setup((s) => s.showQuickPick(TypeMoq.It.isValue(expectedItems), TypeMoq.It.isAny())) .returns(() => Promise.resolve({ - label: Interpreters.entireWorkspace(), + label: Interpreters.entireWorkspace, uri: folder1.uri, }), ) @@ -1134,7 +1134,7 @@ suite('Set Interpreter Command', () => { detail: 'python', }, { - label: Interpreters.entireWorkspace(), + label: Interpreters.entireWorkspace, uri: folder1.uri, }, ]; diff --git a/src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts b/src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts index 42f37b5ad5c9..e17b80ab34f7 100644 --- a/src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts +++ b/src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts @@ -91,7 +91,7 @@ suite('Debugging - Outdated Debugger Prompt tests.', () => { }); test('Show prompt when attaching to ptvsd, more info is clicked', async () => { - when(appShell.showInformationMessage(anything(), anything())).thenReturn(Promise.resolve(Common.moreInfo())); + when(appShell.showInformationMessage(anything(), anything())).thenReturn(Promise.resolve(Common.moreInfo)); const deferred = createDeferred(); when(browserService.launch(anything())).thenCall(() => deferred.resolve()); diff --git a/src/test/debugger/extension/configuration/launch.json/completionProvider.unit.test.ts b/src/test/debugger/extension/configuration/launch.json/completionProvider.unit.test.ts index 1c99b70f5b17..c331efbd28b2 100644 --- a/src/test/debugger/extension/configuration/launch.json/completionProvider.unit.test.ts +++ b/src/test/debugger/extension/configuration/launch.json/completionProvider.unit.test.ts @@ -122,14 +122,14 @@ suite('Debugging - launch.json Completion Provider', () => { const expectedCompletionItem: CompletionItem = { command: { command: 'python.SelectAndInsertDebugConfiguration', - title: DebugConfigStrings.launchJsonCompletions.description(), + title: DebugConfigStrings.launchJsonCompletions.description, arguments: [document.object, position, token], }, - documentation: DebugConfigStrings.launchJsonCompletions.description(), + documentation: DebugConfigStrings.launchJsonCompletions.description, sortText: 'AAAA', preselect: true, kind: CompletionItemKind.Enum, - label: DebugConfigStrings.launchJsonCompletions.label(), + label: DebugConfigStrings.launchJsonCompletions.label, insertText: new SnippetString(), }; diff --git a/src/test/debugger/extension/configuration/providers/djangoLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/djangoLaunch.unit.test.ts index 912200638161..6423e19ad76b 100644 --- a/src/test/debugger/extension/configuration/providers/djangoLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/djangoLaunch.unit.test.ts @@ -131,7 +131,7 @@ suite('Debugging - Configuration Provider Django', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.django.snippet.name(), + name: DebugConfigStrings.django.snippet.name, type: DebuggerTypeName, request: 'launch', program: 'xyz.py', @@ -152,7 +152,7 @@ suite('Debugging - Configuration Provider Django', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.django.snippet.name(), + name: DebugConfigStrings.django.snippet.name, type: DebuggerTypeName, request: 'launch', program: 'hello', @@ -176,7 +176,7 @@ suite('Debugging - Configuration Provider Django', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.django.snippet.name(), + name: DebugConfigStrings.django.snippet.name, type: DebuggerTypeName, request: 'launch', program: defaultProgram, diff --git a/src/test/debugger/extension/configuration/providers/fastapiLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/fastapiLaunch.unit.test.ts index 3b86b7edcb36..35ef98ce9cf8 100644 --- a/src/test/debugger/extension/configuration/providers/fastapiLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/fastapiLaunch.unit.test.ts @@ -56,7 +56,7 @@ suite('Debugging - Configuration Provider FastAPI', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.fastapi.snippet.name(), + name: DebugConfigStrings.fastapi.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'uvicorn', @@ -77,7 +77,7 @@ suite('Debugging - Configuration Provider FastAPI', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.fastapi.snippet.name(), + name: DebugConfigStrings.fastapi.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'uvicorn', diff --git a/src/test/debugger/extension/configuration/providers/fileLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/fileLaunch.unit.test.ts index 85321f7df7d0..c074ad33a01c 100644 --- a/src/test/debugger/extension/configuration/providers/fileLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/fileLaunch.unit.test.ts @@ -22,7 +22,7 @@ suite('Debugging - Configuration Provider File', () => { await provider.buildConfiguration(undefined as any, state); const config = { - name: DebugConfigStrings.file.snippet.name(), + name: DebugConfigStrings.file.snippet.name, type: DebuggerTypeName, request: 'launch', program: '${file}', diff --git a/src/test/debugger/extension/configuration/providers/flaskLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/flaskLaunch.unit.test.ts index 57da4c9b10a1..da8213bd1bd4 100644 --- a/src/test/debugger/extension/configuration/providers/flaskLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/flaskLaunch.unit.test.ts @@ -56,7 +56,7 @@ suite('Debugging - Configuration Provider Flask', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.flask.snippet.name(), + name: DebugConfigStrings.flask.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'flask', @@ -81,7 +81,7 @@ suite('Debugging - Configuration Provider Flask', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.flask.snippet.name(), + name: DebugConfigStrings.flask.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'flask', @@ -106,7 +106,7 @@ suite('Debugging - Configuration Provider Flask', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.flask.snippet.name(), + name: DebugConfigStrings.flask.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'flask', diff --git a/src/test/debugger/extension/configuration/providers/moduleLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/moduleLaunch.unit.test.ts index a8d08c0449c9..c0571a1bf30f 100644 --- a/src/test/debugger/extension/configuration/providers/moduleLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/moduleLaunch.unit.test.ts @@ -28,10 +28,10 @@ suite('Debugging - Configuration Provider Module', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.module.snippet.name(), + name: DebugConfigStrings.module.snippet.name, type: DebuggerTypeName, request: 'launch', - module: DebugConfigStrings.module.snippet.default(), + module: DebugConfigStrings.module.snippet.default, justMyCode: true, }; @@ -47,7 +47,7 @@ suite('Debugging - Configuration Provider Module', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.module.snippet.name(), + name: DebugConfigStrings.module.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'hello', diff --git a/src/test/debugger/extension/configuration/providers/pidAttach.unit.test.ts b/src/test/debugger/extension/configuration/providers/pidAttach.unit.test.ts index 16b1c428a756..696179ea9a12 100644 --- a/src/test/debugger/extension/configuration/providers/pidAttach.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/pidAttach.unit.test.ts @@ -22,7 +22,7 @@ suite('Debugging - Configuration Provider File', () => { await provider.buildConfiguration(undefined as any, state); const config = { - name: DebugConfigStrings.attachPid.snippet.name(), + name: DebugConfigStrings.attachPid.snippet.name, type: DebuggerTypeName, request: 'attach', processId: '${command:pickProcess}', diff --git a/src/test/debugger/extension/configuration/providers/pyramidLaunch.unit.test.ts b/src/test/debugger/extension/configuration/providers/pyramidLaunch.unit.test.ts index 067bcc084310..04a74dfd819b 100644 --- a/src/test/debugger/extension/configuration/providers/pyramidLaunch.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/pyramidLaunch.unit.test.ts @@ -131,7 +131,7 @@ suite('Debugging - Configuration Provider Pyramid', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.pyramid.snippet.name(), + name: DebugConfigStrings.pyramid.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'pyramid.scripts.pserve', @@ -153,7 +153,7 @@ suite('Debugging - Configuration Provider Pyramid', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.pyramid.snippet.name(), + name: DebugConfigStrings.pyramid.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'pyramid.scripts.pserve', @@ -178,7 +178,7 @@ suite('Debugging - Configuration Provider Pyramid', () => { await provider.buildConfiguration(instance(input), state); const config = { - name: DebugConfigStrings.pyramid.snippet.name(), + name: DebugConfigStrings.pyramid.snippet.name, type: DebuggerTypeName, request: 'launch', module: 'pyramid.scripts.pserve', diff --git a/src/test/debugger/extension/configuration/providers/remoteAttach.unit.test.ts b/src/test/debugger/extension/configuration/providers/remoteAttach.unit.test.ts index c430363301da..7bf88543bdad 100644 --- a/src/test/debugger/extension/configuration/providers/remoteAttach.unit.test.ts +++ b/src/test/debugger/extension/configuration/providers/remoteAttach.unit.test.ts @@ -79,7 +79,7 @@ suite('Debugging - Configuration Provider Remote Attach', () => { } const config = { - name: DebugConfigStrings.attach.snippet.name(), + name: DebugConfigStrings.attach.snippet.name, type: DebuggerTypeName, request: 'attach', connect: { @@ -115,7 +115,7 @@ suite('Debugging - Configuration Provider Remote Attach', () => { } const config = { - name: DebugConfigStrings.attach.snippet.name(), + name: DebugConfigStrings.attach.snippet.name, type: DebuggerTypeName, request: 'attach', connect: { diff --git a/src/test/interpreters/display.unit.test.ts b/src/test/interpreters/display.unit.test.ts index 74cb5ec101ea..59d3b1d7a404 100644 --- a/src/test/interpreters/display.unit.test.ts +++ b/src/test/interpreters/display.unit.test.ts @@ -136,7 +136,7 @@ suite('Interpreters Display', () => { languageStatusItem.verify( (s) => (s.command = TypeMoq.It.isValue({ - title: InterpreterQuickPickList.browsePath.openButtonLabel(), + title: InterpreterQuickPickList.browsePath.openButtonLabel, command: Commands.Set_Interpreter, })), TypeMoq.Times.once(), @@ -211,7 +211,7 @@ suite('Interpreters Display', () => { .returns(() => Promise.resolve(activeInterpreter)); await interpreterDisplay.refresh(resource); - traceLogStub.calledOnceWithExactly(Interpreters.pythonInterpreterPath().format(activeInterpreter.path)); + traceLogStub.calledOnceWithExactly(Interpreters.pythonInterpreterPath.format(activeInterpreter.path)); }); test('If interpreter is not identified then tooltip should point to python Path', async () => { const resource = Uri.file('x'); @@ -275,7 +275,7 @@ suite('Interpreters Display', () => { statusBar.verify( (s) => (s.text = TypeMoq.It.isValue( - `$(alert) ${InterpreterQuickPickList.browsePath.openButtonLabel()}`, + `$(alert) ${InterpreterQuickPickList.browsePath.openButtonLabel}`, )), TypeMoq.Times.once(), ); diff --git a/src/test/interpreters/display/progressDisplay.unit.test.ts b/src/test/interpreters/display/progressDisplay.unit.test.ts index 66951df8c51e..433fbfe950c9 100644 --- a/src/test/interpreters/display/progressDisplay.unit.test.ts +++ b/src/test/interpreters/display/progressDisplay.unit.test.ts @@ -47,7 +47,7 @@ suite('Interpreters - Display Progress', () => { refreshingCallback(undefined); const options = capture(shell.withProgress as never).last()[0] as ProgressOptions; - expect(options.title).to.be.equal(`[${Interpreters.discovering()}](command:${Commands.Set_Interpreter})`); + expect(options.title).to.be.equal(`[${Interpreters.discovering}](command:${Commands.Set_Interpreter})`); }); test('Display refreshing message when refreshing interpreters for the second time', async () => { @@ -59,12 +59,12 @@ suite('Interpreters - Display Progress', () => { refreshingCallback(undefined); let options = capture(shell.withProgress as never).last()[0] as ProgressOptions; - expect(options.title).to.be.equal(`[${Interpreters.discovering()}](command:${Commands.Set_Interpreter})`); + expect(options.title).to.be.equal(`[${Interpreters.discovering}](command:${Commands.Set_Interpreter})`); refreshingCallback(undefined); options = capture(shell.withProgress as never).last()[0] as ProgressOptions; - expect(options.title).to.be.equal(`[${Interpreters.refreshing()}](command:${Commands.Set_Interpreter})`); + expect(options.title).to.be.equal(`[${Interpreters.refreshing}](command:${Commands.Set_Interpreter})`); }); test('Progress message is hidden when loading has completed', async () => { @@ -79,7 +79,7 @@ suite('Interpreters - Display Progress', () => { const callback = capture(shell.withProgress as never).last()[1] as ProgressTask; const promise = callback(undefined as never, undefined as never); - expect(options.title).to.be.equal(`[${Interpreters.discovering()}](command:${Commands.Set_Interpreter})`); + expect(options.title).to.be.equal(`[${Interpreters.discovering}](command:${Commands.Set_Interpreter})`); refreshDeferred.resolve(); // Promise must resolve when refreshed callback is invoked. diff --git a/src/test/interpreters/virtualEnvs/condaInheritEnvPrompt.unit.test.ts b/src/test/interpreters/virtualEnvs/condaInheritEnvPrompt.unit.test.ts index 5c1b803395e8..6ae070721475 100644 --- a/src/test/interpreters/virtualEnvs/condaInheritEnvPrompt.unit.test.ts +++ b/src/test/interpreters/virtualEnvs/condaInheritEnvPrompt.unit.test.ts @@ -377,7 +377,7 @@ suite('Conda Inherit Env Prompt', async () => { }); suite('Method promptAndUpdate()', () => { - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.moreInfo()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.moreInfo]; setup(() => { workspaceService = TypeMoq.Mock.ofType(); appShell = TypeMoq.Mock.ofType(); @@ -409,7 +409,7 @@ suite('Conda Inherit Env Prompt', async () => { .returns(() => false) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts)) + .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts)) .returns(() => Promise.resolve(undefined)) .verifiable(TypeMoq.Times.never()); await condaInheritEnvPrompt.promptAndUpdate(); @@ -424,7 +424,7 @@ suite('Conda Inherit Env Prompt', async () => { .returns(() => true) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts)) + .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts)) .returns(() => Promise.resolve(undefined)) .verifiable(TypeMoq.Times.once()); workspaceService @@ -457,8 +457,8 @@ suite('Conda Inherit Env Prompt', async () => { .returns(() => true) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts)) - .returns(() => Promise.resolve(Common.bannerLabelYes())) + .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts)) + .returns(() => Promise.resolve(Common.bannerLabelYes)) .verifiable(TypeMoq.Times.once()); workspaceService .setup((ws) => ws.getConfiguration('terminal')) @@ -490,8 +490,8 @@ suite('Conda Inherit Env Prompt', async () => { .returns(() => true) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts)) - .returns(() => Promise.resolve(Common.bannerLabelNo())) + .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts)) + .returns(() => Promise.resolve(Common.bannerLabelNo)) .verifiable(TypeMoq.Times.once()); workspaceService .setup((ws) => ws.getConfiguration('terminal')) @@ -523,8 +523,8 @@ suite('Conda Inherit Env Prompt', async () => { .returns(() => true) .verifiable(TypeMoq.Times.once()); appShell - .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage(), ...prompts)) - .returns(() => Promise.resolve(Common.moreInfo())) + .setup((a) => a.showInformationMessage(Interpreters.condaInheritEnvMessage, ...prompts)) + .returns(() => Promise.resolve(Common.moreInfo)) .verifiable(TypeMoq.Times.once()); workspaceService .setup((ws) => ws.getConfiguration('terminal')) diff --git a/src/test/interpreters/virtualEnvs/virtualEnvPrompt.unit.test.ts b/src/test/interpreters/virtualEnvs/virtualEnvPrompt.unit.test.ts index ef5965e3f98f..129776cc6a15 100644 --- a/src/test/interpreters/virtualEnvs/virtualEnvPrompt.unit.test.ts +++ b/src/test/interpreters/virtualEnvs/virtualEnvPrompt.unit.test.ts @@ -63,7 +63,7 @@ suite('Virtual Environment Prompt', () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; const interpreter2 = { path: 'path/to/interpreter2' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); when(componentAdapter.getWorkspaceVirtualEnvInterpreters(resource)).thenResolve([ @@ -88,7 +88,7 @@ suite('Virtual Environment Prompt', () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; const interpreter2 = { path: 'path/to/interpreter2' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); // Return interpreters using the component adapter instead @@ -117,7 +117,7 @@ suite('Virtual Environment Prompt', () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; const interpreter2 = { path: 'path/to/interpreter2' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); // Return interpreters using the component adapter instead @@ -142,7 +142,7 @@ suite('Virtual Environment Prompt', () => { test("If user selects 'Yes', python path is updated", async () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); when(persistentStateFactory.createWorkspacePersistentState(anything(), true)).thenReturn( notificationPromptEnabled.object, @@ -177,7 +177,7 @@ suite('Virtual Environment Prompt', () => { test("If user selects 'No', no operation is performed", async () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); when(persistentStateFactory.createWorkspacePersistentState(anything(), true)).thenReturn( notificationPromptEnabled.object, @@ -217,7 +217,7 @@ suite('Virtual Environment Prompt', () => { test("If user selects 'Do not show again', prompt is disabled", async () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); when(persistentStateFactory.createWorkspacePersistentState(anything(), true)).thenReturn( notificationPromptEnabled.object, @@ -241,7 +241,7 @@ suite('Virtual Environment Prompt', () => { test('If prompt is disabled, no notification is shown', async () => { const resource = Uri.file('a'); const interpreter1 = { path: 'path/to/interpreter1' }; - const prompts = [Common.bannerLabelYes(), Common.bannerLabelNo(), Common.doNotShowAgain()]; + const prompts = [Common.bannerLabelYes, Common.bannerLabelNo, Common.doNotShowAgain]; const notificationPromptEnabled = TypeMoq.Mock.ofType>(); when(persistentStateFactory.createWorkspacePersistentState(anything(), true)).thenReturn( notificationPromptEnabled.object, diff --git a/src/test/languageServer/watcher.unit.test.ts b/src/test/languageServer/watcher.unit.test.ts index 74a6939ec97b..94f92364fb27 100644 --- a/src/test/languageServer/watcher.unit.test.ts +++ b/src/test/languageServer/watcher.unit.test.ts @@ -288,7 +288,7 @@ suite('Language server watcher', () => { await watcher.startLanguageServer(LanguageServerType.None); - assert.strictEqual(output, LanguageService.startingNone().format('workspace')); + assert.strictEqual(output, LanguageService.startingNone.format('workspace')); }); test(`When starting the language server, if the language server can be started, this.languageServerType should reflect the new language server type`, async () => { diff --git a/src/test/providers/importSortProvider.unit.test.ts b/src/test/providers/importSortProvider.unit.test.ts index b6784cd1cb8c..3d9af8e02790 100644 --- a/src/test/providers/importSortProvider.unit.test.ts +++ b/src/test/providers/importSortProvider.unit.test.ts @@ -669,12 +669,12 @@ suite('Import Sort Provider', () => { shell .setup((s) => s.showWarningMessage( - Diagnostics.checkIsort5UpgradeGuide(), - Common.openOutputPanel(), - Common.doNotShowAgain(), + Diagnostics.checkIsort5UpgradeGuide, + Common.openOutputPanel, + Common.doNotShowAgain, ), ) - .returns(() => Promise.resolve(Common.openOutputPanel())); + .returns(() => Promise.resolve(Common.openOutputPanel)); commandManager.setup((c) => c.executeCommand(Commands.ViewOutput)).verifiable(TypeMoq.Times.once()); await sortProvider._showWarningAndOptionallyShowOutput(); }); @@ -695,12 +695,12 @@ suite('Import Sort Provider', () => { shell .setup((s) => s.showWarningMessage( - Diagnostics.checkIsort5UpgradeGuide(), - Common.openOutputPanel(), - Common.doNotShowAgain(), + Diagnostics.checkIsort5UpgradeGuide, + Common.openOutputPanel, + Common.doNotShowAgain, ), ) - .returns(() => Promise.resolve(Common.doNotShowAgain())) + .returns(() => Promise.resolve(Common.doNotShowAgain)) .verifiable(TypeMoq.Times.once()); await sortProvider._showWarningAndOptionallyShowOutput(); diff --git a/src/test/sourceMapSupport.test.ts b/src/test/sourceMapSupport.test.ts index 1c7de8bc4802..a591e1236619 100644 --- a/src/test/sourceMapSupport.test.ts +++ b/src/test/sourceMapSupport.test.ts @@ -44,7 +44,7 @@ suite('Source Map Support', () => { window: { showWarningMessage: () => { stubInfo.messageDisplayed = true; - return Promise.resolve(selectDisableButton ? Diagnostics.disableSourceMaps() : undefined); + return Promise.resolve(selectDisableButton ? Diagnostics.disableSourceMaps : undefined); }, }, ConfigurationTarget: ConfigurationTarget, diff --git a/src/test/sourceMapSupport.unit.test.ts b/src/test/sourceMapSupport.unit.test.ts index c5f35be23528..3ce5249eca01 100644 --- a/src/test/sourceMapSupport.unit.test.ts +++ b/src/test/sourceMapSupport.unit.test.ts @@ -46,7 +46,7 @@ suite('Source Map Support', () => { window: { showWarningMessage: () => { stubInfo.messageDisplayed = true; - return Promise.resolve(selectDisableButton ? Diagnostics.disableSourceMaps() : undefined); + return Promise.resolve(selectDisableButton ? Diagnostics.disableSourceMaps : undefined); }, }, ConfigurationTarget: ConfigurationTarget, diff --git a/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts b/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts index 0ed80553ab0e..6f096e560d70 100644 --- a/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts +++ b/src/test/tensorBoard/tensorBoardPrompt.unit.test.ts @@ -46,7 +46,7 @@ suite('TensorBoard prompt', () => { }); test('Disable prompt if user selects "Do not show again"', async () => { - await setupPromptWithOptions(true, Common.doNotShowAgain()); + await setupPromptWithOptions(true, Common.doNotShowAgain); verify(persistentState.updateValue(false)).once(); }); diff --git a/src/test/tensorBoard/tensorBoardSession.test.ts b/src/test/tensorBoard/tensorBoardSession.test.ts index 447cf8d470e3..2faaf8e39611 100644 --- a/src/test/tensorBoard/tensorBoardSession.test.ts +++ b/src/test/tensorBoard/tensorBoardSession.test.ts @@ -110,7 +110,7 @@ suite('TensorBoard session creation', async () => { async function createSession() { errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage'); // Stub user selections - sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); const session = (await commandManager.executeCommand( 'python.launchTensorBoard', @@ -137,7 +137,7 @@ suite('TensorBoard session creation', async () => { }); test('When user selects file picker, display file picker', async () => { // Stub user selections - sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.selectAnotherFolder() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.selectAnotherFolder }); const filePickerStub = sandbox.stub(applicationShell, 'showOpenDialog'); // Create session @@ -150,7 +150,7 @@ suite('TensorBoard session creation', async () => { assert.ok(filePickerStub.called, 'User requests to select another folder and file picker was not shown'); }); test('When user selects remote URL, display input box', async () => { - sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.enterRemoteUrl() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.enterRemoteUrl }); const inputBoxStub = sandbox.stub(applicationShell, 'showInputBox'); // Create session @@ -168,23 +168,21 @@ suite('TensorBoard session creation', async () => { }); suite('Installation prompt message', async () => { async function createSessionAndVerifyMessage(message: string) { - sandbox - .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); await commandManager.executeCommand( 'python.launchTensorBoard', TensorBoardEntrypoint.palette, TensorBoardEntrypointTrigger.palette, ); assert.ok( - errorMessageStub.calledOnceWith(message, Common.bannerLabelYes(), Common.bannerLabelNo()), + errorMessageStub.calledOnceWith(message, Common.bannerLabelYes, Common.bannerLabelNo), 'Wrong error message shown', ); } suite('Install profiler package + upgrade tensorboard', async () => { async function runTest(expectTensorBoardUpgrade: boolean) { const installStub = sandbox.stub(installer, 'install').resolves(InstallerResponse.Installed); - await createSessionAndVerifyMessage(TensorBoard.installTensorBoardAndProfilerPluginPrompt()); + await createSessionAndVerifyMessage(TensorBoard.installTensorBoardAndProfilerPluginPrompt); assert.ok(installStub.calledTwice, `Expected 2 installs but got ${installStub.callCount} calls`); assert.ok(installStub.calledWith(Product.torchProfilerInstallName)); assert.ok( @@ -210,7 +208,7 @@ suite('TensorBoard session creation', async () => { configureStubs(true, ProductInstallStatus.Installed, ProductInstallStatus.NotInstalled, 'Yes'); sandbox .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + .resolves({ label: TensorBoard.useCurrentWorkingDirectory }); // Ensure we ask to install the profiler package and that it resolves to a cancellation sandbox .stub(installer, 'install') @@ -226,9 +224,9 @@ suite('TensorBoard session creation', async () => { assert.ok(session.panel?.visible, 'Webview panel not shown, expected successful session creation'); assert.ok( errorMessageStub.calledOnceWith( - TensorBoard.installProfilerPluginPrompt(), - Common.bannerLabelYes(), - Common.bannerLabelNo(), + TensorBoard.installProfilerPluginPrompt, + Common.bannerLabelYes, + Common.bannerLabelNo, ), 'Wrong error message shown', ); @@ -251,7 +249,7 @@ suite('TensorBoard session creation', async () => { torchProfilerInstallStatus, 'No', ); - await createSessionAndVerifyMessage(TensorBoard.installPrompt()); + await createSessionAndVerifyMessage(TensorBoard.installPrompt); }); } }); @@ -260,7 +258,7 @@ suite('TensorBoard session creation', async () => { suite('Upgrade tensorboard only', async () => { async function runTest() { const installStub = sandbox.stub(installer, 'install').resolves(InstallerResponse.Installed); - await createSessionAndVerifyMessage(TensorBoard.upgradePrompt()); + await createSessionAndVerifyMessage(TensorBoard.upgradePrompt); assert.ok(installStub.calledOnce, `Expected 1 install but got ${installStub.callCount} installs`); assert.ok(installStub.args[0][0] === Product.tensorboard, 'Did not install tensorboard'); @@ -297,7 +295,7 @@ suite('TensorBoard session creation', async () => { async function runTest() { sandbox .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + .resolves({ label: TensorBoard.useCurrentWorkingDirectory }); await commandManager.executeCommand( 'python.launchTensorBoard', TensorBoardEntrypoint.palette, @@ -331,9 +329,7 @@ suite('TensorBoard session creation', async () => { }); suite('Error messages', async () => { test('If user cancels starting TensorBoard session, do not show error', async () => { - sandbox - .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); sandbox.stub(applicationShell, 'withProgress').resolves('canceled'); errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage'); @@ -372,9 +368,9 @@ suite('TensorBoard session creation', async () => { assert.ok( errorMessageStub.calledOnceWith( - TensorBoard.installTensorBoardAndProfilerPluginPrompt(), - Common.bannerLabelYes(), - Common.bannerLabelNo(), + TensorBoard.installTensorBoardAndProfilerPluginPrompt, + Common.bannerLabelYes, + Common.bannerLabelNo, ), 'User opted not to install and error was shown', ); @@ -383,7 +379,7 @@ suite('TensorBoard session creation', async () => { sandbox.stub(experimentService, 'inExperiment').resolves(true); errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage'); // Stub user selections - sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.selectAFolder() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.selectAFolder }); sandbox.stub(applicationShell, 'showOpenDialog').resolves(undefined); // Create session @@ -396,9 +392,7 @@ suite('TensorBoard session creation', async () => { assert.ok(errorMessageStub.notCalled, 'User opted not to select a logdir and error was shown'); }); test('If starting TensorBoard times out, show error', async () => { - sandbox - .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); sandbox.stub(applicationShell, 'withProgress').resolves(60_000); errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage'); @@ -412,9 +406,7 @@ suite('TensorBoard session creation', async () => { }); test('If installing the profiler package fails, do not show error, continue to create session', async () => { configureStubs(true, ProductInstallStatus.Installed, ProductInstallStatus.NotInstalled, 'Yes'); - sandbox - .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); // Ensure we ask to install the profiler package and that it resolves to a cancellation sandbox .stub(installer, 'install') @@ -431,9 +423,7 @@ suite('TensorBoard session creation', async () => { }); test('If user opts not to install profiler package and tensorboard is already installed, continue to create session', async () => { configureStubs(true, ProductInstallStatus.Installed, ProductInstallStatus.NotInstalled, 'No'); - sandbox - .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.useCurrentWorkingDirectory }); const session = (await commandManager.executeCommand( 'python.launchTensorBoard', TensorBoardEntrypoint.palette, @@ -445,7 +435,7 @@ suite('TensorBoard session creation', async () => { test('If python.tensorBoard.logDirectory is provided, do not prompt user to pick a log directory', async () => { const selectDirectoryStub = sandbox .stub(applicationShell, 'showQuickPick') - .resolves({ label: TensorBoard.useCurrentWorkingDirectory() }); + .resolves({ label: TensorBoard.useCurrentWorkingDirectory }); errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage'); await workspaceConfiguration.update('logDirectory', 'logs/fit', true); @@ -484,8 +474,8 @@ suite('TensorBoard session creation', async () => { const inputInstance = multiStepFactory.create(); // Create a multistep input with stubs for methods const showQuickPickStub = sandbox.stub(inputInstance, 'showQuickPick').resolves({ - label: TensorBoard.selectMissingSourceFile(), - description: TensorBoard.selectMissingSourceFileDescription(), + label: TensorBoard.selectMissingSourceFile, + description: TensorBoard.selectMissingSourceFileDescription, }); const createInputStub = sandbox .stub(multiStepFactory, 'create') diff --git a/translations_auto_pr.js b/translations_auto_pr.js new file mode 100644 index 000000000000..24b86ab0f6d4 --- /dev/null +++ b/translations_auto_pr.js @@ -0,0 +1,248 @@ +'use strict'; + +const fs = require('fs-extra'); +const cp = require('child_process'); +// const Octokit = require('@octokit/rest'); +const path = require('path'); +const parseGitConfig = require('parse-git-config'); + +const branchName = 'localization'; +const mergeTo = 'main'; +const commitComment = 'Localization - Translated Strings'; +const pullRequestTitle = '[Auto] Localization - Translated Strings'; + +const repoOwner = process.argv[2]; +const repoName = process.argv[3]; +const authUser = process.argv[4]; +const authToken = process.argv[5]; +const userFullName = process.argv[6]; +const userEmail = process.argv[7]; +const locRootPath = process.argv[8]; + +if (!repoOwner || !repoName || !authUser || !authToken || !userFullName || !userEmail || !locRootPath) { + console.error( + `ERROR: Usage: ${path.parse(process.argv[0]).base} ${ + path.parse(process.argv[1]).base + } repo_owner repo_name auth_token user_full_name user_email loc_root_path loc_sub_path`, + ); + console.error(` repo_owner - The owner of the repo on GitHub. i.e. microsoft`); + console.error(` repo_name - The name of the repo on GitHub. i.e. vscode-cpptools`); + console.error(` auth_user - User account wiith permission to post a pull request against the GitHub repo.`); + console.error(` auth_token - A PAT associated with auth_user.`); + console.error( + ` user_full_name - A full name to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`, + ); + console.error( + ` user_email - An email to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`, + ); + console.error( + ` loc_root_path - The path to the folder with language-specific directories (containing localized xlf files).`, + ); + console.error( + ` loc_sub_path - A sub-path after the language-specific directory, where the xlf to import is located. This should not include the name of the xlf file to import.)`, + ); +} + +console.log(`repoOwner=${repoOwner}`); +console.log(`repoName=${repoName}`); +console.log(`authUser=${authUser}`); +console.log(`userFullName=${userFullName}`); +console.log(`userEmail=${userEmail}`); +console.log(`locRootPath=${locRootPath}`); + +function hasBranch() { + console.log(`Checking for existence of branch "${branchName}" (git branch --list ${branchName})`); + const output = cp.execSync(`git branch --list ${branchName}`); + const lines = output.toString().split('\n'); + let found = false; + lines.forEach((line) => { + found = found || line === ` ${branchName}`; + }); + + return found; +} + +function hasAnyChanges() { + console.log('Checking if any files have changed (git status --porcelain)'); + const output = cp.execSync('git status --porcelain'); + const lines = output.toString().split('\n'); + let anyChanges = false; + lines.forEach((line) => { + if (line != '') { + console.log(`Change detected: ${line}`); + anyChanges = true; + } + }); + + return anyChanges; +} + +// When invoked on build server, we should already be in a repo freshly synced to the mergeTo branch + +if (hasAnyChanges()) { + console.log( + `Changes already present in this repo! This script is intended to be run against a freshly synced ${mergeTo} branch!`, + ); +} + +function sleep(ms) { + const unixtimeMs = new Date().getTime(); + while (new Date().getTime() < unixtimeMs + ms) {} +} + +console.log('This script is potentially DESTRUCTIVE! Cancel now, or it will proceed in 10 seconds.'); +sleep(10000); + +const directories = [ + 'cs', + 'de', + 'es', + 'fr', + 'it', + 'ja', + 'ko', + 'pl', + 'pt-BR', + 'ru', + 'tr', + 'zh-Hans', + 'zh-Hant', + 'qps-ploc', +]; +directories.forEach((languageId) => { + console.log(locRootPath); + const sourcePath = `${locRootPath}/${languageId}/${repoName}.xlf`; + const destinationPath = `../vscode-translations-import/${languageId}/${repoName}.xlf`; + console.log(`Copying "${sourcePath}" to "${destinationPath}"`); + fs.copySync(sourcePath, destinationPath); +}); + +console.log('Import translations into i18n directory'); +cp.execSync('npm run translations-import'); + +if (!hasAnyChanges()) { + console.log('No changes detected'); +} + +console.log('Changes detected'); + +console.log(`Ensure main ref is up to date locally (git fetch)`); +cp.execSync('git fetch'); + +// Remove old localization branch, if any +if (hasBranch('localization')) { + console.log(`Remove old localization branch, if any (git branch -D localization)`); + cp.execSync('git branch -D localization'); +} + +// Check out local branch +console.log(`Creating local branch for changes (git checkout -b ${branchName})`); +cp.execSync('git checkout -b localization'); + +// Add changed files. +console.log('Adding changed file (git add .)'); +cp.execSync('git add .'); + +// git add may have resolves CR/LF's and there may not be anything to commit +if (!hasAnyChanges()) { + console.log("No changes detected. The only changes must have been due to CR/LF's, and have been corrected."); +} + +// Set up user and permissions + +// Save existing user name and email, in case already set. +let existingUserName; +let existingUserEmail; +const gitConfigPath = path.resolve(process.cwd(), '.git/config'); +const config = parseGitConfig.sync({ path: gitConfigPath }); + +if (typeof config === 'object' && config.user) { + existingUserName = config.user.name; + existingUserEmail = config.user.email; +} +if (existingUserName === undefined) { + console.log(`Existing user name: undefined`); +} else { + console.log(`Existing user name: "${existingUserName}"`); + cp.execSync(`git config --local --unset user.name`); +} +if (existingUserEmail === undefined) { + console.log(`Existing user email: undefined`); +} else { + console.log(`Existing user email: "${existingUserEmail}"`); + cp.execSync(`git config --local --unset user.email`); +} + +console.log(`Setting local user name to: "${userFullName}"`); +cp.execSync(`git config --local user.name "${userFullName}"`); + +console.log(`Setting local user email to: "${userEmail}"`); +cp.execSync(`git config --local user.email "${userEmail}"`); + +console.log( + `Configuring git with permission to push and to create pull requests (git remote remove origin && git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`, +); +cp.execSync('git remote remove origin'); +cp.execSync(`git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`); + +// Commit changed files. +console.log(`Commiting changes (git commit -m "${commitComment}")`); +cp.execSync(`git commit -m "${commitComment}"`); + +if (existingUserName === undefined) { + console.log(`Restoring original user name: undefined`); + cp.execSync(`git config --local --unset user.name`); +} else { + console.log(`Restoring original user name: "${existingUserName}"`); + cp.execSync(`git config --local user.name "${existingUserName}"`); +} + +if (existingUserEmail === undefined) { + console.log(`Restoring original user email: undefined`); + cp.execSync(`git config --local --unset user.email`); +} else { + console.log(`Restoring original user email: "${existingUserEmail}"`); + cp.execSync(`git config --local user.email "${existingUserEmail}"`); +} + +console.log(`pushing to remove branch (git push -f origin ${branchName})`); +cp.execSync(`git push -f origin ${branchName}`); + +// console.log('Checking if there is already a pull request...'); +// const octokit = new Octokit.Octokit({ auth: authToken }); +// octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({ data }) => { +// let alreadyHasPullRequest = false; +// if (data) { +// data.forEach((pr) => { +// alreadyHasPullRequest = alreadyHasPullRequest || pr.title === pullRequestTitle; +// }); +// } + +// // If not already present, create a PR against our remote branch. +// if (!alreadyHasPullRequest) { +// console.log('There is not already a pull request. Creating one.'); +// octokit.pulls.create({ +// body: '', +// owner: repoOwner, +// repo: repoName, +// title: pullRequestTitle, +// head: branchName, +// base: mergeTo, +// }); +// } else { +// console.log('There is already a pull request.'); +// } + +// console.log(`Restoring default git permissions`); +// cp.execSync('git remote remove origin'); +// cp.execSync(`git remote add origin https://github.com/${repoOwner}/${repoName}.git`); + +// console.log(`Run 'git fetch' against updated remote`); +// cp.execSync('git fetch'); + +// console.log(`Switching back to main (git checkout main)`); +// cp.execSync('git checkout main'); + +// console.log(`Remove localization branch (git branch -D localization)`); +// cp.execSync('git branch -D localization'); +}); From a82e89fed11f1c088d2df1cc70eecc54b6cd63de Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 13:41:36 -0700 Subject: [PATCH 02/39] Update pipeline --- build/azure-pipeline.pre-release.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 04bd7515b67f..afbf389e21a6 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -15,7 +15,7 @@ resources: - repository: templates type: github name: microsoft/vscode-engineering - ref: main + ref: tyler/translations endpoint: Monaco extends: @@ -24,24 +24,18 @@ extends: locPushSteps: - script: echo '$(SetTranslationsPath.EnglishStrings)' - displayName: Install NPM dependencies - script: 'cd $(EXTENSION_DIR) && npm ci' + script: npm ci - script: npm run translations-export displayName: Run translations-export - - publish: $(VSCODE_TRANSLATIONS_EXPORT_DIR) - artifact: translations-export - displayName: Publish translations-export - pwsh: | $Destination = "$(SetTranslationsPath.EnglishStrings)" - New-Item -ItemType Directory -Force "$(SetTranslationsPath.EnglishStrings)" Move-Item "$(Pipeline.Workspace)/ms-python.python" $Destination displayName: Move vscode-python-translations-export to translations path locPullSteps: - script: echo '$(SetTranslationsPath.TranslatedStrings)' - script: 'gulp translations-import --option "${SetTranslationsPath.TranslatedStrings}"' - - pwsh: ls - displayName: test if there is stuff - workingDirectory: '$(SetTranslationsPath.TranslatedStrings)' + - pwsh: ls ./i18n/ buildSteps: - task: NodeTool@0 From 69e2abca0f8487be3c01a511c9f5fd541cf49742 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 13:46:16 -0700 Subject: [PATCH 03/39] Update pushStep --- build/azure-pipeline.pre-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index afbf389e21a6..3e29ffc7f265 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -23,8 +23,8 @@ extends: parameters: locPushSteps: - script: echo '$(SetTranslationsPath.EnglishStrings)' - - displayName: Install NPM dependencies - script: npm ci + - script: npm ci + displayName: Install NPM dependencies - script: npm run translations-export displayName: Run translations-export - pwsh: | From 21e80473b6774225c6ae9eff85cf226006e6c5a5 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 14:04:41 -0700 Subject: [PATCH 04/39] Fix move item step --- build/azure-pipeline.pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 3e29ffc7f265..af30b586fb46 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -29,7 +29,7 @@ extends: displayName: Run translations-export - pwsh: | $Destination = "$(SetTranslationsPath.EnglishStrings)" - Move-Item "$(Pipeline.Workspace)/ms-python.python" $Destination + Move-Item "$(Pipeline.Workspace)/ms-python.python/*" $Destination displayName: Move vscode-python-translations-export to translations path locPullSteps: From 162bfe8d5ae36f0527d831f36b852d47839334a2 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 14:09:02 -0700 Subject: [PATCH 05/39] Fix pull Steps --- build/azure-pipeline.pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index af30b586fb46..6eae3b056de0 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -34,7 +34,7 @@ extends: locPullSteps: - script: echo '$(SetTranslationsPath.TranslatedStrings)' - - script: 'gulp translations-import --option "${SetTranslationsPath.TranslatedStrings}"' + - script: gulp translations-import --option "$(SetTranslationsPath.TranslatedStrings)" - pwsh: ls ./i18n/ buildSteps: From 166f1fac62c4d8ab3a91178c5c8df7064b11bc58 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 14:21:57 -0700 Subject: [PATCH 06/39] Fix pipeline push and pull --- build/azure-pipeline.pre-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 6eae3b056de0..fffce82f5532 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -29,11 +29,13 @@ extends: displayName: Run translations-export - pwsh: | $Destination = "$(SetTranslationsPath.EnglishStrings)" - Move-Item "$(Pipeline.Workspace)/ms-python.python/*" $Destination + Move-Item "$(Pipeline.Workspace)/ms-python.python/*" $Destination -Force displayName: Move vscode-python-translations-export to translations path locPullSteps: - script: echo '$(SetTranslationsPath.TranslatedStrings)' + - script: npm ci + displayName: Install NPM dependencies - script: gulp translations-import --option "$(SetTranslationsPath.TranslatedStrings)" - pwsh: ls ./i18n/ From 710a6da015d7b24551a06ed782520452edd015a5 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 14:35:56 -0700 Subject: [PATCH 07/39] Fix translations import param --- build/azure-pipeline.pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index fffce82f5532..3da9ee90b838 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -36,7 +36,7 @@ extends: - script: echo '$(SetTranslationsPath.TranslatedStrings)' - script: npm ci displayName: Install NPM dependencies - - script: gulp translations-import --option "$(SetTranslationsPath.TranslatedStrings)" + - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" - pwsh: ls ./i18n/ buildSteps: From 38216c2a29f501200962c7897407b68fad88ff1e Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 18:30:52 -0700 Subject: [PATCH 08/39] Fix generate translations task --- gulpfile.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ea72874df97d..e758cb737187 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -391,8 +391,8 @@ const defaultLanguages = [ const generateAdditionalLocFiles = () => gulp .src(['package.nls.json']) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n', 'out')) - .pipe(gulp.dest('out')); + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) + .pipe(gulp.dest('.')); // Generates ./dist/nls.bundle..json from files in ./i18n/** *///.i18n.json // Localized strings are read from these files at runtime. @@ -403,13 +403,13 @@ const generateSrcLocBundle = () => .pipe(sourcemaps.init()) .pipe(tsProject()) .js.pipe(nls.createMetaDataFiles()) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n', 'out')) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) .pipe(nls.bundleLanguageFiles()) .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) .pipe(gulp.dest('out')); -gulp.task('translations-generate', generateSrcLocBundle, generateAdditionalLocFiles); +gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdditionalLocFiles)); // **************************** // Command: translations-export @@ -475,5 +475,3 @@ gulp.task('translations-import', (done) => { }), ); }); - -gulp.task('create-i18n', gulp.series(generateSrcLocBundle, exportTranslations)); From 6d04906c484d3d07263d43be4871d3a2c30c8c1c Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Tue, 19 Apr 2022 18:32:31 -0700 Subject: [PATCH 09/39] Add generate translation task to compile script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b75921e39bbe..1192d239f48a 100644 --- a/package.json +++ b/package.json @@ -1794,7 +1794,7 @@ "scripts": { "package": "gulp clean && gulp prePublishBundle && vsce package -o ms-python-insiders.vsix", "prePublish": "gulp clean && gulp prePublishNonBundle", - "compile": "tsc -watch -p ./", + "compile": "gulp translations-generate && tsc -watch -p ./", "compiled": "deemon npm run compile", "translations-export": "gulp clean && gulp prePublishNonBundle && gulp translations-export", "translations-import": "gulp clean && gulp prePublishNonBundle && gulp translations-import", From e4bc3793d77faf5641194d2204402960f31d51fa Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 09:37:52 -0700 Subject: [PATCH 10/39] Add generate translations in the build steps --- build/azure-pipeline.pre-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 3da9ee90b838..433875126539 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -83,3 +83,6 @@ extends: - script: gulp prePublishBundle displayName: Build + + - script: gulp translations-generate + displayName: Generate translations From b226bcf05ff650fc114ce2a017f63b6fbb869f17 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 09:47:22 -0700 Subject: [PATCH 11/39] Change i18n pt-br file name --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index e758cb737187..fe2c1c91abe1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -373,7 +373,7 @@ const defaultLanguages = [ { id: 'ja', folderName: 'ja' }, { id: 'ko', folderName: 'ko' }, { id: 'pl', folderName: 'pl' }, - { id: 'pt-BR', folderName: 'pt-BR' }, + { id: 'pt-BR', folderName: 'pt-br' }, { id: 'ru', folderName: 'ru' }, { id: 'tr', folderName: 'tr' }, { id: 'zh-Hans', folderName: 'zh-Hans' }, From dd603513eb34076927c9029221de641cc962d325 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 09:54:57 -0700 Subject: [PATCH 12/39] Delete package.nls.de.json --- package.nls.de.json | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 package.nls.de.json diff --git a/package.nls.de.json b/package.nls.de.json deleted file mode 100644 index 1a1d49c2be9c..000000000000 --- a/package.nls.de.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "python.command.python.sortImports.title": "Sortieren der Importe", - "python.command.python.startREPL.title": "Starten des REPL", - "python.command.python.createTerminal.title": "Terminal erstellen", - "python.command.python.execInTerminal.title": "Python-Datei im Terminal ausführen", - "python.command.python.setInterpreter.title": "Interpreter auswählen", - "python.command.python.execSelectionInTerminal.title": "Selektion/Reihe in Python-Terminal ausführen", - "python.command.python.execSelectionInDjangoShell.title": "Selektion/Reihe in Django-Shell ausführen", - "python.command.python.goToPythonObject.title": "Gehe zu Python-Objekt", - "python.command.python.setLinter.title": "Linter auswählen", - "python.command.python.enableLinting.title": "Linting aktivieren", - "python.command.python.runLinting.title": "Linting ausführen", - "python.snippet.launch.standard.label": "Python: Aktuelle Datei", - "python.snippet.launch.module.label": "Python: Modul", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid-Anwendung", - "python.snippet.launch.attach.label": "Python: Anfügen" -} From f6d0349a2322124dea966043a830ac7834f1d425 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 09:56:12 -0700 Subject: [PATCH 13/39] Delete package.nls.pt-br.json --- package.nls.pt-br.json | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 package.nls.pt-br.json diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json deleted file mode 100644 index 9418af230bee..000000000000 --- a/package.nls.pt-br.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "python.command.python.sortImports.title": "Ordenar Importações", - "python.command.python.startREPL.title": "Iniciar REPL", - "python.command.python.createTerminal.title": "Criar Terminal", - "python.command.python.execInTerminal.title": "Executar Arquivo no Terminal", - "python.command.python.setInterpreter.title": "Selecionar Interpretador", - "python.command.python.execSelectionInTerminal.title": "Executar Seleção/Linha no Terminal", - "python.command.python.execSelectionInDjangoShell.title": "Executar Seleção/Linha no Django Shell", - "python.command.python.goToPythonObject.title": "Ir para Objeto Python", - "python.command.python.setLinter.title": "Selecionar Linter", - "python.command.python.enableLinting.title": "Habilitar Linting", - "python.command.python.runLinting.title": "Executar Linting", - "python.snippet.launch.standard.label": "Python: Arquivo Atual", - "python.snippet.launch.module.label": "Python: Módulo", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Aplicação Pyramid", - "python.snippet.launch.attach.label": "Python: Anexar" -} From b05c883065650529567ab29f71e884511d9e1956 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 10:42:57 -0700 Subject: [PATCH 14/39] Move generate translation task to PullStep --- build/azure-pipeline.pre-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 433875126539..de771b32bc2e 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -38,6 +38,8 @@ extends: displayName: Install NPM dependencies - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" - pwsh: ls ./i18n/ + - script: gulp translations-generate + displayName: Generate translations buildSteps: - task: NodeTool@0 @@ -83,6 +85,3 @@ extends: - script: gulp prePublishBundle displayName: Build - - - script: gulp translations-generate - displayName: Generate translations From 0486c9a44934a43d7c705fe344148bd8adf667fd Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 11:01:35 -0700 Subject: [PATCH 15/39] Add nls webpack configuration --- build/webpack/webpack.extension.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index b1b3922126d6..1ab3791423f5 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -26,6 +26,12 @@ const config = { }, module: { rules: [ + { + loader: 'vscode-nls-dev/lib/webpack-loader', + options: { + base: path.join(__dirname, '../../'), + }, + }, { test: /\.ts$/, use: [ From e3e3c2518e280d0b2db9c74193d9efb0b64ababe Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 11:26:15 -0700 Subject: [PATCH 16/39] Add nls config in extension.ts --- src/client/extension.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/extension.ts b/src/client/extension.ts index 13c5039b6c5e..5cbd706dbfce 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -44,6 +44,9 @@ import { IInterpreterService } from './interpreter/contracts'; import { IExtensionApi, IProposedExtensionAPI } from './apiTypes'; import { buildProposedApi } from './proposedApi'; import { WorkspaceService } from './common/application/workspace'; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); durations.codeLoadingTime = stopWatch.elapsedTime; From 66886e4024ab6e3d71767fab833a051cae0be5f8 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 11:41:46 -0700 Subject: [PATCH 17/39] Try new path in webpack loader --- build/webpack/webpack.extension.config.js | 2 +- src/client/common/utils/localize.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index 1ab3791423f5..c8927b2e0617 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -29,7 +29,7 @@ const config = { { loader: 'vscode-nls-dev/lib/webpack-loader', options: { - base: path.join(__dirname, '../../'), + base: path.join(__dirname, '../../src/client'), }, }, { diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 78aae1b0b043..093ac18c6357 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -5,6 +5,7 @@ import * as nls from 'vscode-nls'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ From 4c1089d0ec6b10645db8727ef004d8673ecf90ad Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 11:54:25 -0700 Subject: [PATCH 18/39] Test removing nls conf --- src/client/common/utils/localize.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 093ac18c6357..78aae1b0b043 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -5,7 +5,6 @@ import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ From bd820563af30b03f933d3d8d0868862cc25d1031 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 12:03:49 -0700 Subject: [PATCH 19/39] Add nls plugin --- build/webpack/webpack.extension.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index c8927b2e0617..017c0a7418bf 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -8,6 +8,7 @@ const path = require('path'); const tsconfig_paths_webpack_plugin = require('tsconfig-paths-webpack-plugin'); const constants = require('../constants'); const common = require('./common'); +const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler'); const configFileName = path.join(constants.ExtensionRootDir, 'tsconfig.extension.json'); // Some modules will be pre-genearted and stored in out/.. dir and they'll be referenced via @@ -68,7 +69,7 @@ const config = { 'applicationinsights-native-metrics', '@opentelemetry/tracing', ], - plugins: [...common.getDefaultPlugins('extension')], + plugins: [...common.getDefaultPlugins('extension'), new NLSBundlePlugin('ms-python.python')], resolve: { extensions: ['.ts', '.js'], plugins: [new tsconfig_paths_webpack_plugin.TsconfigPathsPlugin({ configFile: configFileName })], From 8a7c51b1f5de1e1944332d04d4c7976525378d6d Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 12:20:44 -0700 Subject: [PATCH 20/39] Fix translations, remove nls pluging --- build/webpack/webpack.extension.config.js | 2 +- src/client/common/utils/localize.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index 017c0a7418bf..448bef188153 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -69,7 +69,7 @@ const config = { 'applicationinsights-native-metrics', '@opentelemetry/tracing', ], - plugins: [...common.getDefaultPlugins('extension'), new NLSBundlePlugin('ms-python.python')], + plugins: [...common.getDefaultPlugins('extension')], resolve: { extensions: ['.ts', '.js'], plugins: [new tsconfig_paths_webpack_plugin.TsconfigPathsPlugin({ configFile: configFileName })], diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 78aae1b0b043..093ac18c6357 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -5,6 +5,7 @@ import * as nls from 'vscode-nls'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ From f709c3147eba379ce929dc4d682332fda388830d Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 12:35:42 -0700 Subject: [PATCH 21/39] Remove unnecessary files --- build/loc/ExportTranslations.yml | 72 --------- build/loc/ImportTranslations.yml | 41 ----- package.nls.es.json | 19 --- package.nls.fr.json | 19 --- package.nls.it.json | 20 --- package.nls.ja.json | 15 -- package.nls.ko-kr.json | 15 -- package.nls.nl.json | 67 --------- package.nls.pl.json | 16 -- package.nls.ru.json | 26 ---- package.nls.tr.json | 20 --- package.nls.zh-cn.json | 198 ------------------------ package.nls.zh-tw.json | 167 --------------------- translations_auto_pr.js | 248 ------------------------------- 14 files changed, 943 deletions(-) delete mode 100644 build/loc/ExportTranslations.yml delete mode 100644 build/loc/ImportTranslations.yml delete mode 100644 package.nls.es.json delete mode 100644 package.nls.fr.json delete mode 100644 package.nls.it.json delete mode 100644 package.nls.ja.json delete mode 100644 package.nls.ko-kr.json delete mode 100644 package.nls.nl.json delete mode 100644 package.nls.pl.json delete mode 100644 package.nls.ru.json delete mode 100644 package.nls.tr.json delete mode 100644 package.nls.zh-cn.json delete mode 100644 package.nls.zh-tw.json delete mode 100644 translations_auto_pr.js diff --git a/build/loc/ExportTranslations.yml b/build/loc/ExportTranslations.yml deleted file mode 100644 index a3d08ae2ef2c..000000000000 --- a/build/loc/ExportTranslations.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -pr: none -trigger: - branches: - include: - - main -schedules: -- cron: "0 0 * * *" - displayName: Daily midnight build - branches: - include: - - main - -stages: -- stage: Localization - pool: - vmImage: windows-latest - variables: - skipComponentGovernanceDetection: true - VSCODE_EXTENSIONS_LOC_DIR: $(Pipeline.Workspace)/vscode-extensions-loc - EXTENSION_DIR: $(Build.SourcesDirectory) - VSCODE_TRANSLATIONS_EXPORT_DIR: $(Pipeline.Workspace)/ms-python.python - jobs: - - job: Localization - timeoutInMinutes: 180 - steps: - - # Clone extension Repository and run translations-export to get xlf file - - script: git clone https://github.com/microsoft/vscode-extensions-loc/ ${VSCODE_EXTENSIONS_LOC_DIR} - displayName: Clone Microsoft/vscode-extensions-loc - - - - task: NodeTool@0 - inputs: - versionSpec: '14.18.2' - displayName: Select Node version - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - addToPath: true - architecture: 'x64' - displayName: Select Python version - - displayName: Install NPM dependencies - script: 'cd $(EXTENSION_DIR) && npm ci' - - script: npm run translations-export - displayName: Run translations-export - - publish: $(VSCODE_TRANSLATIONS_EXPORT_DIR) - artifact: translations-export - displayName: Publish translations-export - - - pwsh: | - $Destination = "$(VSCODE_EXTENSIONS_LOC_DIR)/src/en" - New-Item -ItemType Directory -Force "$(VSCODE_EXTENSIONS_LOC_DIR)/src/en" - Move-Item "$(VSCODE_TRANSLATIONS_EXPORT_DIR)" $Destination - displayName: Move vscode-python-translations-export to expected path - - - name: Create Pull Request on vscode-extensions-loc - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.REPO_PAT }} - path: ${{ github.workspace }}/vscode-extensions-loc - title: Update Localization xlf files - body: Automated changes based on Microsoft/vscode-python@${{ github.sha }} - branch: update-localization-files-microsoft-vscode-python-${{ github.sha }} - commit-message: update localization xlf files Microsoft/vscode-python@${{ github.sha }} - assignees: PaulaCamargo25 - delete-branch: true diff --git a/build/loc/ImportTranslations.yml b/build/loc/ImportTranslations.yml deleted file mode 100644 index 791a7b935cbb..000000000000 --- a/build/loc/ImportTranslations.yml +++ /dev/null @@ -1,41 +0,0 @@ -# ================================================================================== -# Pipeline for VsCodeExtension-Localization build definition -# Runs OneLocBuild task to localize xlf file -# ================================================================================== - -resources: - repositories: - - repository: self - clean: true - -trigger: none -pr: none -schedules: -- cron: "0 7 * * *" - displayName: Daily 7 AM - branches: - include: - - main - always: true - -pool: - name: 'AzurePipelines-EO' - demands: - - ImageOverride -equals AzurePipelinesWindows2022compliant -variables: - VSCODE_EXTENSIONS_LOC_DIR: $(Pipeline.Workspace)/vscode-extensions-loc - EXTENSION_DIR: $(Build.SourcesDirectory) - -steps: -# Clone extension Repository and run translations-export to get xlf file -- script: git clone https://github.com/microsoft/vscode-extensions-loc/ ${VSCODE_EXTENSIONS_LOC_DIR} - displayName: Clone Microsoft/vscode-extensions-loc -- task: CmdLine@2 - inputs: - script: 'node ./translations_auto_pr.js microsoft vscode-python csigs csigs csigs@users.noreply.github.com "${Build.VSCODE_EXTENSIONS_LOC_DIR}/loc"' - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' diff --git a/package.nls.es.json b/package.nls.es.json deleted file mode 100644 index 2cd46f60a892..000000000000 --- a/package.nls.es.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "python.command.python.sortImports.title": "Ordenar importaciones", - "python.command.python.startREPL.title": "Crear REPL", - "python.command.python.createTerminal.title": "Nuevo terminal", - "python.command.python.execInTerminal.title": "Ejecutar archivo Python en la terminal", - "python.command.python.setInterpreter.title": "Seleccionar intérprete", - "python.command.python.execSelectionInTerminal.title": "Ejecutar línea/selección en la terminal", - "python.command.python.execSelectionInDjangoShell.title": "Ejecutar línea/selección en el intérprete de Django", - "python.command.python.goToPythonObject.title": "Ir al objeto de Python", - "python.command.python.setLinter.title": "Seleccionar Linter", - "python.command.python.enableLinting.title": "Habilitar Linting", - "python.command.python.runLinting.title": "Ejecutar Linting", - "python.snippet.launch.standard.label": "Python: Archivo actual", - "python.snippet.launch.module.label": "Python: Módulo", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid", - "python.snippet.launch.attach.label": "Python: Adjuntar" -} diff --git a/package.nls.fr.json b/package.nls.fr.json deleted file mode 100644 index 605c7a16a74e..000000000000 --- a/package.nls.fr.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "python.command.python.sortImports.title": "Trier les imports", - "python.command.python.startREPL.title": "Démarrer la console interactive", - "python.command.python.createTerminal.title": "Créer un terminal", - "python.command.python.execInTerminal.title": "Exécuter le script Python dans un terminal", - "python.command.python.setInterpreter.title": "Sélectionner l'interpreteur", - "python.command.python.execSelectionInTerminal.title": "Exécuter la ligne/sélection dans un terminal Python", - "python.command.python.execSelectionInDjangoShell.title": "Exécuter la ligne/sélection dans un shell Django", - "python.command.python.goToPythonObject.title": "Se rendre à l'objet Python", - "python.command.python.setLinter.title": "Sélectionner le linter", - "python.command.python.enableLinting.title": "Activer le linting", - "python.command.python.runLinting.title": "Exécuter le linting", - "python.snippet.launch.standard.label": "Python : Fichier actuel", - "python.snippet.launch.module.label": "Python: Module", - "python.snippet.launch.django.label": "Python : Django", - "python.snippet.launch.flask.label": "Python : Flask", - "python.snippet.launch.pyramid.label": "Python : application Pyramid", - "python.snippet.launch.attach.label": "Python: Attacher" -} diff --git a/package.nls.it.json b/package.nls.it.json deleted file mode 100644 index 9ff7f2e83c9f..000000000000 --- a/package.nls.it.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "python.command.python.sortImports.title": "Ordina gli import", - "python.command.python.startREPL.title": "Apri nuova REPL", - "python.command.python.createTerminal.title": "Apri nuovo terminale", - "python.command.python.execInTerminal.title": "Esegui file Python nel terminale", - "python.command.python.setInterpreter.title": "Seleziona interprete", - "python.command.python.execSelectionInTerminal.title": "Esegui selezione/linea nel terminale di Python", - "python.command.python.execSelectionInDjangoShell.title": "Esegui selezione/linea nella shell Django", - "python.command.python.goToPythonObject.title": "Vai a oggetto Python", - "python.command.python.setLinter.title": "Selezione Linter", - "python.command.python.enableLinting.title": "Attiva Linting", - "python.command.python.runLinting.title": "Esegui Linting", - "python.snippet.launch.standard.label": "Python: File corrente", - "python.snippet.launch.module.label": "Python: Modulo", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Applicazione Pyramid", - "python.snippet.launch.attach.label": "Python: Allega", - "ExtensionSurveyBanner.bannerLabelYes": "Sì, prenderò il sondaggio ora" -} diff --git a/package.nls.ja.json b/package.nls.ja.json deleted file mode 100644 index a6c2d1541819..000000000000 --- a/package.nls.ja.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "python.command.python.sortImports.title": "import 文を並び替える", - "python.command.python.startREPL.title": "REPL を開始", - "python.command.python.execInTerminal.title": "ターミナルで Python ファイルを実行", - "python.command.python.setInterpreter.title": "インタープリターを選択", - "python.command.python.execSelectionInTerminal.title": "Python ターミナルで選択範囲/行を実行", - "python.command.python.execSelectionInDjangoShell.title": "Django シェルで選択範囲/行を実行", - "python.command.python.goToPythonObject.title": "Python オブジェクトに移動", - "python.snippet.launch.standard.label": "Python: Current File", - "python.snippet.launch.module.label": "Python: モジュール", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid アプリケーション", - "python.snippet.launch.attach.label": "Python: アタッチ" -} diff --git a/package.nls.ko-kr.json b/package.nls.ko-kr.json deleted file mode 100644 index 7ecce3df7453..000000000000 --- a/package.nls.ko-kr.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "python.command.python.sortImports.title": "Import문 정렬", - "python.command.python.startREPL.title": "REPL 시작", - "python.command.python.execInTerminal.title": "터미널에서 Python 파일 실행", - "python.command.python.setInterpreter.title": "인터프리터 선택", - "python.command.python.execSelectionInTerminal.title": "Python 터미널에서 선택 영역/줄 실행", - "python.command.python.execSelectionInDjangoShell.title": "Django 셸에서 선택 영역/줄 실행", - "python.command.python.goToPythonObject.title": " Python 객체로 이동", - "python.snippet.launch.standard.label": "Python: Current File", - "python.snippet.launch.module.label": "Python: 모듈", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid 응용 프로그램", - "python.snippet.launch.attach.label": "Python: 연결" -} diff --git a/package.nls.nl.json b/package.nls.nl.json deleted file mode 100644 index 6b840e61dbe2..000000000000 --- a/package.nls.nl.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "python.command.python.sortImports.title": "Import sorteren", - "python.command.python.startREPL.title": "REPL starten", - "python.command.python.createTerminal.title": "Terminal aanmaken", - "python.command.python.execInTerminal.title": "Python-bestand in terminal uitvoeren", - "python.command.python.setInterpreter.title": "Interpreter selecteren", - "python.command.python.execSelectionInTerminal.title": "Selectie/rij in Python-terminal uitvoeren", - "python.command.python.execSelectionInDjangoShell.title": "Selectie/rij in Django-shell uitvoeren", - "python.command.python.goToPythonObject.title": "Naar Python-object gaan", - "python.command.python.setLinter.title": "Linter selecteren", - "python.command.python.enableLinting.title": "Linting activeren", - "python.command.python.runLinting.title": "Linting uitvoeren", - "python.command.python.enableSourceMapSupport.title": "Bronkaartondersteuning voor extensie-debugging inschakelen", - "python.snippet.launch.standard.label": "Python: Huidige bestand", - "python.snippet.launch.module.label": "Python: Module", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid-applicatie", - "python.snippet.launch.attach.label": "Python: aankoppelen", - "ExtensionSurveyBanner.bannerLabelYes": "Ja, neem nu deel aan het onderzoek", - "ExtensionSurveyBanner.bannerLabelNo": "Nee, bedankt", - "LanguageService.lsFailedToStart": "We zijn een probleem tegengekomen bij het starten van de language server. Aan het terugschakelen naar het alternatief, Jedi. Bekijk het weergavepaneel voor details.", - "LanguageService.lsFailedToDownload": "We zijn een probleem tegengekomen bij het downloaden van de language server. Aan het terugschakelen naar het alternatief, Jedi. Bekijk het weergavepaneel voor details.", - "LanguageService.lsFailedToExtract": "We zijn een probleem tegengekomen bij het uitpakken van de language server. Aan het terugschakelen naar het alternatief, Jedi. Bekijk het weergavepaneel voor details.", - "Interpreters.RefreshingInterpreters": "Python-Interpreters verversen", - "Linter.InstalledButNotEnabled": "Linter {0} is geinstalleerd maar niet ingeschakeld.", - "Linter.replaceWithSelectedLinter": "Meerdere linters zijn ingeschakeld in de instellingen. Vervangen met '{0}'?", - "diagnostics.warnSourceMaps": "Bronkaartondersteuning is ingeschakeld in de Python-extensie, dit zal een ongunstige impact hebben op de uitvoering van de extensie.", - "diagnostics.disableSourceMaps": "Bronkaartondersteuning uitschakelen", - "diagnostics.warnBeforeEnablingSourceMaps": "Bronkaartondersteuning inschakelen in de Python-extensie zal een ongunstige impact hebben op de uitvoering van de extensie.", - "diagnostics.enableSourceMapsAndReloadVSC": "Venster inschakelen en herladen", - "diagnostics.lsNotSupported": "Uw besturingssysteem voldoet niet aan de minimumeisen van de language server. Aan het terugschakelen naar het alternatief, Jedi.", - "Common.canceled": "Geannuleerd", - "Common.loadingPythonExtension": "Python-extensie aan het laden...", - "debug.selectConfigurationTitle": "Een debug-configuratie selecteren", - "debug.selectConfigurationPlaceholder": "Debug-configuratie", - "debug.debugFileConfigurationLabel": "Python-bestand", - "debug.debugFileConfigurationDescription": "Python-bestand debuggen", - "debug.debugModuleConfigurationLabel": "Module", - "debug.debugModuleConfigurationDescription": "Python module/package debuggen", - "debug.remoteAttachConfigurationLabel": "Extern aankoppelen", - "debug.remoteAttachConfigurationDescription": "Een externe Python-applicatie debuggen", - "debug.debugDjangoConfigurationLabel": "Django", - "debug.debugDjangoConfigurationDescription": "Web-applicatie", - "debug.debugFlaskConfigurationLabel": "Flask", - "debug.debugFlaskConfigurationDescription": "Web-applicatie", - "debug.debugPyramidConfigurationLabel": "Pyramid", - "debug.debugPyramidConfigurationDescription": "Web-applicatie", - "debug.djangoEnterManagePyPathTitle": "Django debuggen", - "debug.djangoEnterManagePyPathPrompt": "Voer een pad in naar manage.py ('${workspaceFolderToken}' verwijzen naar de root van de huidige werkruimtemap)", - "debug.djangoEnterManagePyPathInvalidFilePathError": "Voer een geldig Python-bestandspad in", - "debug.flaskEnterAppPathOrNamePathTitle": "Flask debuggen", - "debug.flaskEnterAppPathOrNamePathPrompt": "Voer een pad in naar een applicatie, bijvoorbeeld 'app.py' of 'app'", - "debug.flaskEnterAppPathOrNamePathInvalidNameError": "Voer een geldige naam in", - "debug.moduleEnterModuleTitle": "Module debuggen", - "debug.moduleEnterModulePrompt": "Voer Python module/package naam in", - "debug.moduleEnterModuleInvalidNameError": "Voer een geldige naam in", - "debug.pyramidEnterDevelopmentIniPathTitle": "Pyramid debuggen", - "debug.pyramidEnterDevelopmentIniPathPrompt": "`Voer een pad in naar development.ini ('${workspaceFolderToken}' verwijzen naar de root van de huidige werkruimtemap)`", - "debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "Voer een geldig bestandspad in", - "debug.attachRemotePortTitle": "Extern debuggen", - "debug.attachRemotePortPrompt": "Voer een port-nummer in", - "debug.attachRemotePortValidationError": "Voer een geldig port-nummer in", - "debug.attachRemoteHostTitle": "Extern debuggen", - "debug.attachRemoteHostPrompt": "Voer een hostname of IP-adres in", - "debug.attachRemoteHostValidationError": "Voer een geldige hostname of IP-adres in" -} diff --git a/package.nls.pl.json b/package.nls.pl.json deleted file mode 100644 index 29c0a84f1709..000000000000 --- a/package.nls.pl.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "python.command.python.sortImports.title": "Sortuj importy", - "python.command.python.startREPL.title": "Uruchom REPL", - "python.command.python.createTerminal.title": "Otwórz Terminal", - "python.command.python.execInTerminal.title": "Uruchom plik pythonowy w terminalu", - "python.command.python.setInterpreter.title": "Wybierz wersję interpretera", - "python.command.python.viewOutput.title": "Pokaż wyniki", - "python.command.python.configureTests.title": "Konfiguruj testy jednostkowe", - "python.command.python.execSelectionInTerminal.title": "Uruchom zaznaczony obszar w interpreterze Pythona", - "python.command.python.execSelectionInDjangoShell.title": "Uruchom zaznaczony obszar w powłoce Django", - "python.command.python.goToPythonObject.title": "Idź do obiektu pythonowego", - "python.command.python.setLinter.title": "Wybierz linter", - "python.command.python.enableLinting.title": "Włącz linting", - "python.command.python.runLinting.title": "Uruchom linting", - "python.command.python.enableSourceMapSupport.title": "Włącz obsługę map źródłowych do debugowania rozszerzeń" -} diff --git a/package.nls.ru.json b/package.nls.ru.json deleted file mode 100644 index df09b32ce72b..000000000000 --- a/package.nls.ru.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "python.command.python.sortImports.title": "Отсортировать Imports", - "python.command.python.startREPL.title": "Открыть REPL", - "python.command.python.execInTerminal.title": "Выполнить файл в консоли", - "python.command.python.setInterpreter.title": "Выбрать интерпретатор", - "python.command.python.execSelectionInTerminal.title": "Выполнить выбранный текст или текущую строку в консоли", - "python.command.python.execSelectionInDjangoShell.title": "Выполнить выбранный текст или текущую строку в оболочке Django", - "python.command.python.goToPythonObject.title": "Перейти к объекту Python", - "python.command.python.setLinter.title": "Выбрать анализатор кода", - "python.command.python.enableLinting.title": "Включить анализатор кода", - "python.command.python.runLinting.title": "Выполнить анализ кода", - "python.snippet.launch.standard.label": "Python: Текущий файл", - "python.snippet.launch.module.label": "Python: Модуль", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Приложение Pyramid", - "python.snippet.launch.attach.label": "Python: Подключить отладчик", - "ExtensionSurveyBanner.bannerLabelYes": "Да, открыть опрос сейчас", - "ExtensionSurveyBanner.bannerLabelNo": "Нет, спасибо", - "ExtensionSurveyBanner.maybeLater": "Может быть, позже", - "ExtensionSurveyBanner.bannerMessage": "Не могли бы вы потратить пару минут на опрос о языковом сервере Pylance?", - "Pylance.remindMeLater": "Напомните позже", - "Pylance.pylanceNotInstalledMessage": "Расширение Pylance не установлено.", - "Pylance.pylanceInstalledReloadPromptMessage": "Расширение Pylance установлено. Перезагрузить окно для его активации?", - "LanguageService.reloadAfterLanguageServerChange": "Пожалуйста, перезагрузите окно после смены типа языкового сервера." -} diff --git a/package.nls.tr.json b/package.nls.tr.json deleted file mode 100644 index 1982ee70012e..000000000000 --- a/package.nls.tr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "python.command.python.sortImports.title": "Import İfadelerini Sırala", - "python.command.python.startREPL.title": "REPL Başlat", - "python.command.python.createTerminal.title": "Terminal Oluştur", - "python.command.python.execInTerminal.title": "Terminalde Çalıştır", - "python.command.python.setInterpreter.title": "Bir Interpreter Seçin", - "python.command.python.execSelectionInTerminal.title": "Seçimi/Satırı Terminalde Çalıştır", - "python.command.python.execSelectionInDjangoShell.title": "Seçimi/Satırı Django Shell'inde Çalıştır", - "python.command.python.goToPythonObject.title": "Python Nesnesine Git", - "python.command.python.setLinter.title": "Bir Linter Seç", - "python.command.python.enableLinting.title": "Linting'i Aktifleştir", - "python.command.python.runLinting.title": "Linter Çalıştır", - "python.snippet.launch.standard.label": "Python: Geçerli Dosya", - "python.snippet.launch.module.label": "Python: Modül", - "python.snippet.launch.module.default": "modül-adını-yazın", - "python.snippet.launch.attach.label": "Python: Remote Attach", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid Uygulaması" -} diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json deleted file mode 100644 index 5a992e56ffa6..000000000000 --- a/package.nls.zh-cn.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "python.command.python.sortImports.title": "排序 import 语句", - "python.command.python.startREPL.title": "启动 REPL", - "python.command.python.createTerminal.title": "创建终端", - "python.command.python.execInTerminal.title": "在终端中运行 Python 文件", - "python.command.python.setInterpreter.title": "选择解释器", - "python.command.python.clearWorkspaceInterpreter.title": "清除工作区解释器设置", - "python.command.python.viewOutput.title": "显示输出", - "python.command.python.viewLanguageServerOutput.title": "显示语言服务器输出", - "python.command.python.configureTests.title": "配置单元测试", - "python.command.python.refreshTests.title": "刷新单元测试", - "python.command.python.refreshingTests.title": "正在刷新单元测试", - "python.command.python.stopRefreshingTests.title": "停止刷新单元测试", - "python.command.testing.rerunFailedTests.title": "重新进行出错的单元测试", - "python.command.python.execSelectionInTerminal.title": "在 Python 终端中运行选定内容/行", - "python.command.python.execSelectionInDjangoShell.title": "在 Django Shell 中运行选定内容/行", - "python.command.python.goToPythonObject.title": "转到 Python 对象", - "python.command.python.reportIssue.title": "报告 Issue", - "python.command.python.setLinter.title": "选择代码检查器", - "python.command.python.enableLinting.title": "启用代码检查", - "python.command.python.runLinting.title": "执行代码检查", - "python.command.python.enableSourceMapSupport.title": "为扩展调试启用 Source Map 支持", - "python.command.python.clearPersistentStorage.title": "清空扩展内部缓存", - "python.command.python.analysis.restartLanguageServer.title": "重启语言服务器", - "python.command.python.launchTensorBoard.title": "启动 TensorBoard", - "python.command.python.refreshTensorBoard.title": "刷新 TensorBoard", - "python.snippet.launch.standard.label": "Python: 当前文件", - "python.snippet.launch.module.label": "Python: 模块", - "python.snippet.launch.module.default": "请输入模块名称", - "python.snippet.launch.attach.label": "Python: 远程连接", - "python.snippet.launch.attachpid.label": "Python: 使用 PID 连接", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.fastapi.label": "Python: FastAPI", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid 应用", - "Pylance.remindMeLater": "稍后提醒", - "Pylance.pylanceNotInstalledMessage": "Pylance 扩展未安装。", - "Pylance.pylanceInstalledReloadPromptMessage": "Pylance 扩展已安装。重新加载窗口以激活?", - "Pylance.pylanceRevertToJediPrompt": "Pylance 扩展未安装,但 python.languageServer 的值被设为了 \"Pylance\"。是否安装 Pylance 扩展,或选择使用 Jedi?", - "Pylance.pylanceInstallPylance": "安装 Pylance", - "Pylance.pylanceRevertToJedi": "使用 Jedi", - "Experiments.inGroup": "用户属于 '{0}' 实验组", - "Experiments.optedOutOf": "用户已退出 '{0}' 实验组", - "Interpreters.RefreshingInterpreters": "正在刷新 Python 解释器", - "Interpreters.entireWorkspace": "完整工作区", - "Interpreters.pythonInterpreterPath": "Python 解释器路径: {0}", - "Interpreters.condaInheritEnvMessage": "您正在使用 conda 环境,如果您在集成终端中遇到相关问题,建议您允许 Python 扩展将用户设置中的 \"terminal.integrated.inheritEnv\" 改为 false。", - "Logging.CurrentWorkingDirectory": "cwd:", - "InterpreterQuickPickList.enterPath.label": "输入解释器路径...", - "InterpreterQuickPickList.enterPath.placeholder": "请输入 Python 解释器的路径。", - "InterpreterQuickPickList.refreshInterpreterList": "刷新解释器列表", - "InterpreterQuickPickList.browsePath.label": "浏览...", - "InterpreterQuickPickList.browsePath.detail": "浏览文件系统来选择一个 Python 解释器。", - "InterpreterQuickPickList.browsePath.title": "选择 Python 解释器", - "InterpreterQuickPickList.defaultInterpreterPath.label": "使用默认 Python 解释器路径", - "Common.bannerLabelYes": "是", - "Common.bannerLabelNo": "否", - "Common.doNotShowAgain": "不再提示", - "Common.reload": "重新加载", - "Common.moreInfo": "更多信息", - "Common.and": "和", - "Common.ok": "好的", - "Common.install": "安装", - "Common.learnMore": "了解更多", - "Common.reportThisIssue": "反馈此问题", - "CommonSurvey.remindMeLaterLabel": "稍后提醒", - "CommonSurvey.yesLabel": "是的,现在接受调查", - "CommonSurvey.noLabel": "不,谢谢", - "OutputChannelNames.languageServer": "Python 语言服务器", - "OutputChannelNames.python": "Python", - "OutputChannelNames.pythonTest": "Python 测试日志", - "ExtensionSurveyBanner.bannerMessage": "请您花两分钟的时间告诉我们 Python 扩展是否正常工作?", - "ExtensionSurveyBanner.bannerLabelYes": "是的,现在接受调查", - "ExtensionSurveyBanner.bannerLabelNo": "不,谢谢", - "ExtensionSurveyBanner.maybeLater": "稍后提醒", - "Interpreters.environmentPromptMessage": "检测到新的虚拟环境,是否在此工作区中使用它?", - "Linter.replaceWithSelectedLinter": "设置中启用了多个代码检查器,是否用 '{0}' 替换?", - "Linter.install": "请安装一个代码检查器以获得错误报告。", - "Linter.selectLinter": "选择代码检查器", - "Installer.noCondaOrPipInstaller": "所选环境中没有可用的 Conda 或 pip 安装器。", - "Installer.noPipInstaller": "所选环境中没有可用的 pip 安装器。", - "Installer.searchForHelp": "搜索帮助", - "Installer.couldNotInstallLibrary": "无法安装 {0} 。如果 pip 不可用,请使用选择的包管理器手动将此库安装到您的 Python 环境中。", - "Installer.dataScienceInstallPrompt": "数据科学库 {0} 未安装,是否安装?", - "diagnostics.removedPythonPathFromSettings": "Python 扩展将不再使用 settings.json 中的 \"python.pythonPath\" 设置。可以将其替换为新设置 \"python.defaultInterpreterPath\"。请注意默认解释器需要手动修改,Python 扩展不会在每次切换解释器时修改该设置。[了解更多](https://aka.ms/AA7jfor).", - "diagnostics.warnSourceMaps": "已启用 Source Map 支持,这会影响 Python 扩展的性能。", - "diagnostics.disableSourceMaps": "禁用 Source Map 支持", - "diagnostics.warnBeforeEnablingSourceMaps": "启用 Source Map 支持将影响 Python 扩展的性能。", - "diagnostics.enableSourceMapsAndReloadVSC": "启用并重新加载窗口", - "diagnostics.lsNotSupported": "该操作系统不符合 Python 语言服务器的最低要求,正在恢复替代的自动补全器 Jedi。", - "diagnostics.invalidPythonPathInDebuggerSettings": "您需要在开始调试前选择一个 Python 解释器。\n\n提示: 点击状态栏中的 \"选择解释器\"。", - "diagnostics.invalidPythonPathInDebuggerLaunch": "调试设置中的 Python 路径无效。", - "diagnostics.invalidDebuggerTypeDiagnostic": "您的 launch.json 文件需要更新,以将 \"pythonExperimental\" 调试设置设为使用 \"python\" 调试器,否则 Python 调试器可能无法工作。立即自动更新 launch.json?", - "diagnostics.consoleTypeDiagnostic": "您的 launch.json 文件需要更新,以将控制台类型字符串从 \"none\" 改为 \"internalConsole\",否则 Python 调试器可能无法工作。立即自动更新 launch.json?", - "diagnostics.justMyCodeDiagnostic": "不再支持 launch.json 中的配置 \"debugStdLib\",建议用 \"justMyCode\" 代替,这与使用 \"debugStdLib\" 完全相反。是否自动更新 launch.json?", - "diagnostics.checkIsort5UpgradeGuide": "此工作区的排序 import 语句配置已过时。查看 [isort 升级指南](https://aka.ms/AA9j5x4) 来更新设置。", - "diagnostics.yesUpdateLaunch": "是,更新 launch.json", - "diagnostics.invalidTestSettings": "您的设置需要更新,以将设置 \"python.unitTest.\" 改为 \"python.testing.\",否则使用该扩展测试 Python 代码可能无法工作。是否自动更新设置?", - "diagnostics.pylanceDefaultMessage": "Python 扩展现在使用 Pylance 以改善代码补全、导航等功能并提升性能。[了解该更新的更多内容以及如何更换语言服务器](https://aka.ms/new-python-bundle)\n\n[Pylance 许可协议](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license).", - "Common.canceled": "已取消", - "Common.cancel": "取消", - "Common.yesPlease": "好的", - "Common.loadingPythonExtension": "Python 扩展正在加载...", - "debug.selectConfigurationTitle": "选择调试配置", - "debug.selectConfigurationPlaceholder": "调试配置", - "debug.launchJsonConfigurationsCompletionLabel": "Python", - "debug.launchJsonConfigurationsCompletionDescription": "选择 Python 调试配置", - "debug.debugFileConfigurationLabel": "Python 文件", - "debug.debugFileConfigurationDescription": "调试打开的 Python 文件", - "debug.debugModuleConfigurationLabel": "模块", - "debug.debugModuleConfigurationDescription": "用'-m'调用 Python 模块进行调试", - "debug.moduleEnterModuleTitle": "调试模块", - "debug.moduleEnterModulePrompt": "请输入 Python 模块/包名", - "debug.moduleEnterModuleDefault": "请输入模块名称", - "debug.moduleEnterModuleInvalidNameError": "请输入有效的模块名称", - "debug.remoteAttachConfigurationLabel": "远程连接", - "debug.remoteAttachConfigurationDescription": "连接到远程调试服务器", - "debug.attachRemoteHostTitle": "远程连接", - "debug.attachRemoteHostPrompt": "请输入主机名", - "debug.attachRemoteHostValidationError": "请输入有效的主机名或 IP 地址", - "debug.attachRemotePortTitle": "远程调试", - "debug.attachRemotePortPrompt": "请输入调试服务器的监听端口号", - "debug.attachRemotePortValidationError": "请输入有效的端口号", - "debug.attachPidConfigurationLabel": "使用 PID 连接", - "debug.attachPidConfigurationDescription": "连接到本地进程", - "debug.debugDjangoConfigurationLabel": "Django", - "debug.debugDjangoConfigurationDescription": "启动并调试 Django Web 应用", - "debug.djangoEnterManagePyPathTitle": "调试 Django", - "debug.djangoEnterManagePyPathPrompt": "请输入 manage.py 的路径('${workspaceFolderToken}'指向当前工作区文件夹的根目录)", - "debug.djangoEnterManagePyPathInvalidFilePathError": "请输入有效的 Python 文件路径", - "debug.debugFastAPIConfigurationLabel": "FastAPI", - "debug.debugFastAPIConfigurationDescription": "启动并调试 FastAPI Web 应用", - "debug.fastapiEnterAppPathOrNamePathTitle": "调试 FastAPI", - "debug.fastapiEnterAppPathOrNamePathPrompt": "请输入应用路径,例如 'main.py' 或 'main'", - "debug.fastapiEnterAppPathOrNamePathInvalidNameError": "请输入有效的名称", - "debug.debugFlaskConfigurationLabel": "Flask", - "debug.debugFlaskConfigurationDescription": "启动并调试 Flask Web 应用", - "debug.flaskEnterAppPathOrNamePathTitle": "调试 Flask", - "debug.flaskEnterAppPathOrNamePathPrompt": "请输入应用路径,例如 'app.py' 或 'app'", - "debug.flaskEnterAppPathOrNamePathInvalidNameError": "请输入有效的名称", - "debug.debugPyramidConfigurationLabel": "Pyramid", - "debug.debugPyramidConfigurationDescription": "Web 应用", - "debug.pyramidEnterDevelopmentIniPathTitle": "调试 Pyramid", - "debug.pyramidEnterDevelopmentIniPathPrompt": "`请输入development.ini的路径('${workspaceFolderToken}'指向当前工作区文件夹的根目录)`", - "debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "请输入有效的文件路径", - "Testing.configureTests": "配置单元测试框架", - "Common.openOutputPanel": "显示输出", - "LanguageService.lsFailedToStart": "启动语言服务器时出错,正在恢复到 Jedi 语言引擎。查看 Python 输出面板了解详情。", - "LanguageService.lsFailedToDownload": "下载语言服务器时出错,正在恢复到 Jedi 语言引擎。查看 Python 输出面板了解详情。", - "LanguageService.lsFailedToExtract": "提取语言服务器时出错,正在恢复到 Jedi 语言引擎。查看 Python 输出面板了解详情。", - "LanguageService.downloadFailedOutputMessage": "语言服务器下载失败", - "LanguageService.extractionFailedOutputMessage": "语言服务器提取失败", - "LanguageService.extractionCompletedOutputMessage": "语言服务器下载完成", - "LanguageService.extractionDoneOutputMessage": "完成", - "LanguageService.reloadVSCodeIfSeachPathHasChanged": "该 Python 解释器的搜索路径已改变,请重新加载扩展以确保 IntelliSense 正常工作。", - "LanguageService.startingPylance": "正在启动 Pylance 语言服务器。", - "LanguageService.startingJedi": "正在启动 Jedi Python 语言服务器。", - "LanguageService.startingNone": "由于语言服务器设置为空,编辑器支持处于非活动状态。", - "LanguageService.reloadAfterLanguageServerChange": "切换语言服务器后请重新加载窗口。", - "AttachProcess.unsupportedOS": "不支持 '{0}' 操作系统。", - "AttachProcess.attachTitle": "连接到进程", - "AttachProcess.selectProcessPlaceholder": "选择要连接的流程", - "AttachProcess.noProcessSelected": "未选择进程", - "AttachProcess.refreshList": "刷新进程列表", - "diagnostics.updateSettings": "是,更新设置", - "Common.noIWillDoItLater": "稍后再做", - "Common.notNow": "稍后提醒", - "Common.gotIt": "好的!", - "Interpreters.selectInterpreterTip": "提示:您可以通过点击状态栏中的 Python 版本来更改 Python 扩展所使用的 Python 解释器", - "downloading.file": "正在下载 {0}...", - "downloading.file.progress": "{2} 中的 {0}{1} KB ({3}%)", - "products.installingModule": "正在安装 {0}", - "OutdatedDebugger.updateDebuggerMessage": "您正在连接至 ptvsd (Python 调试器),而 ptvsd 已于2020年5月1日停止更新。请切换至 [debugpy](https://aka.ms/migrateToDebugpy)。", - "Jupyter.extensionRequired": "执行该任务需要 Jupyter 扩展。点击\"是 \"打开 Jupyter 扩展的安装页面。", - "Jupyter.extensionNotInstalled": "该功能需要安装 Jupyter 扩展才能使用。", - "TensorBoard.missingSourceFile": "源文件缺失,请手动定位文件。", - "TensorBoard.selectMissingSourceFile": "选择文件", - "TensorBoard.selectMissingSourceFileDescription": "源文件的内容可能与记录中的原始内容不一致。", - "TensorBoard.useCurrentWorkingDirectory": "使用当前工作目录", - "TensorBoard.currentDirectory": "当前:{0}", - "TensorBoard.logDirectoryPrompt": "选择一个日志目录来启动 TensorBoard", - "TensorBoard.progressMessage": "正在启动 TensorBoard 会话...", - "TensorBoard.failedToStartSessionError": "启动 TensorBoard 会话失败,错误:{0}", - "TensorBoard.nativeTensorBoardPrompt": "VS Code 现已集成了 TensorBoard 支持。是否启动 TensorBoard?(提示:打开命令面板并搜索 \"启动 TensorBoard\",即可随时启动 TensorBoard。)", - "TensorBoard.selectAFolder": "选择一个文件夹", - "TensorBoard.selectAnotherFolder": "选择另一个文件夹", - "TensorBoard.selectAFolderDetail": "选择一个包含 tfevent 文件的日志目录", - "TensorBoard.selectAnotherFolderDetail": "使用文件资源管理器选择另一个文件夹", - "TensorBoard.useCurrentWorkingDirectoryDetail": "TensorBoard 将在当前工作目录的所有子目录中搜索 tfevent 文件", - "TensorBoard.installPrompt": "启动 TensorBoard 会话需要安装 TensorBoard 包。是否安装?", - "TensorBoard.installTensorBoardAndProfilerPluginPrompt": "需要安装 TensorBoard >= 2.4.1 与 PyTorch TensorBoard 分析器扩展。是否安装这些包?", - "TensorBoard.installProfilerPluginPrompt": "建议安装 PyTorch TensorBoard 分析器扩展。是否安装此包?", - "TensorBoard.upgradePrompt": "TensorBoard 整合仅支持 TensorBoard >= 2.4.1。是否更新 TensorBoard?", - "TensorBoard.launchNativeTensorBoardSessionCodeAction": "启动 TensorBoard 会话", - "TensorBoard.launchNativeTensorBoardSessionCodeLens": "▶ 启动 TensorBoard 会话", - "TensorBoard.enterRemoteUrl": "输入远程 URL", - "TensorBoard.enterRemoteUrlDetail": "输入指向 TensorBoard 远程日志文件夹的 URL" -} diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json deleted file mode 100644 index c29696d5bf32..000000000000 --- a/package.nls.zh-tw.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "python.command.python.sortImports.title": "排序 Import 語句", - "python.command.python.startREPL.title": "啟動 REPL", - "python.command.python.createTerminal.title": "新增終端機", - "python.command.python.execInTerminal.title": "在終端機中執行 Python 檔案", - "python.command.python.debugInTerminal.title": "偵錯 Python 檔案", - "python.command.python.execInTerminalIcon.title": "執行 Python 檔案", - "python.command.python.setInterpreter.title": "選擇直譯器", - "python.command.python.execSelectionInTerminal.title": "在 Python 終端機中執行選定內容/行", - "python.command.python.execSelectionInDjangoShell.title": "在 Django Shell 中執行選定內容/行", - "python.command.python.goToPythonObject.title": "跳至 Python 物件", - "python.command.python.setLinter.title": "選擇 Linter", - "python.command.python.enableLinting.title": "啟用 Linting", - "python.command.python.runLinting.title": "執行 Linting", - "python.snippet.launch.standard.label": "Python: 目前檔案", - "python.snippet.launch.module.label": "Python: 模組", - "python.snippet.launch.module.default": "請輸入-模組-名稱", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.fastapi.label": "Python: FastAPI", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid 程式", - "python.snippet.launch.attach.label": "Python: 附加", - "python.snippet.launch.attachpid.label": "Python: 使用 PID 附加", - "Pylance.remindMeLater": "稍後提醒", - "Pylance.pylanceNotInstalledMessage": "Pylance 延伸模組未安裝。", - "Pylance.pylanceInstalledReloadPromptMessage": "Pylance 延伸模組已安裝。重新載入視窗以啟用?", - "Pylance.pylanceRevertToJediPrompt": "Pylance 延伸模組未安裝,但 python.languageServer 的值被設為 \"Pylance\"。是否安裝 Pylance 延伸模組,或選擇使用 Jedi?", - "Pylance.pylanceInstallPylance": "安裝 Pylance", - "Pylance.pylanceRevertToJedi": "使用 Jedi", - "python.command.python.clearWorkspaceInterpreter.title": "清除工作區直譯器設定", - "python.command.python.reportIssue.title": "回報問題...", - "python.command.python.viewOutput.title": "顯示輸出", - "python.command.python.viewLanguageServerOutput.title": "顯示語言伺服器輸出", - "python.command.python.configureTests.title": "設定測試", - "python.command.python.enableSourceMapSupport.title": "啟用供偵錯延伸模組的原始碼映射 (Source Map) 支援", - "python.command.python.analysis.clearCache.title": "清除模組分析快取", - "python.command.python.clearPersistentStorage.title": "清除延伸模組內部快取", - "python.command.python.analysis.restartLanguageServer.title": "重新啟動語言伺服器", - "python.command.python.launchTensorBoard.title": "啟動 TensorBoard", - "python.command.python.refreshTensorBoard.title": "重新整理 TensorBoard", - "LanguageService.lsFailedToStart": "啟動語言伺服器時遇到問題。改回使用替代方案 \"Jedi\"。請檢查 Python 輸出面板以取得更多資訊。", - "LanguageService.lsFailedToDownload": "下載語言伺服器時遇到問題。改回使用替代方案 \"Jedi\"。請檢查 Python 輸出面板以取得更多資訊。", - "LanguageService.lsFailedToExtract": "擷取語言伺服器時遇到問題。改回使用替代方案 \"Jedi\"。請檢查 Python 輸出面板以取得更多資訊。", - "Experiments.inGroup": "使用者屬於 \"{0}\" 實驗性群組", - "Experiments.optedOutOf": "使用者已退出 '{0}' 實驗性群組", - "Interpreters.RefreshingInterpreters": "正在重新整理 Python 直譯器", - "Interpreters.condaInheritEnvMessage": "我們發覺到您在使用 conda 環境。如果你在整合式終端器中使用這個環境時遇到問題,建議您讓 Python 延伸模組變更使用者設定中的 \"terminal.integrated.inheritEnv\" 為 false。", - "Interpreters.entireWorkspace": "完整工作區", - "Interpreters.pythonInterpreterPath": "Python 直譯器路徑: {0}", - "Logging.CurrentWorkingDirectory": "cwd:", - "InterpreterQuickPickList.enterPath.label": "輸入直譯器路徑...", - "InterpreterQuickPickList.enterPath.placeholder": "輸入 Python 直譯器的路徑。", - "InterpreterQuickPickList.refreshInterpreterList": "重新整理直譯器清單", - "InterpreterQuickPickList.browsePath.label": "瀏覽...", - "InterpreterQuickPickList.browsePath.detail": "瀏覽檔案來選擇 Python 直譯器。", - "InterpreterQuickPickList.browsePath.title": "選擇 Python 直譯器", - "InterpreterQuickPickList.defaultInterpreterPath.label": "使用 `python.defaultInterpreterPath` 設定", - "Common.doNotShowAgain": "不再顯示", - "Common.reload": "重新載入", - "Common.moreInfo": "更多資訊", - "Common.bannerLabelYes": "是", - "Common.bannerLabelNo": "否", - "Common.and": "和", - "Common.ok": "是", - "Common.install": "安裝", - "Common.learnMore": "了解更多", - "Common.reportThisIssue": "回報此問題", - "Common.recommended": "建議", - "CommonSurvey.remindMeLaterLabel": "稍後提醒", - "CommonSurvey.yesLabel": "是,現在接受調查", - "CommonSurvey.noLabel": "不,謝謝", - "OutputChannelNames.languageServer": "Python 語言伺服器", - "OutputChannelNames.python": "Python", - "OutputChannelNames.pythonTest": "Python 測試記錄", - "ExtensionSurveyBanner.bannerMessage": "請問您是否可以用兩分鐘的時間,告訴我們 Python 延伸模組在您環境中的運作情況?", - "ExtensionSurveyBanner.bannerLabelYes": "是,現在填寫調查", - "ExtensionSurveyBanner.bannerLabelNo": "不了,謝謝", - "ExtensionSurveyBanner.maybeLater": "等一下", - "Interpreters.environmentPromptMessage": "We noticed a new virtual environment has been created. Do you want to select it for the workspace folder?", - "Linter.replaceWithSelectedLinter": "設定中啟用了多個 Linter。是否用 '{0}' 取代?", - "Installer.noCondaOrPipInstaller": "選取環境中沒有可用的 Conda 或 Pip 安裝工具。", - "Installer.noPipInstaller": "選取環境中沒有可用的 Pip 安裝工具。", - "Installer.searchForHelp": "搜尋說明", - "diagnostics.warnSourceMaps": "已在 Python 延伸模組中啟用原始碼映射 (Source Map) 支援,這會降低延伸模組效能。", - "diagnostics.disableSourceMaps": "停用原始碼映射 (Source Map) 支援", - "diagnostics.warnBeforeEnablingSourceMaps": "在 Python 延伸模組中啟用原始碼映射 (Source Map) 支援會降低延伸模組效能。", - "diagnostics.enableSourceMapsAndReloadVSC": "啟用並重新載入視窗", - "diagnostics.lsNotSupported": "您的作業系統不符合 Python 語言伺服器的最低需求。改回使用替代自動完成提供者 \"Jedi\"。", - "diagnostics.invalidPythonPathInDebuggerSettings": "開始偵錯前,您需要選取 Python 直譯器。\n\n小提示:按一下狀態列的 \"選擇 Python 直譯器\"。", - "diagnostics.invalidPythonPathInDebuggerLaunch": "偵錯設定檔的 Python 路徑無效。", - "diagnostics.invalidDebuggerTypeDiagnostic": "Your launch.json file needs to be updated to change the \"pythonExperimental\" debug configurations to use the \"python\" debugger type, otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?", - "diagnostics.consoleTypeDiagnostic": "Your launch.json file needs to be updated to change the console type string from \"none\" to \"internalConsole\", otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?", - "diagnostics.justMyCodeDiagnostic": "Configuration \"debugStdLib\" in launch.json is no longer supported. It's recommended to replace it with \"justMyCode\", which is the exact opposite of using \"debugStdLib\". Would you like to automatically update your launch.json file to do that?", - "diagnostics.yesUpdateLaunch": "是,更新 launch.json", - "diagnostics.invalidTestSettings": "Your settings needs to be updated to change the setting \"python.unitTest.\" to \"python.testing.\", otherwise testing Python code using the extension may not work. Would you like to automatically update your settings now?", - "Common.canceled": "已取消", - "Common.cancel": "取消", - "Common.loadingPythonExtension": "正在載入 Python 延伸模組...", - "debug.selectConfigurationTitle": "選擇偵錯設定檔", - "debug.selectConfigurationPlaceholder": "偵錯設定檔", - "debug.launchJsonConfigurationsCompletionLabel": "Python", - "debug.launchJsonConfigurationsCompletionDescription": "選取 Python 偵錯設定檔", - "debug.debugFileConfigurationLabel": "Python 檔案", - "debug.debugFileConfigurationDescription": "偵錯目前使用中的 Python 檔案", - "debug.debugModuleConfigurationLabel": "模組", - "debug.debugModuleConfigurationDescription": "使用 '-m' 叫用以偵錯 Python 模組", - "debug.moduleEnterModuleTitle": "偵錯模組", - "debug.moduleEnterModulePrompt": "輸入 Python 模組 / 套件名稱", - "debug.moduleEnterModuleDefault": "輸入-模組-名稱", - "debug.moduleEnterModuleInvalidNameError": "請輸入有效的模組名稱", - "debug.remoteAttachConfigurationLabel": "遠端連結", - "debug.remoteAttachConfigurationDescription": "連結到遠端偵錯伺服器", - "debug.attachRemoteHostTitle": "遠端偵錯", - "debug.attachRemoteHostPrompt": "輸入主機名稱", - "debug.attachRemoteHostValidationError": "請輸入有效的主機名稱或 IP 位址", - "debug.attachRemotePortTitle": "遠端偵錯", - "debug.attachRemotePortPrompt": "輸入偵錯伺服器正在監聽的連線埠號。", - "debug.attachRemotePortValidationError": "請輸入有效的連線埠號。", - "debug.attachPidConfigurationLabel": "使用處理程序 ID 連結", - "debug.attachPidConfigurationDescription": "連結至本機處理程序", - "debug.debugDjangoConfigurationLabel": "Django", - "debug.debugDjangoConfigurationDescription": "執行並偵錯 Django 網路應用程式", - "debug.djangoEnterManagePyPathTitle": "偵錯 Django", - "debug.djangoEnterManagePyPathPrompt": "請輸入 manage.py 的路徑 ('${workspaceFolderToken}' 指向目前工作區資料夾的根目錄)", - "debug.djangoEnterManagePyPathInvalidFilePathError": "請輸入有效的 Python 檔案路徑", - "debug.debugFastAPIConfigurationLabel": "FastAPI", - "debug.debugFastAPIConfigurationDescription": "執行並偵錯 FastAPI 網路應用程式", - "debug.fastapiEnterAppPathOrNamePathTitle": "偵錯 FastAPI", - "debug.fastapiEnterAppPathOrNamePathPrompt": "請輸入應用程式路徑。例如:'main.py' or 'main'", - "debug.fastapiEnterAppPathOrNamePathInvalidNameError": "請輸入有效名稱", - "debug.debugFlaskConfigurationLabel": "Flask", - "debug.debugFlaskConfigurationDescription": "執行並偵錯 Flask 網路應用程式", - "debug.flaskEnterAppPathOrNamePathTitle": "偵錯 Flask", - "debug.flaskEnterAppPathOrNamePathPrompt": "請輸入應用程式路徑。例如:'app.py' 或 'app'", - "debug.flaskEnterAppPathOrNamePathInvalidNameError": "請輸入有效名稱", - "debug.debugPyramidConfigurationLabel": "Pyramid", - "debug.debugPyramidConfigurationDescription": "網路應用程式", - "debug.pyramidEnterDevelopmentIniPathTitle": "偵錯 Pyramid", - "debug.pyramidEnterDevelopmentIniPathPrompt": "`請輸入 development.ini 的路徑 ('${workspaceFolderToken}' 指向目前工作區資料夾的根目錄)`", - "debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "請輸入有效的檔案路徑", - "Testing.configureTests": "設定測試框架", - "Testing.testNotConfigured": "未設定測試框架。", - "Common.openOutputPanel": "顯示輸出", - "LanguageService.downloadFailedOutputMessage": "下載語言伺服器失敗", - "LanguageService.extractionFailedOutputMessage": "擷取語言伺服器失敗", - "LanguageService.extractionCompletedOutputMessage": "下載語言伺服器完成", - "LanguageService.extractionDoneOutputMessage": "完成", - "LanguageService.reloadVSCodeIfSeachPathHasChanged": "已為此 Python 解譯器變更搜尋路徑。請重新載入延伸模組以確保 IntelliSense 能夠正常運作", - "LanguageService.startingMicrosoft": "正在啟動 Microsoft Python 語言伺服器。", - "LanguageService.startingPylance": "正在啟動 Pylance 語言伺服器。", - "LanguageService.startingJedi": "正在啟動 Jedi 語言伺服器。", - "LanguageService.startingNone": "由於未設定語言伺服器,所以無法使用編輯器支援。", - "LanguageService.reloadAfterLanguageServerChange": "切換語言伺服器後請重新載入視窗。", - "AttachProcess.unsupportedOS": "不支援 '{0}' 作業系統。", - "AttachProcess.attachTitle": "連結至處理程序", - "AttachProcess.selectProcessPlaceholder": "選擇要連結的處理程序", - "AttachProcess.noProcessSelected": "沒有選取的處理程序", - "AttachProcess.refreshList": "重新整理處理程序列表", - "diagnostics.updateSettings": "是,更新設定", - "Common.noIWillDoItLater": "否,我稍候再做", - "Common.notNow": "先不要", - "Common.gotIt": "懂了!", - "Interpreters.selectInterpreterTip": "小提示:您能透過按下狀態列中的 Python 版本,變更 Python 延伸模組使用的 Python 解譯器。", - "downloading.file": "正在下載 {0}...", - "downloading.file.progress": "目前 {0}{1},總共 {2} KB ({3}%)", - "products.installingModule": "正在安裝 {0}" -} diff --git a/translations_auto_pr.js b/translations_auto_pr.js deleted file mode 100644 index 24b86ab0f6d4..000000000000 --- a/translations_auto_pr.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict'; - -const fs = require('fs-extra'); -const cp = require('child_process'); -// const Octokit = require('@octokit/rest'); -const path = require('path'); -const parseGitConfig = require('parse-git-config'); - -const branchName = 'localization'; -const mergeTo = 'main'; -const commitComment = 'Localization - Translated Strings'; -const pullRequestTitle = '[Auto] Localization - Translated Strings'; - -const repoOwner = process.argv[2]; -const repoName = process.argv[3]; -const authUser = process.argv[4]; -const authToken = process.argv[5]; -const userFullName = process.argv[6]; -const userEmail = process.argv[7]; -const locRootPath = process.argv[8]; - -if (!repoOwner || !repoName || !authUser || !authToken || !userFullName || !userEmail || !locRootPath) { - console.error( - `ERROR: Usage: ${path.parse(process.argv[0]).base} ${ - path.parse(process.argv[1]).base - } repo_owner repo_name auth_token user_full_name user_email loc_root_path loc_sub_path`, - ); - console.error(` repo_owner - The owner of the repo on GitHub. i.e. microsoft`); - console.error(` repo_name - The name of the repo on GitHub. i.e. vscode-cpptools`); - console.error(` auth_user - User account wiith permission to post a pull request against the GitHub repo.`); - console.error(` auth_token - A PAT associated with auth_user.`); - console.error( - ` user_full_name - A full name to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`, - ); - console.error( - ` user_email - An email to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`, - ); - console.error( - ` loc_root_path - The path to the folder with language-specific directories (containing localized xlf files).`, - ); - console.error( - ` loc_sub_path - A sub-path after the language-specific directory, where the xlf to import is located. This should not include the name of the xlf file to import.)`, - ); -} - -console.log(`repoOwner=${repoOwner}`); -console.log(`repoName=${repoName}`); -console.log(`authUser=${authUser}`); -console.log(`userFullName=${userFullName}`); -console.log(`userEmail=${userEmail}`); -console.log(`locRootPath=${locRootPath}`); - -function hasBranch() { - console.log(`Checking for existence of branch "${branchName}" (git branch --list ${branchName})`); - const output = cp.execSync(`git branch --list ${branchName}`); - const lines = output.toString().split('\n'); - let found = false; - lines.forEach((line) => { - found = found || line === ` ${branchName}`; - }); - - return found; -} - -function hasAnyChanges() { - console.log('Checking if any files have changed (git status --porcelain)'); - const output = cp.execSync('git status --porcelain'); - const lines = output.toString().split('\n'); - let anyChanges = false; - lines.forEach((line) => { - if (line != '') { - console.log(`Change detected: ${line}`); - anyChanges = true; - } - }); - - return anyChanges; -} - -// When invoked on build server, we should already be in a repo freshly synced to the mergeTo branch - -if (hasAnyChanges()) { - console.log( - `Changes already present in this repo! This script is intended to be run against a freshly synced ${mergeTo} branch!`, - ); -} - -function sleep(ms) { - const unixtimeMs = new Date().getTime(); - while (new Date().getTime() < unixtimeMs + ms) {} -} - -console.log('This script is potentially DESTRUCTIVE! Cancel now, or it will proceed in 10 seconds.'); -sleep(10000); - -const directories = [ - 'cs', - 'de', - 'es', - 'fr', - 'it', - 'ja', - 'ko', - 'pl', - 'pt-BR', - 'ru', - 'tr', - 'zh-Hans', - 'zh-Hant', - 'qps-ploc', -]; -directories.forEach((languageId) => { - console.log(locRootPath); - const sourcePath = `${locRootPath}/${languageId}/${repoName}.xlf`; - const destinationPath = `../vscode-translations-import/${languageId}/${repoName}.xlf`; - console.log(`Copying "${sourcePath}" to "${destinationPath}"`); - fs.copySync(sourcePath, destinationPath); -}); - -console.log('Import translations into i18n directory'); -cp.execSync('npm run translations-import'); - -if (!hasAnyChanges()) { - console.log('No changes detected'); -} - -console.log('Changes detected'); - -console.log(`Ensure main ref is up to date locally (git fetch)`); -cp.execSync('git fetch'); - -// Remove old localization branch, if any -if (hasBranch('localization')) { - console.log(`Remove old localization branch, if any (git branch -D localization)`); - cp.execSync('git branch -D localization'); -} - -// Check out local branch -console.log(`Creating local branch for changes (git checkout -b ${branchName})`); -cp.execSync('git checkout -b localization'); - -// Add changed files. -console.log('Adding changed file (git add .)'); -cp.execSync('git add .'); - -// git add may have resolves CR/LF's and there may not be anything to commit -if (!hasAnyChanges()) { - console.log("No changes detected. The only changes must have been due to CR/LF's, and have been corrected."); -} - -// Set up user and permissions - -// Save existing user name and email, in case already set. -let existingUserName; -let existingUserEmail; -const gitConfigPath = path.resolve(process.cwd(), '.git/config'); -const config = parseGitConfig.sync({ path: gitConfigPath }); - -if (typeof config === 'object' && config.user) { - existingUserName = config.user.name; - existingUserEmail = config.user.email; -} -if (existingUserName === undefined) { - console.log(`Existing user name: undefined`); -} else { - console.log(`Existing user name: "${existingUserName}"`); - cp.execSync(`git config --local --unset user.name`); -} -if (existingUserEmail === undefined) { - console.log(`Existing user email: undefined`); -} else { - console.log(`Existing user email: "${existingUserEmail}"`); - cp.execSync(`git config --local --unset user.email`); -} - -console.log(`Setting local user name to: "${userFullName}"`); -cp.execSync(`git config --local user.name "${userFullName}"`); - -console.log(`Setting local user email to: "${userEmail}"`); -cp.execSync(`git config --local user.email "${userEmail}"`); - -console.log( - `Configuring git with permission to push and to create pull requests (git remote remove origin && git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`, -); -cp.execSync('git remote remove origin'); -cp.execSync(`git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`); - -// Commit changed files. -console.log(`Commiting changes (git commit -m "${commitComment}")`); -cp.execSync(`git commit -m "${commitComment}"`); - -if (existingUserName === undefined) { - console.log(`Restoring original user name: undefined`); - cp.execSync(`git config --local --unset user.name`); -} else { - console.log(`Restoring original user name: "${existingUserName}"`); - cp.execSync(`git config --local user.name "${existingUserName}"`); -} - -if (existingUserEmail === undefined) { - console.log(`Restoring original user email: undefined`); - cp.execSync(`git config --local --unset user.email`); -} else { - console.log(`Restoring original user email: "${existingUserEmail}"`); - cp.execSync(`git config --local user.email "${existingUserEmail}"`); -} - -console.log(`pushing to remove branch (git push -f origin ${branchName})`); -cp.execSync(`git push -f origin ${branchName}`); - -// console.log('Checking if there is already a pull request...'); -// const octokit = new Octokit.Octokit({ auth: authToken }); -// octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({ data }) => { -// let alreadyHasPullRequest = false; -// if (data) { -// data.forEach((pr) => { -// alreadyHasPullRequest = alreadyHasPullRequest || pr.title === pullRequestTitle; -// }); -// } - -// // If not already present, create a PR against our remote branch. -// if (!alreadyHasPullRequest) { -// console.log('There is not already a pull request. Creating one.'); -// octokit.pulls.create({ -// body: '', -// owner: repoOwner, -// repo: repoName, -// title: pullRequestTitle, -// head: branchName, -// base: mergeTo, -// }); -// } else { -// console.log('There is already a pull request.'); -// } - -// console.log(`Restoring default git permissions`); -// cp.execSync('git remote remove origin'); -// cp.execSync(`git remote add origin https://github.com/${repoOwner}/${repoName}.git`); - -// console.log(`Run 'git fetch' against updated remote`); -// cp.execSync('git fetch'); - -// console.log(`Switching back to main (git checkout main)`); -// cp.execSync('git checkout main'); - -// console.log(`Remove localization branch (git branch -D localization)`); -// cp.execSync('git branch -D localization'); -}); From 6f6f9d9f0135ce19c4cd95ef9dd20e83d66b8ab9 Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Wed, 20 Apr 2022 12:38:33 -0700 Subject: [PATCH 22/39] Clean code --- build/webpack/webpack.extension.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index 448bef188153..c8927b2e0617 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -8,7 +8,6 @@ const path = require('path'); const tsconfig_paths_webpack_plugin = require('tsconfig-paths-webpack-plugin'); const constants = require('../constants'); const common = require('./common'); -const { NLSBundlePlugin } = require('vscode-nls-dev/lib/webpack-bundler'); const configFileName = path.join(constants.ExtensionRootDir, 'tsconfig.extension.json'); // Some modules will be pre-genearted and stored in out/.. dir and they'll be referenced via From 2cd4150e85c8e1696d2ca3415dbe9045b638357f Mon Sep 17 00:00:00 2001 From: paulacamargo25 Date: Thu, 21 Apr 2022 09:41:00 -0700 Subject: [PATCH 23/39] Fix some comments --- build/azure-pipeline.pre-release.yml | 7 +- build/webpack/webpack.extension.config.js | 1 + gulpfile.js | 650 +++++++++++----------- 3 files changed, 326 insertions(+), 332 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index de771b32bc2e..0cc121de34c6 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -22,22 +22,17 @@ extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: locPushSteps: - - script: echo '$(SetTranslationsPath.EnglishStrings)' - script: npm ci displayName: Install NPM dependencies - script: npm run translations-export displayName: Run translations-export - - pwsh: | - $Destination = "$(SetTranslationsPath.EnglishStrings)" - Move-Item "$(Pipeline.Workspace)/ms-python.python/*" $Destination -Force + - pwsh: Move-Item "$(Pipeline.Workspace)/ms-python.python/*" "$(SetTranslationsPath.EnglishStrings)" -Force displayName: Move vscode-python-translations-export to translations path locPullSteps: - - script: echo '$(SetTranslationsPath.TranslatedStrings)' - script: npm ci displayName: Install NPM dependencies - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" - - pwsh: ls ./i18n/ - script: gulp translations-generate displayName: Generate translations diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index c8927b2e0617..5b6a1b72eeb5 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -29,6 +29,7 @@ const config = { { loader: 'vscode-nls-dev/lib/webpack-loader', options: { + // points to where the entrypoint is (the extension.ts) base: path.join(__dirname, '../../src/client'), }, }, diff --git a/gulpfile.js b/gulpfile.js index fe2c1c91abe1..6287438af7a2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -33,15 +33,15 @@ const filter = require('gulp-filter'); const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined; gulp.task('compile', (done) => { - let failed = false; - tsProject - .src() - .pipe(tsProject()) - .on('error', () => { - failed = true; - }) - .js.pipe(gulp.dest('out')) - .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); + let failed = false; + tsProject + .src() + .pipe(tsProject()) + .on('error', () => { + failed = true; + }) + .js.pipe(gulp.dest('out')) + .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); }); gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done)); @@ -55,172 +55,169 @@ gulp.task('clean:out', () => del(['out'])); gulp.task('clean', gulp.parallel('output:clean', 'clean:vsix', 'clean:out')); gulp.task('checkNativeDependencies', (done) => { - if (hasNativeDependencies()) { - done(new Error('Native dependencies detected')); - } - done(); + if (hasNativeDependencies()) { + done(new Error('Native dependencies detected')); + } + done(); }); const webpackEnv = { NODE_OPTIONS: '--max_old_space_size=9096' }; async function buildWebPackForDevOrProduction(configFile, configNameForProductionBuilds) { - if (configNameForProductionBuilds) { - await buildWebPack(configNameForProductionBuilds, ['--config', configFile], webpackEnv); - } else { - await spawnAsync('npm', ['run', 'webpack', '--', '--config', configFile, '--mode', 'production'], webpackEnv); - } + if (configNameForProductionBuilds) { + await buildWebPack(configNameForProductionBuilds, ['--config', configFile], webpackEnv); + } else { + await spawnAsync('npm', ['run', 'webpack', '--', '--config', configFile, '--mode', 'production'], webpackEnv); + } } gulp.task('webpack', async () => { - // Build node_modules. - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.dependencies.config.js', 'production'); - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.config.js', 'extension'); - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.browser.config.js', 'browser'); + // Build node_modules. + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.dependencies.config.js', 'production'); + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.config.js', 'extension'); + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.browser.config.js', 'browser'); }); gulp.task('addExtensionPackDependencies', async () => { - await buildLicense(); - await addExtensionPackDependencies(); + await buildLicense(); + await addExtensionPackDependencies(); }); async function addExtensionPackDependencies() { - // Update the package.json to add extension pack dependencies at build time so that - // extension dependencies need not be installed during development - const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat( - packageJson.extensionPack ? packageJson.extensionPack : [], - ); - await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); + // Update the package.json to add extension pack dependencies at build time so that + // extension dependencies need not be installed during development + const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); + const packageJson = JSON.parse(packageJsonContents); + packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat( + packageJson.extensionPack ? packageJson.extensionPack : [] + ); + await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); } async function buildLicense() { - const headerPath = path.join(__dirname, 'build', 'license-header.txt'); - const licenseHeader = await fsExtra.readFile(headerPath, 'utf-8'); - const license = await fsExtra.readFile('LICENSE', 'utf-8'); + const headerPath = path.join(__dirname, 'build', 'license-header.txt'); + const licenseHeader = await fsExtra.readFile(headerPath, 'utf-8'); + const license = await fsExtra.readFile('LICENSE', 'utf-8'); - await fsExtra.writeFile('LICENSE', `${licenseHeader}\n${license}`, 'utf-8'); + await fsExtra.writeFile('LICENSE', `${licenseHeader}\n${license}`, 'utf-8'); } gulp.task('updateBuildNumber', async () => { - await updateBuildNumber(argv); + await updateBuildNumber(argv); }); async function updateBuildNumber(args) { - if (args && args.buildNumber) { - // Edit the version number from the package.json - const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - - // Change version number - const versionParts = packageJson.version.split('.'); - const buildNumberPortion = - versionParts.length > 2 ? versionParts[2].replace(/(\d+)/, args.buildNumber) : args.buildNumber; - const newVersion = - versionParts.length > 1 - ? `${versionParts[0]}.${versionParts[1]}.${buildNumberPortion}` - : packageJson.version; - packageJson.version = newVersion; - - // Write back to the package json - await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); - - // Update the changelog.md if we are told to (this should happen on the release branch) - if (args.updateChangelog) { - const changeLogContents = await fsExtra.readFile('CHANGELOG.md', 'utf-8'); - const fixedContents = changeLogContents.replace( - /##\s*(\d+)\.(\d+)\.(\d+)\s*\(/, - `## $1.$2.${buildNumberPortion} (`, - ); - - // Write back to changelog.md - await fsExtra.writeFile('CHANGELOG.md', fixedContents, 'utf-8'); - } - } else { - throw Error('buildNumber argument required for updateBuildNumber task'); + if (args && args.buildNumber) { + // Edit the version number from the package.json + const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); + const packageJson = JSON.parse(packageJsonContents); + + // Change version number + const versionParts = packageJson.version.split('.'); + const buildNumberPortion = + versionParts.length > 2 ? versionParts[2].replace(/(\d+)/, args.buildNumber) : args.buildNumber; + const newVersion = + versionParts.length > 1 ? `${versionParts[0]}.${versionParts[1]}.${buildNumberPortion}` : packageJson.version; + packageJson.version = newVersion; + + // Write back to the package json + await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); + + // Update the changelog.md if we are told to (this should happen on the release branch) + if (args.updateChangelog) { + const changeLogContents = await fsExtra.readFile('CHANGELOG.md', 'utf-8'); + const fixedContents = changeLogContents.replace( + /##\s*(\d+)\.(\d+)\.(\d+)\s*\(/, + `## $1.$2.${buildNumberPortion} (` + ); + + // Write back to changelog.md + await fsExtra.writeFile('CHANGELOG.md', fixedContents, 'utf-8'); } + } else { + throw Error('buildNumber argument required for updateBuildNumber task'); + } } async function buildWebPack(webpackConfigName, args, env) { - // Remember to perform a case insensitive search. - const allowedWarnings = getAllowedWarningsForWebPack(webpackConfigName).map((item) => item.toLowerCase()); - const stdOut = await spawnAsync( - 'npm', - ['run', 'webpack', '--', ...args, ...['--mode', 'production', '--devtool', 'source-map']], - env, + // Remember to perform a case insensitive search. + const allowedWarnings = getAllowedWarningsForWebPack(webpackConfigName).map((item) => item.toLowerCase()); + const stdOut = await spawnAsync( + 'npm', + ['run', 'webpack', '--', ...args, ...['--mode', 'production', '--devtool', 'source-map']], + env + ); + const stdOutLines = stdOut + .split(os.EOL) + .map((item) => item.trim()) + .filter((item) => item.length > 0); + // Remember to perform a case insensitive search. + const warnings = stdOutLines + .filter((item) => item.startsWith('WARNING in ')) + .filter( + (item) => + allowedWarnings.findIndex((allowedWarning) => item.toLowerCase().startsWith(allowedWarning.toLowerCase())) === + -1 ); - const stdOutLines = stdOut - .split(os.EOL) - .map((item) => item.trim()) - .filter((item) => item.length > 0); - // Remember to perform a case insensitive search. - const warnings = stdOutLines - .filter((item) => item.startsWith('WARNING in ')) - .filter( - (item) => - allowedWarnings.findIndex((allowedWarning) => - item.toLowerCase().startsWith(allowedWarning.toLowerCase()), - ) === -1, - ); - const errors = stdOutLines.some((item) => item.startsWith('ERROR in')); - if (errors) { - throw new Error(`Errors in ${webpackConfigName}, \n${warnings.join(', ')}\n\n${stdOut}`); - } - if (warnings.length > 0) { - throw new Error( - `Warnings in ${webpackConfigName}, Check gulpfile.js to see if the warning should be allowed., \n\n${stdOut}`, - ); - } + const errors = stdOutLines.some((item) => item.startsWith('ERROR in')); + if (errors) { + throw new Error(`Errors in ${webpackConfigName}, \n${warnings.join(', ')}\n\n${stdOut}`); + } + if (warnings.length > 0) { + throw new Error( + `Warnings in ${webpackConfigName}, Check gulpfile.js to see if the warning should be allowed., \n\n${stdOut}` + ); + } } function getAllowedWarningsForWebPack(buildConfig) { - switch (buildConfig) { - case 'production': - return [ - 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', - 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', - 'WARNING in webpack performance recommendations:', - 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', - 'WARNING in ./node_modules/any-promise/register.js', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'extension': - return [ - 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', - 'WARNING in ./node_modules/any-promise/register.js', - 'remove-files-plugin@1.4.0:', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'debugAdapter': - return [ - 'WARNING in ./node_modules/vscode-uri/lib/index.js', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'browser': - return [ - 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', - 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', - 'WARNING in webpack performance recommendations:', - ]; - default: - throw new Error('Unknown WebPack Configuration'); - } + switch (buildConfig) { + case 'production': + return [ + 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', + 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', + 'WARNING in webpack performance recommendations:', + 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', + 'WARNING in ./node_modules/any-promise/register.js', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'extension': + return [ + 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', + 'WARNING in ./node_modules/any-promise/register.js', + 'remove-files-plugin@1.4.0:', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'debugAdapter': + return [ + 'WARNING in ./node_modules/vscode-uri/lib/index.js', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'browser': + return [ + 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', + 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', + 'WARNING in webpack performance recommendations:', + ]; + default: + throw new Error('Unknown WebPack Configuration'); + } } gulp.task('renameSourceMaps', async () => { - // By default source maps will be disabled in the extension. - // Users will need to use the command `python.enableSourceMapSupport` to enable source maps. - const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map'); - await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`); + // By default source maps will be disabled in the extension. + // Users will need to use the command `python.enableSourceMapSupport` to enable source maps. + const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map'); + await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`); }); gulp.task('verifyBundle', async () => { - const matches = await glob.sync(path.join(__dirname, '*.vsix')); - if (!matches || matches.length === 0) { - throw new Error('Bundle does not exist'); - } else { - console.log(`Bundle ${matches[0]} exists.`); - } + const matches = await glob.sync(path.join(__dirname, '*.vsix')); + if (!matches || matches.length === 0) { + throw new Error('Bundle does not exist'); + } else { + console.log(`Bundle ${matches[0]} exists.`); + } }); gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps')); @@ -228,158 +225,162 @@ gulp.task('checkDependencies', gulp.series('checkNativeDependencies')); gulp.task('prePublishNonBundle', gulp.series('compile')); gulp.task('installPythonRequirements', async () => { - let args = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/python', - '--no-cache-dir', - '--implementation', - 'py', - '--no-deps', - '--upgrade', - '-r', - './requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install requirements using 'python'", ex); - return false; - }); - - args = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/jedilsp', - '--no-cache-dir', - '--implementation', - 'py', - '--no-deps', - '--upgrade', - '-r', - './pythonFiles/jedilsp_requirements/requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install Jedi LSP requirements using 'python'", ex); - return false; - }); + let args = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/python', + '--no-cache-dir', + '--implementation', + 'py', + '--no-deps', + '--upgrade', + '-r', + './requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install requirements using 'python'", ex); + return false; + }); + + args = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/jedilsp', + '--no-cache-dir', + '--implementation', + 'py', + '--no-deps', + '--upgrade', + '-r', + './pythonFiles/jedilsp_requirements/requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install Jedi LSP requirements using 'python'", ex); + return false; + }); }); // See https://github.com/microsoft/vscode-python/issues/7136 gulp.task('installDebugpy', async () => { - // Install dependencies needed for 'install_debugpy.py' - const depsArgs = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/temp', - '-r', - './build/debugger-install-requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', depsArgs, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install dependencies need by 'install_debugpy.py' using 'python'", ex); - return false; - }); - - // Install new DEBUGPY with wheels for python 3.7 - const wheelsArgs = ['./pythonFiles/install_debugpy.py']; - const wheelsEnv = { PYTHONPATH: './pythonFiles/lib/temp' }; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', wheelsArgs, wheelsEnv, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install DEBUGPY wheels using 'python'", ex); - return false; - }); - - rmrf.sync('./pythonFiles/lib/temp'); + // Install dependencies needed for 'install_debugpy.py' + const depsArgs = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/temp', + '-r', + './build/debugger-install-requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', depsArgs, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install dependencies need by 'install_debugpy.py' using 'python'", ex); + return false; + }); + + // Install new DEBUGPY with wheels for python 3.7 + const wheelsArgs = ['./pythonFiles/install_debugpy.py']; + const wheelsEnv = { PYTHONPATH: './pythonFiles/lib/temp' }; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', wheelsArgs, wheelsEnv, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install DEBUGPY wheels using 'python'", ex); + return false; + }); + + rmrf.sync('./pythonFiles/lib/temp'); }); gulp.task('installPythonLibs', gulp.series('installPythonRequirements', 'installDebugpy')); function spawnAsync(command, args, env, rejectOnStdErr = false) { - env = env || {}; - env = { ...process.env, ...env }; - return new Promise((resolve, reject) => { - let stdOut = ''; - console.info(`> ${command} ${args.join(' ')}`); - const proc = spawn(command, args, { cwd: __dirname, env }); - proc.stdout.on('data', (data) => { - // Log output on CI (else travis times out when there's not output). - stdOut += data.toString(); - if (isCI) { - console.log(data.toString()); - } - }); - proc.stderr.on('data', (data) => { - console.error(data.toString()); - if (rejectOnStdErr) { - reject(data.toString()); - } - }); - proc.on('close', () => resolve(stdOut)); - proc.on('error', (error) => reject(error)); + env = env || {}; + env = { ...process.env, ...env }; + return new Promise((resolve, reject) => { + let stdOut = ''; + console.info(`> ${command} ${args.join(' ')}`); + const proc = spawn(command, args, { cwd: __dirname, env }); + proc.stdout.on('data', (data) => { + // Log output on CI (else travis times out when there's not output). + stdOut += data.toString(); + if (isCI) { + console.log(data.toString()); + } + }); + proc.stderr.on('data', (data) => { + console.error(data.toString()); + if (rejectOnStdErr) { + reject(data.toString()); + } }); + proc.on('close', () => resolve(stdOut)); + proc.on('error', (error) => reject(error)); + }); } function hasNativeDependencies() { - let nativeDependencies = nativeDependencyChecker.check(path.join(__dirname, 'node_modules')); - if (!Array.isArray(nativeDependencies) || nativeDependencies.length === 0) { - return false; - } - const dependencies = JSON.parse(spawn.sync('npm', ['ls', '--json', '--prod']).stdout.toString()); - const jsonProperties = Object.keys(flat.flatten(dependencies)); - nativeDependencies = _.flatMap(nativeDependencies, (item) => - path.dirname(item.substring(item.indexOf('node_modules') + 'node_modules'.length)).split(path.sep), - ) - .filter((item) => item.length > 0) - .filter((item) => item !== 'fsevents') - .filter( - (item) => - jsonProperties.findIndex((flattenedDependency) => - flattenedDependency.endsWith(`dependencies.${item}.version`), - ) >= 0, - ); - if (nativeDependencies.length > 0) { - console.error('Native dependencies detected', nativeDependencies); - return true; - } + let nativeDependencies = nativeDependencyChecker.check(path.join(__dirname, 'node_modules')); + if (!Array.isArray(nativeDependencies) || nativeDependencies.length === 0) { return false; + } + const dependencies = JSON.parse(spawn.sync('npm', ['ls', '--json', '--prod']).stdout.toString()); + const jsonProperties = Object.keys(flat.flatten(dependencies)); + nativeDependencies = _.flatMap(nativeDependencies, (item) => + path.dirname(item.substring(item.indexOf('node_modules') + 'node_modules'.length)).split(path.sep) + ) + .filter((item) => item.length > 0) + .filter((item) => item !== 'fsevents') + .filter( + (item) => + jsonProperties.findIndex((flattenedDependency) => + flattenedDependency.endsWith(`dependencies.${item}.version`) + ) >= 0 + ); + if (nativeDependencies.length > 0) { + console.error('Native dependencies detected', nativeDependencies); + return true; + } + return false; } const translationProjectName = 'ms-python.python'; const translationExtensionName = 'vscode-python'; const defaultLanguages = [ - { id: 'de', folderName: 'de' }, - { id: 'fr', folderName: 'fr' }, - { id: 'es', folderName: 'es' }, - { id: 'cs', folderName: 'cs' }, - { id: 'it', folderName: 'it' }, - { id: 'ja', folderName: 'ja' }, - { id: 'ko', folderName: 'ko' }, - { id: 'pl', folderName: 'pl' }, - { id: 'pt-BR', folderName: 'pt-br' }, - { id: 'ru', folderName: 'ru' }, - { id: 'tr', folderName: 'tr' }, - { id: 'zh-Hans', folderName: 'zh-Hans' }, - { id: 'zh-Hant', folderName: 'zh-Hant' }, - { id: 'qps-ploc', folderName: 'qps-ploc' }, + { id: 'de', folderName: 'de' }, + { id: 'fr', folderName: 'fr' }, + { id: 'es', folderName: 'es' }, + { id: 'cs', folderName: 'cs' }, + { id: 'it', folderName: 'it' }, + { id: 'ja', folderName: 'ja' }, + { id: 'ko', folderName: 'ko' }, + { id: 'pl', folderName: 'pl' }, + { id: 'pt-BR', folderName: 'pt-br' }, + { id: 'ru', folderName: 'ru' }, + { id: 'tr', folderName: 'tr' }, + { id: 'zh-Hans', folderName: 'zh-Hans' }, + { id: 'zh-Hant', folderName: 'zh-Hant' }, + { id: 'qps-ploc', folderName: 'qps-ploc' }, ]; + +// You can find a more complex implementation of the translations in the CPP Extension repository. +// See: https://github.com/microsoft/vscode-cpptools/blob/main/Extension/gulpfile.js#L76 + // **************************** // Command: translations-generate // The following is used to import an i18n directory structure and generate files used at runtime. @@ -389,25 +390,22 @@ const defaultLanguages = [ // Outputs to root path, as these nls files need to be along side package.json const generateAdditionalLocFiles = () => - gulp - .src(['package.nls.json']) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) - .pipe(gulp.dest('.')); + gulp.src(['package.nls.json']).pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')).pipe(gulp.dest('.')); -// Generates ./dist/nls.bundle..json from files in ./i18n/** *///.i18n.json +// Generates ./out/nls.bundle..json from files in ./i18n/** *///.i18n.json // Localized strings are read from these files at runtime. const generateSrcLocBundle = () => - // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. - tsProject - .src() - .pipe(sourcemaps.init()) - .pipe(tsProject()) - .js.pipe(nls.createMetaDataFiles()) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) - .pipe(nls.bundleLanguageFiles()) - .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) - .pipe(gulp.dest('out')); + // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. + tsProject + .src() + .pipe(sourcemaps.init()) + .pipe(tsProject()) + .js.pipe(nls.createMetaDataFiles()) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) + .pipe(nls.bundleLanguageFiles()) + .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) + .pipe(gulp.dest('out')); gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdditionalLocFiles)); @@ -417,32 +415,32 @@ gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdd // The result will be written to: ../vscode-extensions-localization-export/ms-vscode/ // **************************** const exportTranslations = (done) => { - const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); + const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); - // Merge files from all source streams - jsStream + // Merge files from all source streams + jsStream - // Filter down to only the files we need - .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) + // Filter down to only the files we need + .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) - // Consoldate them into nls.metadata.json, which the xlf is built from. - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) + // Consoldate them into nls.metadata.json, which the xlf is built from. + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) - // filter down to just the resulting metadata files - .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) + // filter down to just the resulting metadata files + .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) - // Add package.nls.json, used to localized package.json - .pipe(gulp.src(['package.nls.json'])) + // Add package.nls.json, used to localized package.json + .pipe(gulp.src(['package.nls.json'])) - // package.nls.json and nls.metadata.json are used to generate the xlf file - // Does not re-queue any files to the stream. Outputs only the XLF file - .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) - .pipe(gulp.dest('../')) - .pipe( - es.wait(() => { - done(); - }), - ); + // package.nls.json and nls.metadata.json are used to generate the xlf file + // Does not re-queue any files to the stream. Outputs only the XLF file + .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) + .pipe(gulp.dest('../')) + .pipe( + es.wait(() => { + done(); + }) + ); }; gulp.task('translations-export', exportTranslations); @@ -455,23 +453,23 @@ gulp.task('translations-export', exportTranslations); // Imports translations from raw localized MLCP strings to VS Code .i18n.json files gulp.task('translations-import', (done) => { - const options = minimist(process.argv.slice(2), { - string: 'location', - default: { - location: '../vscode-translations-import', - }, - }); - es.merge( - defaultLanguages.map((language) => { - const id = language.transifexId || language.id; - return gulp - .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) - .pipe(nls.prepareJsonFiles()) - .pipe(gulp.dest(path.join('./i18n', language.folderName))); - }), - ).pipe( - es.wait(() => { - done(); - }), - ); + const options = minimist(process.argv.slice(2), { + string: 'location', + default: { + location: '../vscode-translations-import', + }, + }); + es.merge( + defaultLanguages.map((language) => { + const id = language.transifexId || language.id; + return gulp + .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) + .pipe(nls.prepareJsonFiles()) + .pipe(gulp.dest(path.join('./i18n', language.folderName))); + }) + ).pipe( + es.wait(() => { + done(); + }) + ); }); From 27d0df00047a62ccbfaf9ea04aaadb58e709fb0f Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Thu, 21 Apr 2022 10:07:05 -0700 Subject: [PATCH 24/39] Remove unnecessary packages --- gulpfile.js | 644 +++++++++++++++++++++++----------------------- package-lock.json | 39 --- package.json | 1 - 3 files changed, 325 insertions(+), 359 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6287438af7a2..e79abcffe937 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -33,15 +33,15 @@ const filter = require('gulp-filter'); const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined; gulp.task('compile', (done) => { - let failed = false; - tsProject - .src() - .pipe(tsProject()) - .on('error', () => { - failed = true; - }) - .js.pipe(gulp.dest('out')) - .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); + let failed = false; + tsProject + .src() + .pipe(tsProject()) + .on('error', () => { + failed = true; + }) + .js.pipe(gulp.dest('out')) + .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); }); gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done)); @@ -55,169 +55,172 @@ gulp.task('clean:out', () => del(['out'])); gulp.task('clean', gulp.parallel('output:clean', 'clean:vsix', 'clean:out')); gulp.task('checkNativeDependencies', (done) => { - if (hasNativeDependencies()) { - done(new Error('Native dependencies detected')); - } - done(); + if (hasNativeDependencies()) { + done(new Error('Native dependencies detected')); + } + done(); }); const webpackEnv = { NODE_OPTIONS: '--max_old_space_size=9096' }; async function buildWebPackForDevOrProduction(configFile, configNameForProductionBuilds) { - if (configNameForProductionBuilds) { - await buildWebPack(configNameForProductionBuilds, ['--config', configFile], webpackEnv); - } else { - await spawnAsync('npm', ['run', 'webpack', '--', '--config', configFile, '--mode', 'production'], webpackEnv); - } + if (configNameForProductionBuilds) { + await buildWebPack(configNameForProductionBuilds, ['--config', configFile], webpackEnv); + } else { + await spawnAsync('npm', ['run', 'webpack', '--', '--config', configFile, '--mode', 'production'], webpackEnv); + } } gulp.task('webpack', async () => { - // Build node_modules. - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.dependencies.config.js', 'production'); - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.config.js', 'extension'); - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.browser.config.js', 'browser'); + // Build node_modules. + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.dependencies.config.js', 'production'); + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.config.js', 'extension'); + await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.browser.config.js', 'browser'); }); gulp.task('addExtensionPackDependencies', async () => { - await buildLicense(); - await addExtensionPackDependencies(); + await buildLicense(); + await addExtensionPackDependencies(); }); async function addExtensionPackDependencies() { - // Update the package.json to add extension pack dependencies at build time so that - // extension dependencies need not be installed during development - const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat( - packageJson.extensionPack ? packageJson.extensionPack : [] - ); - await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); + // Update the package.json to add extension pack dependencies at build time so that + // extension dependencies need not be installed during development + const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); + const packageJson = JSON.parse(packageJsonContents); + packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat( + packageJson.extensionPack ? packageJson.extensionPack : [], + ); + await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); } async function buildLicense() { - const headerPath = path.join(__dirname, 'build', 'license-header.txt'); - const licenseHeader = await fsExtra.readFile(headerPath, 'utf-8'); - const license = await fsExtra.readFile('LICENSE', 'utf-8'); + const headerPath = path.join(__dirname, 'build', 'license-header.txt'); + const licenseHeader = await fsExtra.readFile(headerPath, 'utf-8'); + const license = await fsExtra.readFile('LICENSE', 'utf-8'); - await fsExtra.writeFile('LICENSE', `${licenseHeader}\n${license}`, 'utf-8'); + await fsExtra.writeFile('LICENSE', `${licenseHeader}\n${license}`, 'utf-8'); } gulp.task('updateBuildNumber', async () => { - await updateBuildNumber(argv); + await updateBuildNumber(argv); }); async function updateBuildNumber(args) { - if (args && args.buildNumber) { - // Edit the version number from the package.json - const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); - const packageJson = JSON.parse(packageJsonContents); - - // Change version number - const versionParts = packageJson.version.split('.'); - const buildNumberPortion = - versionParts.length > 2 ? versionParts[2].replace(/(\d+)/, args.buildNumber) : args.buildNumber; - const newVersion = - versionParts.length > 1 ? `${versionParts[0]}.${versionParts[1]}.${buildNumberPortion}` : packageJson.version; - packageJson.version = newVersion; - - // Write back to the package json - await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); - - // Update the changelog.md if we are told to (this should happen on the release branch) - if (args.updateChangelog) { - const changeLogContents = await fsExtra.readFile('CHANGELOG.md', 'utf-8'); - const fixedContents = changeLogContents.replace( - /##\s*(\d+)\.(\d+)\.(\d+)\s*\(/, - `## $1.$2.${buildNumberPortion} (` - ); - - // Write back to changelog.md - await fsExtra.writeFile('CHANGELOG.md', fixedContents, 'utf-8'); + if (args && args.buildNumber) { + // Edit the version number from the package.json + const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8'); + const packageJson = JSON.parse(packageJsonContents); + + // Change version number + const versionParts = packageJson.version.split('.'); + const buildNumberPortion = + versionParts.length > 2 ? versionParts[2].replace(/(\d+)/, args.buildNumber) : args.buildNumber; + const newVersion = + versionParts.length > 1 + ? `${versionParts[0]}.${versionParts[1]}.${buildNumberPortion}` + : packageJson.version; + packageJson.version = newVersion; + + // Write back to the package json + await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8'); + + // Update the changelog.md if we are told to (this should happen on the release branch) + if (args.updateChangelog) { + const changeLogContents = await fsExtra.readFile('CHANGELOG.md', 'utf-8'); + const fixedContents = changeLogContents.replace( + /##\s*(\d+)\.(\d+)\.(\d+)\s*\(/, + `## $1.$2.${buildNumberPortion} (`, + ); + + // Write back to changelog.md + await fsExtra.writeFile('CHANGELOG.md', fixedContents, 'utf-8'); + } + } else { + throw Error('buildNumber argument required for updateBuildNumber task'); } - } else { - throw Error('buildNumber argument required for updateBuildNumber task'); - } } async function buildWebPack(webpackConfigName, args, env) { - // Remember to perform a case insensitive search. - const allowedWarnings = getAllowedWarningsForWebPack(webpackConfigName).map((item) => item.toLowerCase()); - const stdOut = await spawnAsync( - 'npm', - ['run', 'webpack', '--', ...args, ...['--mode', 'production', '--devtool', 'source-map']], - env - ); - const stdOutLines = stdOut - .split(os.EOL) - .map((item) => item.trim()) - .filter((item) => item.length > 0); - // Remember to perform a case insensitive search. - const warnings = stdOutLines - .filter((item) => item.startsWith('WARNING in ')) - .filter( - (item) => - allowedWarnings.findIndex((allowedWarning) => item.toLowerCase().startsWith(allowedWarning.toLowerCase())) === - -1 - ); - const errors = stdOutLines.some((item) => item.startsWith('ERROR in')); - if (errors) { - throw new Error(`Errors in ${webpackConfigName}, \n${warnings.join(', ')}\n\n${stdOut}`); - } - if (warnings.length > 0) { - throw new Error( - `Warnings in ${webpackConfigName}, Check gulpfile.js to see if the warning should be allowed., \n\n${stdOut}` + // Remember to perform a case insensitive search. + const allowedWarnings = getAllowedWarningsForWebPack(webpackConfigName).map((item) => item.toLowerCase()); + const stdOut = await spawnAsync( + 'npm', + ['run', 'webpack', '--', ...args, ...['--mode', 'production', '--devtool', 'source-map']], + env, ); - } + const stdOutLines = stdOut + .split(os.EOL) + .map((item) => item.trim()) + .filter((item) => item.length > 0); + // Remember to perform a case insensitive search. + const warnings = stdOutLines + .filter((item) => item.startsWith('WARNING in ')) + .filter( + (item) => + allowedWarnings.findIndex((allowedWarning) => + item.toLowerCase().startsWith(allowedWarning.toLowerCase()), + ) === -1, + ); + const errors = stdOutLines.some((item) => item.startsWith('ERROR in')); + if (errors) { + throw new Error(`Errors in ${webpackConfigName}, \n${warnings.join(', ')}\n\n${stdOut}`); + } + if (warnings.length > 0) { + throw new Error( + `Warnings in ${webpackConfigName}, Check gulpfile.js to see if the warning should be allowed., \n\n${stdOut}`, + ); + } } function getAllowedWarningsForWebPack(buildConfig) { - switch (buildConfig) { - case 'production': - return [ - 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', - 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', - 'WARNING in webpack performance recommendations:', - 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', - 'WARNING in ./node_modules/any-promise/register.js', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'extension': - return [ - 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', - 'WARNING in ./node_modules/any-promise/register.js', - 'remove-files-plugin@1.4.0:', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'debugAdapter': - return [ - 'WARNING in ./node_modules/vscode-uri/lib/index.js', - 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', - 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', - ]; - case 'browser': - return [ - 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', - 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', - 'WARNING in webpack performance recommendations:', - ]; - default: - throw new Error('Unknown WebPack Configuration'); - } + switch (buildConfig) { + case 'production': + return [ + 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', + 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', + 'WARNING in webpack performance recommendations:', + 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', + 'WARNING in ./node_modules/any-promise/register.js', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'extension': + return [ + 'WARNING in ./node_modules/encoding/lib/iconv-loader.js', + 'WARNING in ./node_modules/any-promise/register.js', + 'remove-files-plugin@1.4.0:', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'debugAdapter': + return [ + 'WARNING in ./node_modules/vscode-uri/lib/index.js', + 'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js', + 'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js', + ]; + case 'browser': + return [ + 'WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).', + 'WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.', + 'WARNING in webpack performance recommendations:', + ]; + default: + throw new Error('Unknown WebPack Configuration'); + } } gulp.task('renameSourceMaps', async () => { - // By default source maps will be disabled in the extension. - // Users will need to use the command `python.enableSourceMapSupport` to enable source maps. - const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map'); - await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`); + // By default source maps will be disabled in the extension. + // Users will need to use the command `python.enableSourceMapSupport` to enable source maps. + const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map'); + await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`); }); gulp.task('verifyBundle', async () => { - const matches = await glob.sync(path.join(__dirname, '*.vsix')); - if (!matches || matches.length === 0) { - throw new Error('Bundle does not exist'); - } else { - console.log(`Bundle ${matches[0]} exists.`); - } + const matches = await glob.sync(path.join(__dirname, '*.vsix')); + if (!matches || matches.length === 0) { + throw new Error('Bundle does not exist'); + } else { + console.log(`Bundle ${matches[0]} exists.`); + } }); gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps')); @@ -225,157 +228,157 @@ gulp.task('checkDependencies', gulp.series('checkNativeDependencies')); gulp.task('prePublishNonBundle', gulp.series('compile')); gulp.task('installPythonRequirements', async () => { - let args = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/python', - '--no-cache-dir', - '--implementation', - 'py', - '--no-deps', - '--upgrade', - '-r', - './requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install requirements using 'python'", ex); - return false; - }); - - args = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/jedilsp', - '--no-cache-dir', - '--implementation', - 'py', - '--no-deps', - '--upgrade', - '-r', - './pythonFiles/jedilsp_requirements/requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install Jedi LSP requirements using 'python'", ex); - return false; - }); + let args = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/python', + '--no-cache-dir', + '--implementation', + 'py', + '--no-deps', + '--upgrade', + '-r', + './requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install requirements using 'python'", ex); + return false; + }); + + args = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/jedilsp', + '--no-cache-dir', + '--implementation', + 'py', + '--no-deps', + '--upgrade', + '-r', + './pythonFiles/jedilsp_requirements/requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', args, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install Jedi LSP requirements using 'python'", ex); + return false; + }); }); // See https://github.com/microsoft/vscode-python/issues/7136 gulp.task('installDebugpy', async () => { - // Install dependencies needed for 'install_debugpy.py' - const depsArgs = [ - '-m', - 'pip', - '--disable-pip-version-check', - 'install', - '--no-user', - '-t', - './pythonFiles/lib/temp', - '-r', - './build/debugger-install-requirements.txt', - ]; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', depsArgs, undefined, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install dependencies need by 'install_debugpy.py' using 'python'", ex); - return false; - }); - - // Install new DEBUGPY with wheels for python 3.7 - const wheelsArgs = ['./pythonFiles/install_debugpy.py']; - const wheelsEnv = { PYTHONPATH: './pythonFiles/lib/temp' }; - await spawnAsync(process.env.CI_PYTHON_PATH || 'python', wheelsArgs, wheelsEnv, true) - .then(() => true) - .catch((ex) => { - console.error("Failed to install DEBUGPY wheels using 'python'", ex); - return false; - }); - - rmrf.sync('./pythonFiles/lib/temp'); + // Install dependencies needed for 'install_debugpy.py' + const depsArgs = [ + '-m', + 'pip', + '--disable-pip-version-check', + 'install', + '--no-user', + '-t', + './pythonFiles/lib/temp', + '-r', + './build/debugger-install-requirements.txt', + ]; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', depsArgs, undefined, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install dependencies need by 'install_debugpy.py' using 'python'", ex); + return false; + }); + + // Install new DEBUGPY with wheels for python 3.7 + const wheelsArgs = ['./pythonFiles/install_debugpy.py']; + const wheelsEnv = { PYTHONPATH: './pythonFiles/lib/temp' }; + await spawnAsync(process.env.CI_PYTHON_PATH || 'python', wheelsArgs, wheelsEnv, true) + .then(() => true) + .catch((ex) => { + console.error("Failed to install DEBUGPY wheels using 'python'", ex); + return false; + }); + + rmrf.sync('./pythonFiles/lib/temp'); }); gulp.task('installPythonLibs', gulp.series('installPythonRequirements', 'installDebugpy')); function spawnAsync(command, args, env, rejectOnStdErr = false) { - env = env || {}; - env = { ...process.env, ...env }; - return new Promise((resolve, reject) => { - let stdOut = ''; - console.info(`> ${command} ${args.join(' ')}`); - const proc = spawn(command, args, { cwd: __dirname, env }); - proc.stdout.on('data', (data) => { - // Log output on CI (else travis times out when there's not output). - stdOut += data.toString(); - if (isCI) { - console.log(data.toString()); - } - }); - proc.stderr.on('data', (data) => { - console.error(data.toString()); - if (rejectOnStdErr) { - reject(data.toString()); - } + env = env || {}; + env = { ...process.env, ...env }; + return new Promise((resolve, reject) => { + let stdOut = ''; + console.info(`> ${command} ${args.join(' ')}`); + const proc = spawn(command, args, { cwd: __dirname, env }); + proc.stdout.on('data', (data) => { + // Log output on CI (else travis times out when there's not output). + stdOut += data.toString(); + if (isCI) { + console.log(data.toString()); + } + }); + proc.stderr.on('data', (data) => { + console.error(data.toString()); + if (rejectOnStdErr) { + reject(data.toString()); + } + }); + proc.on('close', () => resolve(stdOut)); + proc.on('error', (error) => reject(error)); }); - proc.on('close', () => resolve(stdOut)); - proc.on('error', (error) => reject(error)); - }); } function hasNativeDependencies() { - let nativeDependencies = nativeDependencyChecker.check(path.join(__dirname, 'node_modules')); - if (!Array.isArray(nativeDependencies) || nativeDependencies.length === 0) { + let nativeDependencies = nativeDependencyChecker.check(path.join(__dirname, 'node_modules')); + if (!Array.isArray(nativeDependencies) || nativeDependencies.length === 0) { + return false; + } + const dependencies = JSON.parse(spawn.sync('npm', ['ls', '--json', '--prod']).stdout.toString()); + const jsonProperties = Object.keys(flat.flatten(dependencies)); + nativeDependencies = _.flatMap(nativeDependencies, (item) => + path.dirname(item.substring(item.indexOf('node_modules') + 'node_modules'.length)).split(path.sep), + ) + .filter((item) => item.length > 0) + .filter((item) => item !== 'fsevents') + .filter( + (item) => + jsonProperties.findIndex((flattenedDependency) => + flattenedDependency.endsWith(`dependencies.${item}.version`), + ) >= 0, + ); + if (nativeDependencies.length > 0) { + console.error('Native dependencies detected', nativeDependencies); + return true; + } return false; - } - const dependencies = JSON.parse(spawn.sync('npm', ['ls', '--json', '--prod']).stdout.toString()); - const jsonProperties = Object.keys(flat.flatten(dependencies)); - nativeDependencies = _.flatMap(nativeDependencies, (item) => - path.dirname(item.substring(item.indexOf('node_modules') + 'node_modules'.length)).split(path.sep) - ) - .filter((item) => item.length > 0) - .filter((item) => item !== 'fsevents') - .filter( - (item) => - jsonProperties.findIndex((flattenedDependency) => - flattenedDependency.endsWith(`dependencies.${item}.version`) - ) >= 0 - ); - if (nativeDependencies.length > 0) { - console.error('Native dependencies detected', nativeDependencies); - return true; - } - return false; } const translationProjectName = 'ms-python.python'; const translationExtensionName = 'vscode-python'; const defaultLanguages = [ - { id: 'de', folderName: 'de' }, - { id: 'fr', folderName: 'fr' }, - { id: 'es', folderName: 'es' }, - { id: 'cs', folderName: 'cs' }, - { id: 'it', folderName: 'it' }, - { id: 'ja', folderName: 'ja' }, - { id: 'ko', folderName: 'ko' }, - { id: 'pl', folderName: 'pl' }, - { id: 'pt-BR', folderName: 'pt-br' }, - { id: 'ru', folderName: 'ru' }, - { id: 'tr', folderName: 'tr' }, - { id: 'zh-Hans', folderName: 'zh-Hans' }, - { id: 'zh-Hant', folderName: 'zh-Hant' }, - { id: 'qps-ploc', folderName: 'qps-ploc' }, + { id: 'de', folderName: 'de' }, + { id: 'fr', folderName: 'fr' }, + { id: 'es', folderName: 'es' }, + { id: 'cs', folderName: 'cs' }, + { id: 'it', folderName: 'it' }, + { id: 'ja', folderName: 'ja' }, + { id: 'ko', folderName: 'ko' }, + { id: 'pl', folderName: 'pl' }, + { id: 'pt-BR', folderName: 'pt-br' }, + { id: 'ru', folderName: 'ru' }, + { id: 'tr', folderName: 'tr' }, + { id: 'zh-Hans', folderName: 'zh-Hans' }, + { id: 'zh-Hant', folderName: 'zh-Hant' }, + { id: 'qps-ploc', folderName: 'qps-ploc' }, ]; // You can find a more complex implementation of the translations in the CPP Extension repository. @@ -390,22 +393,25 @@ const defaultLanguages = [ // Outputs to root path, as these nls files need to be along side package.json const generateAdditionalLocFiles = () => - gulp.src(['package.nls.json']).pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')).pipe(gulp.dest('.')); + gulp + .src(['package.nls.json']) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) + .pipe(gulp.dest('.')); // Generates ./out/nls.bundle..json from files in ./i18n/** *///.i18n.json // Localized strings are read from these files at runtime. const generateSrcLocBundle = () => - // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. - tsProject - .src() - .pipe(sourcemaps.init()) - .pipe(tsProject()) - .js.pipe(nls.createMetaDataFiles()) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) - .pipe(nls.bundleLanguageFiles()) - .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) - .pipe(gulp.dest('out')); + // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. + tsProject + .src() + .pipe(sourcemaps.init()) + .pipe(tsProject()) + .js.pipe(nls.createMetaDataFiles()) + .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) + .pipe(nls.bundleLanguageFiles()) + .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) + .pipe(gulp.dest('out')); gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdditionalLocFiles)); @@ -415,32 +421,32 @@ gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdd // The result will be written to: ../vscode-extensions-localization-export/ms-vscode/ // **************************** const exportTranslations = (done) => { - const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); + const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); - // Merge files from all source streams - jsStream + // Merge files from all source streams + jsStream - // Filter down to only the files we need - .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) + // Filter down to only the files we need + .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) - // Consoldate them into nls.metadata.json, which the xlf is built from. - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) + // Consoldate them into nls.metadata.json, which the xlf is built from. + .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) - // filter down to just the resulting metadata files - .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) + // filter down to just the resulting metadata files + .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) - // Add package.nls.json, used to localized package.json - .pipe(gulp.src(['package.nls.json'])) + // Add package.nls.json, used to localized package.json + .pipe(gulp.src(['package.nls.json'])) - // package.nls.json and nls.metadata.json are used to generate the xlf file - // Does not re-queue any files to the stream. Outputs only the XLF file - .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) - .pipe(gulp.dest('../')) - .pipe( - es.wait(() => { - done(); - }) - ); + // package.nls.json and nls.metadata.json are used to generate the xlf file + // Does not re-queue any files to the stream. Outputs only the XLF file + .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) + .pipe(gulp.dest('../')) + .pipe( + es.wait(() => { + done(); + }), + ); }; gulp.task('translations-export', exportTranslations); @@ -453,23 +459,23 @@ gulp.task('translations-export', exportTranslations); // Imports translations from raw localized MLCP strings to VS Code .i18n.json files gulp.task('translations-import', (done) => { - const options = minimist(process.argv.slice(2), { - string: 'location', - default: { - location: '../vscode-translations-import', - }, - }); - es.merge( - defaultLanguages.map((language) => { - const id = language.transifexId || language.id; - return gulp - .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) - .pipe(nls.prepareJsonFiles()) - .pipe(gulp.dest(path.join('./i18n', language.folderName))); - }) - ).pipe( - es.wait(() => { - done(); - }) - ); + const options = minimist(process.argv.slice(2), { + string: 'location', + default: { + location: '../vscode-translations-import', + }, + }); + es.merge( + defaultLanguages.map((language) => { + const id = language.transifexId || language.id; + return gulp + .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) + .pipe(nls.prepareJsonFiles()) + .pipe(gulp.dest(path.join('./i18n', language.folderName))); + }), + ).pipe( + es.wait(() => { + done(); + }), + ); }); diff --git a/package-lock.json b/package-lock.json index 120983111369..63598ca242e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,7 +103,6 @@ "node-has-native-dependencies": "^1.0.2", "node-loader": "^1.0.2", "nyc": "^15.0.0", - "parse-git-config": "^3.0.0", "prettier": "^2.0.2", "rewiremock": "^3.13.0", "rimraf": "^3.0.2", @@ -6384,15 +6383,6 @@ "assert-plus": "^1.0.0" } }, - "node_modules/git-config-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-2.0.0.tgz", - "integrity": "sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -10730,19 +10720,6 @@ "node": ">=0.8" } }, - "node_modules/parse-git-config": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", - "integrity": "sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==", - "dev": true, - "dependencies": { - "git-config-path": "^2.0.0", - "ini": "^1.3.5" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/parse-node-version": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", @@ -20501,12 +20478,6 @@ "assert-plus": "^1.0.0" } }, - "git-config-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-2.0.0.tgz", - "integrity": "sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA==", - "dev": true - }, "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -23906,16 +23877,6 @@ "path-root": "^0.1.1" } }, - "parse-git-config": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-3.0.0.tgz", - "integrity": "sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA==", - "dev": true, - "requires": { - "git-config-path": "^2.0.0", - "ini": "^1.3.5" - } - }, "parse-node-version": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", diff --git a/package.json b/package.json index 1192d239f48a..cb519c620d1e 100644 --- a/package.json +++ b/package.json @@ -1924,7 +1924,6 @@ "node-has-native-dependencies": "^1.0.2", "node-loader": "^1.0.2", "nyc": "^15.0.0", - "parse-git-config": "^3.0.0", "prettier": "^2.0.2", "rewiremock": "^3.13.0", "rimraf": "^3.0.2", From 45e369458b8ecc79d08eb647216d8036942663d9 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Fri, 22 Apr 2022 17:06:36 -0700 Subject: [PATCH 25/39] Fix string with format --- build/azure-pipeline.pre-release.yml | 2 +- src/client/browser/localize.ts | 1 + src/client/common/experiments/service.ts | 15 +++--- .../common/installer/moduleInstaller.ts | 7 ++- .../common/installer/productInstaller.ts | 37 ++++++++++--- src/client/common/net/fileDownloader.ts | 11 ++-- src/client/common/utils/localize.ts | 54 ------------------- .../extension/attachQuickPick/provider.ts | 13 ++++- .../commands/setInterpreter.ts | 9 +++- src/client/interpreter/display/index.ts | 14 +++-- src/client/languageServer/watcher.ts | 18 +++++-- src/client/linters/linterCommands.ts | 11 +++- src/client/tensorBoard/tensorBoardSession.ts | 6 ++- .../tensorBoard/tensorBoardSessionProvider.ts | 11 +++- .../common/experiments/service.unit.test.ts | 6 ++- .../installer/moduleInstaller.unit.test.ts | 10 +++- .../installer/productInstaller.unit.test.ts | 26 ++++----- .../common/net/fileDownloader.unit.test.ts | 11 ++-- .../commands/setInterpreter.unit.test.ts | 6 +-- src/test/interpreters/display.unit.test.ts | 14 ++++- src/test/languageServer/watcher.unit.test.ts | 13 ++++- 21 files changed, 182 insertions(+), 113 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 0cc121de34c6..7754c51b0571 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -15,7 +15,7 @@ resources: - repository: templates type: github name: microsoft/vscode-engineering - ref: tyler/translations + ref: main endpoint: Monaco extends: diff --git a/src/client/browser/localize.ts b/src/client/browser/localize.ts index 24f2cde53c9a..7be89150867f 100644 --- a/src/client/browser/localize.ts +++ b/src/client/browser/localize.ts @@ -8,6 +8,7 @@ // IMPORTANT: Do not import any node fs related modules here, as they do not work in browser. import * as nls from 'vscode-nls'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export namespace LanguageService { diff --git a/src/client/common/experiments/service.ts b/src/client/common/experiments/service.ts index 61fae29877d6..40669a2395f3 100644 --- a/src/client/common/experiments/service.ts +++ b/src/client/common/experiments/service.ts @@ -5,15 +5,18 @@ import { inject, injectable } from 'inversify'; import { getExperimentationService, IExperimentationService, TargetPopulation } from 'vscode-tas-client'; +import * as nls from 'vscode-nls'; import { traceLog } from '../../logging'; import { sendTelemetryEvent } from '../../telemetry'; import { EventName } from '../../telemetry/constants'; import { IApplicationEnvironment, IWorkspaceService } from '../application/types'; import { PVSC_EXTENSION_ID } from '../constants'; import { IExperimentService, IPersistentStateFactory } from '../types'; -import { Experiments } from '../utils/localize'; import { ExperimentationTelemetry } from './telemetry'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + const EXP_MEMENTO_KEY = 'VSCode.ABExp.FeatureData'; const EXP_CONFIG_ID = 'vscode'; @@ -162,7 +165,7 @@ export class ExperimentService implements IExperimentService { if (this._optOutFrom.includes('All')) { // We prioritize opt out first - traceLog(Experiments.optedOutOf.format('All')); + traceLog(localize('Experiments.optedOutOf', "Experiment '{0}' is inactive", 'All')); // Since we are in the Opt Out all case, this means when checking for experiment we // short circuit and return. So, printing out additional experiment info might cause @@ -171,7 +174,7 @@ export class ExperimentService implements IExperimentService { } if (this._optInto.includes('All')) { // Only if 'All' is not in optOut then check if it is in Opt In. - traceLog(Experiments.inGroup.format('All')); + traceLog(localize('Experiments.inGroup', "Experiment '{0}' is active", 'All')); // Similar to the opt out case. If user is opting into to all experiments we short // circuit the experiment checks. So, skip printing any additional details to the logs. @@ -182,14 +185,14 @@ export class ExperimentService implements IExperimentService { this._optOutFrom .filter((exp) => exp !== 'All' && exp.toLowerCase().startsWith('python')) .forEach((exp) => { - traceLog(Experiments.optedOutOf.format(exp)); + traceLog(localize('Experiments.manuallyOptedOutOf', "Experiment '{0}' is inactive", exp)); }); // Log experiments that users manually opt into, these are experiments which are added using the exp framework. this._optInto .filter((exp) => exp !== 'All' && exp.toLowerCase().startsWith('python')) .forEach((exp) => { - traceLog(Experiments.inGroup.format(exp)); + traceLog(localize('Experiments.manuallyOptIntoExperiments', "Experiment '{0}' is active", exp)); }); if (!experimentsDisabled) { @@ -202,7 +205,7 @@ export class ExperimentService implements IExperimentService { !this._optOutFrom.includes(exp) && !this._optInto.includes(exp) ) { - traceLog(Experiments.inGroup.format(exp)); + traceLog(localize('Experiments.autoOptIntoExperiments', "Experiment '{0}' is active", exp)); } }); } diff --git a/src/client/common/installer/moduleInstaller.ts b/src/client/common/installer/moduleInstaller.ts index 61648a1c7272..f98c1e61a678 100644 --- a/src/client/common/installer/moduleInstaller.ts +++ b/src/client/common/installer/moduleInstaller.ts @@ -18,10 +18,13 @@ import * as internalPython from '../process/internal/python'; import { IProcessServiceFactory } from '../process/types'; import { ITerminalServiceFactory, TerminalCreationOptions } from '../terminal/types'; import { ExecutionInfo, IConfigurationService, IOutputChannel, Product } from '../types'; -import { Products } from '../utils/localize'; import { isResource } from '../utils/misc'; import { ProductNames } from './productNames'; import { IModuleInstaller, InstallOptions, InterpreterUri, ModuleInstallFlags } from './types'; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() export abstract class ModuleInstaller implements IModuleInstaller { @@ -128,7 +131,7 @@ export abstract class ModuleInstaller implements IModuleInstaller { const options: ProgressOptions = { location: ProgressLocation.Notification, cancellable: true, - title: Products.installingModule.format(name), + title: localize('products.installingModule', 'Installing {0}', name), }; await shell.withProgress(options, async (_, token: CancellationToken) => install(wrapCancellationTokens(token, cancel)), diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index 99ab4f6b077b..fc6ded667755 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -4,6 +4,7 @@ import { inject, injectable } from 'inversify'; import * as semver from 'semver'; import { CancellationToken, Uri } from 'vscode'; import '../extensions'; +import * as nls from 'vscode-nls'; import { IInterpreterService } from '../../interpreter/contracts'; import { IServiceContainer } from '../../ioc/types'; import { LinterId } from '../../linters/types'; @@ -22,7 +23,7 @@ import { Product, ProductType, } from '../types'; -import { Common, Installer, Linters, Products } from '../utils/localize'; +import { Common, Linters } from '../utils/localize'; import { isResource, noop } from '../utils/misc'; import { translateProductToModule } from './moduleInstaller'; import { ProductNames } from './productNames'; @@ -41,6 +42,9 @@ import { isParentPath } from '../platform/fs-paths'; export { Product } from '../types'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + // Products which may not be available to install from certain package registries, keyed by product name // Installer implementations can check this to determine a suitable installation channel for a product // This is temporary and can be removed when https://github.com/microsoft/vscode-jupyter/issues/5034 is unblocked @@ -249,16 +253,25 @@ export class FormatterInstaller extends BaseInstaller { const formatterNames = formatters.map((formatter) => ProductNames.get(formatter)!); const productName = ProductNames.get(product)!; formatterNames.splice(formatterNames.indexOf(productName), 1); - const useOptions = formatterNames.map((name) => Products.useFormatter.format(name)); + const useOptions = formatterNames.map((name) => localize('products.useFormatter', 'Use {0}', name)); const yesChoice = Common.bannerLabelYes; const options = [...useOptions, Common.doNotShowAgain]; - let message = Products.formatterNotInstalled.format(productName); + let message = localize( + 'products.formatterNotInstalled', + 'Formatter {0} is not installed. Install?', + productName, + ); if (this.isExecutableAModule(product, resource)) { options.splice(0, 0, yesChoice); } else { const executable = this.getExecutableNameFromSettings(product, resource); - message = Products.invalidFormatterPath.format(productName, executable); + message = localize( + 'products.invalidFormatterPath', + 'Path to the {0} formatter is invalid ({1})', + productName, + executable, + ); } const item = await this.appShell.showErrorMessage(message, ...options); @@ -501,7 +514,15 @@ export class DataScienceInstaller extends BaseInstaller { const installerModule: IModuleInstaller | undefined = channels.find((v) => v.type === requiredInstaller); if (!installerModule) { - this.appShell.showErrorMessage(Installer.couldNotInstallLibrary.format(moduleName)).then(noop, noop); + this.appShell + .showErrorMessage( + localize( + 'Installer.couldNotInstallLibrary', + 'Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.', + moduleName, + ), + ) + .then(noop, noop); sendTelemetryEvent(EventName.PYTHON_INSTALL_PACKAGE, undefined, { installer: 'unavailable', requiredInstaller, @@ -541,7 +562,11 @@ export class DataScienceInstaller extends BaseInstaller { ): Promise { const productName = ProductNames.get(product)!; const item = await this.appShell.showErrorMessage( - Installer.dataScienceInstallPrompt.format(productName), + localize( + 'Installer.dataScienceInstallPrompt', + 'Data Science library {0} is not installed. Install?', + productName, + ), 'Yes', 'No', ); diff --git a/src/client/common/net/fileDownloader.ts b/src/client/common/net/fileDownloader.ts index 2e147a280023..0f0c7340cc94 100644 --- a/src/client/common/net/fileDownloader.ts +++ b/src/client/common/net/fileDownloader.ts @@ -4,6 +4,7 @@ 'use strict'; import { inject, injectable } from 'inversify'; +import * as nls from 'vscode-nls'; import * as requestTypes from 'request'; import { Progress } from 'vscode'; import { traceLog } from '../../logging'; @@ -11,9 +12,11 @@ import { IApplicationShell } from '../application/types'; import { Octicons } from '../constants'; import { IFileSystem, WriteStream } from '../platform/types'; import { DownloadOptions, IFileDownloader, IHttpClient } from '../types'; -import { Http } from '../utils/localize'; import { noop } from '../utils/misc'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + @injectable() export class FileDownloader implements IFileDownloader { constructor( @@ -22,7 +25,7 @@ export class FileDownloader implements IFileDownloader { @inject(IApplicationShell) private readonly appShell: IApplicationShell, ) {} public async downloadFile(uri: string, options: DownloadOptions): Promise { - traceLog(Http.downloadingFile.format(uri)); + traceLog(localize('downloading.file', 'Downloading {0}...', uri)); const tempFile = await this.fs.createTemporaryFile(options.extension); await this.downloadFileWithStatusBarProgress(uri, options.progressMessagePrefix, tempFile.filePath).then( @@ -97,7 +100,9 @@ function formatProgressMessageWithState(progressMessagePrefix: string, state: Re const total = Math.round(state.size.total / 1024); const percentage = Math.round(100 * state.percent); - return Http.downloadingFileProgress.format( + return localize( + 'downloading.file.progress', + '{0}{1} of {2} KB ({3}%)', progressMessagePrefix, received.toString(), total.toString(), diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 093ac18c6357..9b4f56579c46 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -100,7 +100,6 @@ export namespace CommonSurvey { } export namespace AttachProcess { - export const unsupportedOS = localize('AttachProcess.unsupportedOS', "Operating system '{0}' not supported."); export const attachTitle = localize('AttachProcess.attachTitle', 'Attach to process'); export const selectProcessPlaceholder = localize( 'AttachProcess.selectProcessPlaceholder', @@ -144,16 +143,11 @@ export namespace TensorBoard { 'TensorBoard.useCurrentWorkingDirectory', 'Use current working directory', ); - export const currentDirectory = localize('TensorBoard.currentDirectory', 'Current: {0}'); export const logDirectoryPrompt = localize( 'TensorBoard.logDirectoryPrompt', 'Select a log directory to start TensorBoard with', ); export const progressMessage = localize('TensorBoard.progressMessage', 'Starting TensorBoard session...'); - export const failedToStartSessionError = localize( - 'TensorBoard.failedToStartSessionError', - 'We failed to start a TensorBoard session due to the following error: {0}', - ); export const nativeTensorBoardPrompt = localize( 'TensorBoard.nativeTensorBoardPrompt', 'VS Code now has integrated TensorBoard support. Would you like to launch TensorBoard? (Tip: Launch TensorBoard anytime by opening the command palette and searching for "Launch TensorBoard".)', @@ -215,15 +209,6 @@ export namespace LanguageService { text: localize('LanguageService.statusItem.text', 'Partial Mode'), detail: localize('LanguageService.statusItem.detail', 'Limited IntelliSense provided by Pylance'), }; - export const startingPylance = localize( - 'LanguageService.startingPylance', - 'Starting Pylance language server for {0}.', - ); - export const startingJedi = localize('LanguageService.startingJedi', 'Starting Jedi language server for {0}.'); - export const startingNone = localize( - 'LanguageService.startingNone', - 'Editor support is inactive since language server is set to None for {0}.', - ); export const untrustedWorkspaceMessage = localize( 'LanguageService.untrustedWorkspaceMessage', 'Only Pylance is supported in untrusted workspaces, setting language server to None.', @@ -264,15 +249,6 @@ export namespace LanguageService { 'Search paths have changed for this Python interpreter. Please reload the extension to ensure that the IntelliSense works correctly.', ); } - -export namespace Http { - export const downloadingFile = localize('downloading.file', 'Downloading {0}...'); - export const downloadingFileProgress = localize('downloading.file.progress', '{0}{1} of {2} KB ({3}%)'); -} -export namespace Experiments { - export const inGroup = localize('Experiments.inGroup', "Experiment '{0}' is active"); - export const optedOutOf = localize('Experiments.optedOutOf', "Experiment '{0}' is inactive"); -} export namespace Interpreters { export const installingPython = localize('Interpreters.installingPython', 'Installing Python into Environment...'); export const discovering = localize('Interpreters.DiscoveringInterpreters', 'Discovering Python Interpreters'); @@ -291,16 +267,11 @@ export namespace Interpreters { 'Interpreters.selectInterpreterTip', 'Tip: you can change the Python interpreter used by the Python extension by clicking on the Python version in the status bar', ); - export const pythonInterpreterPath = localize('Interpreters.pythonInterpreterPath', 'Python interpreter path: {0}'); } export namespace InterpreterQuickPickList { export const globalGroupName = localize('InterpreterQuickPickList.globalGroupName', 'Global'); export const workspaceGroupName = localize('InterpreterQuickPickList.workspaceGroupName', 'Workspace'); - export const quickPickListPlaceholder = localize( - 'InterpreterQuickPickList.quickPickListPlaceholder', - 'Selected Interpreter: {0}', - ); export const enterPath = { label: localize('InterpreterQuickPickList.enterPath.label', 'Enter interpreter path...'), placeholder: localize('InterpreterQuickPickList.enterPath.placeholder', 'Enter path to a Python interpreter.'), @@ -337,10 +308,6 @@ export namespace Logging { } export namespace Linters { - export const replaceWithSelectedLinter = localize( - 'Linter.replaceWithSelectedLinter', - "Multiple linters are enabled in settings. Replace with '{0}'?", - ); export const selectLinter = localize('Linter.selectLinter', 'Select Linter'); } @@ -354,14 +321,6 @@ export namespace Installer { 'There is no Pip installer available in the selected environment.', ); export const searchForHelp = localize('Installer.searchForHelp', 'Search for help'); - export const couldNotInstallLibrary = localize( - 'Installer.couldNotInstallLibrary', - 'Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.', - ); - export const dataScienceInstallPrompt = localize( - 'Installer.dataScienceInstallPrompt', - 'Data Science library {0} is not installed. Install?', - ); } export namespace ExtensionSurveyBanner { @@ -373,19 +332,6 @@ export namespace ExtensionSurveyBanner { export const bannerLabelNo = localize('ExtensionSurveyBanner.bannerLabelNo', 'No, thanks'); export const maybeLater = localize('ExtensionSurveyBanner.maybeLater', 'Maybe later'); } - -export namespace Products { - export const installingModule = localize('products.installingModule', 'Installing {0}'); - export const formatterNotInstalled = localize( - 'products.formatterNotInstalled', - 'Formatter {0} is not installed. Install?', - ); - export const useFormatter = localize('products.useFormatter', 'Use {0}'); - export const invalidFormatterPath = localize( - 'products.invalidFormatterPath', - 'Path to the {0} formatter is invalid ({1})', - ); -} export namespace DebugConfigStrings { export const selectConfiguration = { title: localize('debug.selectConfigurationTitle', 'Select a debug configuration'), diff --git a/src/client/debugger/extension/attachQuickPick/provider.ts b/src/client/debugger/extension/attachQuickPick/provider.ts index ff39d712ad2a..d848fcc47f9e 100644 --- a/src/client/debugger/extension/attachQuickPick/provider.ts +++ b/src/client/debugger/extension/attachQuickPick/provider.ts @@ -4,13 +4,16 @@ 'use strict'; import { inject, injectable } from 'inversify'; +import * as nls from 'vscode-nls'; import { IPlatformService } from '../../../common/platform/types'; import { IProcessServiceFactory } from '../../../common/process/types'; -import { AttachProcess as AttachProcessLocalization } from '../../../common/utils/localize'; import { PsProcessParser } from './psProcessParser'; import { IAttachItem, IAttachProcessProvider, ProcessListCommand } from './types'; import { WmicProcessParser } from './wmicProcessParser'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + @injectable() export class AttachProcessProvider implements IAttachProcessProvider { constructor( @@ -69,7 +72,13 @@ export class AttachProcessProvider implements IAttachProcessProvider { } else if (this.platformService.isWindows) { processCmd = WmicProcessParser.wmicCommand; } else { - throw new Error(AttachProcessLocalization.unsupportedOS.format(this.platformService.osType)); + throw new Error( + localize( + 'AttachProcess.unsupportedOS', + "Operating system '{0}' not supported.", + this.platformService.osType, + ), + ); } const processService = await this.processServiceFactory.create(); diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index ac906ffc4eeb..4f494af62788 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -7,6 +7,7 @@ import { inject, injectable } from 'inversify'; import { cloneDeep } from 'lodash'; import * as path from 'path'; import { QuickPick, QuickPickItem, QuickPickItemKind } from 'vscode'; +import * as nls from 'vscode-nls'; import { IApplicationShell, ICommandManager, IWorkspaceService } from '../../../../common/application/types'; import { Commands, Octicons } from '../../../../common/constants'; import { isParentPath } from '../../../../common/platform/fs-paths'; @@ -34,6 +35,8 @@ import { } from '../../types'; import { BaseInterpreterSelectorCommand } from './base'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const untildify = require('untildify'); export type InterpreterStateArgs = { path?: string; workspace: Resource }; @@ -115,7 +118,11 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { state.workspace ? state.workspace.fsPath : undefined, ); const selection = await input.showQuickPick>({ - placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentInterpreterPathDisplay), + placeholder: localize( + 'InterpreterQuickPickList.quickPickListPlaceholder', + 'Selected Interpreter: {0}', + currentInterpreterPathDisplay, + ), items: suggestions, sortByLabel: !preserveOrderWhenFiltering, keepScrollPosition: true, diff --git a/src/client/interpreter/display/index.ts b/src/client/interpreter/display/index.ts index 3e40c3aa023c..9cb6c73e85e8 100644 --- a/src/client/interpreter/display/index.ts +++ b/src/client/interpreter/display/index.ts @@ -5,7 +5,7 @@ import { IApplicationShell, IWorkspaceService } from '../../common/application/t import { Commands, PYTHON_LANGUAGE } from '../../common/constants'; import '../../common/extensions'; import { IDisposableRegistry, IPathUtils, Resource } from '../../common/types'; -import { InterpreterQuickPickList, Interpreters } from '../../common/utils/localize'; +import { InterpreterQuickPickList } from '../../common/utils/localize'; import { IServiceContainer } from '../../ioc/types'; import { traceLog } from '../../logging'; import { PythonEnvironment } from '../../pythonEnvironments/info'; @@ -15,6 +15,10 @@ import { IInterpreterService, IInterpreterStatusbarVisibilityFilter, } from '../contracts'; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /** * Based on https://github.com/microsoft/vscode-python/issues/18040#issuecomment-992567670. @@ -114,7 +118,9 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle this.statusBar.tooltip = this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath); if (this.currentlySelectedInterpreterPath !== interpreter.path) { traceLog( - Interpreters.pythonInterpreterPath.format( + localize( + 'Interpreters.sttausBarPythonInterpreterPath', + 'Python interpreter path: {0}', this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath), ), ); @@ -135,7 +141,9 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle this.languageStatus.detail = this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath); if (this.currentlySelectedInterpreterPath !== interpreter.path) { traceLog( - Interpreters.pythonInterpreterPath.format( + localize( + 'Interpreters.pythonInterpreterPath', + 'Python interpreter path: {0}', this.pathUtils.getDisplayName(interpreter.path, workspaceFolder?.fsPath), ), ); diff --git a/src/client/languageServer/watcher.ts b/src/client/languageServer/watcher.ts index 44cdef53507f..5830a8d64433 100644 --- a/src/client/languageServer/watcher.ts +++ b/src/client/languageServer/watcher.ts @@ -4,6 +4,7 @@ import * as path from 'path'; import { inject, injectable } from 'inversify'; import { ConfigurationChangeEvent, Uri } from 'vscode'; +import * as nls from 'vscode-nls'; import { LanguageServerChangeHandler } from '../activation/common/languageServerChangeHandler'; import { IExtensionActivationService, @@ -34,6 +35,9 @@ import { NoneLSExtensionManager } from './noneLSExtensionManager'; import { PylanceLSExtensionManager } from './pylanceLSExtensionManager'; import { ILanguageServerExtensionManager, ILanguageServerWatcher } from './types'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + @injectable() /** * The Language Server Watcher class implements the ILanguageServerWatcher interface, which is the one-stop shop for language server activation. @@ -287,13 +291,21 @@ function logStartup(languageServerType: LanguageServerType, resource: Uri): void switch (languageServerType) { case LanguageServerType.Jedi: - outputLine = LanguageService.startingJedi.format(basename); + outputLine = localize('LanguageService.startingJedi', 'Starting Jedi language server for {0}.', basename); break; case LanguageServerType.Node: - outputLine = LanguageService.startingPylance.format(basename); + outputLine = localize( + 'LanguageService.startingPylance', + 'Starting Pylance language server for {0}.', + basename, + ); break; case LanguageServerType.None: - outputLine = LanguageService.startingNone.format(basename); + outputLine = localize( + 'LanguageService.startingNone', + 'Editor support is inactive since language server is set to None for {0}.', + basename, + ); break; default: throw new Error(`Unknown language server type: ${languageServerType}`); diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index 60d0a4f3bbef..b228b7176d23 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -4,15 +4,18 @@ 'use strict'; import { DiagnosticCollection, Disposable, QuickPickOptions, Uri } from 'vscode'; +import * as nls from 'vscode-nls'; import { IApplicationShell, ICommandManager, IDocumentManager } from '../common/application/types'; import { Commands } from '../common/constants'; import { IDisposable } from '../common/types'; -import { Linters } from '../common/utils/localize'; import { IServiceContainer } from '../ioc/types'; import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; import { ILinterManager, ILintingEngine, LinterId } from './types'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + export class LinterCommands implements IDisposable { private disposables: Disposable[] = []; @@ -71,7 +74,11 @@ export class LinterCommands implements IDisposable { const index = linters.findIndex((x) => x.id === selection); if (activeLinters.length > 1) { const response = await this.appShell.showWarningMessage( - Linters.replaceWithSelectedLinter.format(selection), + localize( + 'Linter.replaceWithSelectedLinter', + "Multiple linters are enabled in settings. Replace with '{0}'?", + selection, + ), 'Yes', 'No', ); diff --git a/src/client/tensorBoard/tensorBoardSession.ts b/src/client/tensorBoard/tensorBoardSession.ts index 0ffc21e178e2..a2889318d9f8 100644 --- a/src/client/tensorBoard/tensorBoardSession.ts +++ b/src/client/tensorBoard/tensorBoardSession.ts @@ -23,6 +23,7 @@ import { window, workspace, } from 'vscode'; +import * as nls from 'vscode-nls'; import { IApplicationShell, ICommandManager, IWorkspaceService } from '../common/application/types'; import { createPromiseFromCancellation } from '../common/cancellation'; import { tensorboardLauncher } from '../common/process/internal/scripts'; @@ -47,6 +48,9 @@ import { IMultiStepInputFactory } from '../common/utils/multiStepInput'; import { ModuleInstallFlags } from '../common/installer/types'; import { traceError, traceInfo } from '../logging'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + enum Messages { JumpToSource = 'jump_to_source', } @@ -354,7 +358,7 @@ export class TensorBoardSession { const item = await this.applicationShell.showQuickPick(items, { canPickMany: false, ignoreFocusOut: false, - placeHolder: logDir ? TensorBoard.currentDirectory.format(logDir) : undefined, + placeHolder: logDir ? localize('TensorBoard.currentDirectory', 'Current: {0}', logDir) : undefined, }); switch (item?.label) { case useCurrentWorkingDirectory: diff --git a/src/client/tensorBoard/tensorBoardSessionProvider.ts b/src/client/tensorBoard/tensorBoardSessionProvider.ts index 352ec3dff585..ed4fce66d00f 100644 --- a/src/client/tensorBoard/tensorBoardSessionProvider.ts +++ b/src/client/tensorBoard/tensorBoardSessionProvider.ts @@ -3,13 +3,13 @@ import { inject, injectable } from 'inversify'; import { ViewColumn } from 'vscode'; +import * as nls from 'vscode-nls'; import { IExtensionSingleActivationService } from '../activation/types'; import { IApplicationShell, ICommandManager, IWorkspaceService } from '../common/application/types'; import { Commands } from '../common/constants'; import { ContextKey } from '../common/contextKey'; import { IProcessServiceFactory } from '../common/process/types'; import { IDisposableRegistry, IInstaller, IPersistentState, IPersistentStateFactory } from '../common/types'; -import { TensorBoard } from '../common/utils/localize'; import { IMultiStepInputFactory } from '../common/utils/multiStepInput'; import { IInterpreterService } from '../interpreter/contracts'; import { traceError, traceInfo } from '../logging'; @@ -18,6 +18,9 @@ import { EventName } from '../telemetry/constants'; import { TensorBoardEntrypoint, TensorBoardEntrypointTrigger } from './constants'; import { TensorBoardSession } from './tensorBoardSession'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + const PREFERRED_VIEWGROUP = 'PythonTensorBoardWebviewPreferredViewGroup'; @injectable() @@ -109,7 +112,11 @@ export class TensorBoardSessionProvider implements IExtensionSingleActivationSer } catch (e) { traceError(`Encountered error while starting new TensorBoard session: ${e}`); await this.applicationShell.showErrorMessage( - TensorBoard.failedToStartSessionError.format((e as Error).message), + localize( + 'TensorBoard.failedToStartSessionError', + 'We failed to start a TensorBoard session due to the following error: {0}', + (e as Error).message, + ), ); } return undefined; diff --git a/src/test/common/experiments/service.unit.test.ts b/src/test/common/experiments/service.unit.test.ts index 48fd9075286b..d67f2a598bc2 100644 --- a/src/test/common/experiments/service.unit.test.ts +++ b/src/test/common/experiments/service.unit.test.ts @@ -9,6 +9,7 @@ import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import { Disposable } from 'vscode-jsonrpc'; import * as tasClient from 'vscode-tas-client'; +import * as nls from 'vscode-nls'; import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment'; import { IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types'; import { WorkspaceService } from '../../../client/common/application/workspace'; @@ -16,7 +17,6 @@ import { Channel } from '../../../client/common/constants'; import { ExperimentService } from '../../../client/common/experiments/service'; import { PersistentState } from '../../../client/common/persistentState'; import { IPersistentStateFactory } from '../../../client/common/types'; -import { Experiments } from '../../../client/common/utils/localize'; import { registerLogger } from '../../../client/logging'; import { OutputChannelLogger } from '../../../client/logging/outputChannelLogger'; import * as Telemetry from '../../../client/telemetry'; @@ -25,6 +25,8 @@ import { PVSC_EXTENSION_ID_FOR_TESTS } from '../../constants'; import { MockOutputChannel } from '../../mockClasses'; import { MockMemento } from '../../mocks/mementos'; +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + suite('Experimentation service', () => { const extensionVersion = '1.2.3'; const dummyExperimentKey = 'experimentsKey'; @@ -158,7 +160,7 @@ suite('Experimentation service', () => { instance(stateFactory), ); await exp.activate(); - const output = `${Experiments.inGroup.format('pythonExperiment')}\n`; + const output = `${localize('Experiments.inGroup', "Experiment '{0}' is active", 'pythonExperiment')}\n`; assert.strictEqual(outputChannel.output, output); }); diff --git a/src/test/common/installer/moduleInstaller.unit.test.ts b/src/test/common/installer/moduleInstaller.unit.test.ts index e45da92daaee..5b302058e8c3 100644 --- a/src/test/common/installer/moduleInstaller.unit.test.ts +++ b/src/test/common/installer/moduleInstaller.unit.test.ts @@ -12,6 +12,7 @@ import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import * as TypeMoq from 'typemoq'; import { CancellationTokenSource, Disposable, ProgressLocation, Uri, WorkspaceConfiguration } from 'vscode'; +import * as nls from 'vscode-nls'; import { IApplicationShell, IWorkspaceService } from '../../../client/common/application/types'; import { STANDARD_OUTPUT_CHANNEL } from '../../../client/common/constants'; import { CondaInstaller } from '../../../client/common/installer/condaInstaller'; @@ -37,7 +38,6 @@ import { Product, } from '../../../client/common/types'; import { getNamesAndValues } from '../../../client/common/utils/enum'; -import { Products } from '../../../client/common/utils/localize'; import { noop } from '../../../client/common/utils/misc'; import { Architecture } from '../../../client/common/utils/platform'; import { IComponentAdapter, ICondaService, IInterpreterService } from '../../../client/interpreter/contracts'; @@ -45,6 +45,8 @@ import { IServiceContainer } from '../../../client/ioc/types'; import * as logging from '../../../client/logging'; import { EnvironmentType, ModuleInstallerType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + const pythonPath = path.join(__dirname, 'python'); /* Complex test to ensure we cover all combinations: @@ -540,7 +542,11 @@ suite('Module Installer', () => { const options = { location: ProgressLocation.Notification, cancellable: true, - title: Products.installingModule.format(product.name), + title: localize( + 'products.installingModule', + 'Installing {0}', + product.name, + ), }; appShell .setup((a) => a.withProgress(TypeMoq.It.isAny(), TypeMoq.It.isAny())) diff --git a/src/test/common/installer/productInstaller.unit.test.ts b/src/test/common/installer/productInstaller.unit.test.ts index 7e5f5389e7f6..fcb764ec0a73 100644 --- a/src/test/common/installer/productInstaller.unit.test.ts +++ b/src/test/common/installer/productInstaller.unit.test.ts @@ -18,7 +18,7 @@ import { IProductService, } from '../../../client/common/installer/types'; import { InstallerResponse, IPersistentStateFactory, Product, ProductType } from '../../../client/common/types'; -import { Common, Products } from '../../../client/common/utils/localize'; +import { Common } from '../../../client/common/utils/localize'; import { Architecture } from '../../../client/common/utils/platform'; import { IServiceContainer } from '../../../client/ioc/types'; import { EnvironmentType, ModuleInstallerType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; @@ -292,8 +292,8 @@ suite('Formatter installer', async () => { test('If black is not installed, offer autopep8 and yapf as options', async () => { const messageOptions = [ Common.bannerLabelYes, - Products.useFormatter.format(ProductNames.get(Product.autopep8)!), - Products.useFormatter.format(ProductNames.get(Product.yapf)!), + 'Use {0}'.format(ProductNames.get(Product.autopep8)!), + 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, ]; @@ -324,8 +324,8 @@ suite('Formatter installer', async () => { test('If autopep8 is not installed, offer black and yapf as options', async () => { const messageOptions = [ Common.bannerLabelYes, - Products.useFormatter.format(ProductNames.get(Product.black)!), - Products.useFormatter.format(ProductNames.get(Product.yapf)!), + 'Use {0}'.format(ProductNames.get(Product.black)!), + 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, ]; @@ -356,8 +356,8 @@ suite('Formatter installer', async () => { test('If yapf is not installed, offer autopep8 and black as options', async () => { const messageOptions = [ Common.bannerLabelYes, - Products.useFormatter.format(ProductNames.get(Product.autopep8)!), - Products.useFormatter.format(ProductNames.get(Product.black)!), + 'Use {0}'.format(ProductNames.get(Product.autopep8)!), + 'Use {0}'.format(ProductNames.get(Product.black)!), Common.doNotShowAgain, ]; @@ -387,8 +387,8 @@ suite('Formatter installer', async () => { test('If the formatter is not executable as a module, display an error message', async () => { const messageOptions = [ - Products.useFormatter.format(ProductNames.get(Product.autopep8)!), - Products.useFormatter.format(ProductNames.get(Product.yapf)!), + 'Use {0}'.format(ProductNames.get(Product.autopep8)!), + 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, ]; @@ -421,8 +421,8 @@ suite('Formatter installer', async () => { test('If "Do not show again" has been selected earlier, do not display the prompt', async () => { const messageOptions = [ Common.bannerLabelYes, - Products.useFormatter.format(ProductNames.get(Product.autopep8)!), - Products.useFormatter.format(ProductNames.get(Product.yapf)!), + 'Use {0}'.format(ProductNames.get(Product.autopep8)!), + 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, ]; @@ -449,8 +449,8 @@ suite('Formatter installer', async () => { let value = false; const messageOptions = [ Common.bannerLabelYes, - Products.useFormatter.format(ProductNames.get(Product.autopep8)!), - Products.useFormatter.format(ProductNames.get(Product.yapf)!), + 'Use {0}'.format(ProductNames.get(Product.autopep8)!), + 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, ]; diff --git a/src/test/common/net/fileDownloader.unit.test.ts b/src/test/common/net/fileDownloader.unit.test.ts index 8c84fe12a014..df55dcb37516 100644 --- a/src/test/common/net/fileDownloader.unit.test.ts +++ b/src/test/common/net/fileDownloader.unit.test.ts @@ -21,10 +21,13 @@ import { FileSystem } from '../../../client/common/platform/fileSystem'; import { PlatformService } from '../../../client/common/platform/platformService'; import { IFileSystem } from '../../../client/common/platform/types'; import { IHttpClient } from '../../../client/common/types'; -import { Http } from '../../../client/common/utils/localize'; import { EXTENSION_ROOT_DIR } from '../../../client/constants'; import * as logging from '../../../client/logging'; import { noop } from '../../core'; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const requestProgress = require('request-progress'); const request = require('request'); @@ -212,7 +215,9 @@ suite('File Downloader', () => { expect(progressReportStub.args[4][0].message).to.equal(getProgressMessage(50, 100)); function getProgressMessage(downloadedKb: number, percentage: number) { - return Http.downloadingFileProgress.format( + return localize( + 'downloading.file.progress', + '{0}{1} of {2} KB ({3}%)', 'Downloading-something', downloadedKb.toFixed(), totalKb.toFixed(), @@ -255,7 +260,7 @@ suite('File Downloader', () => { extension: '.pdf', }); - traceLogStub.calledWithExactly(Http.downloadingFile.format('file to download')); + traceLogStub.calledWithExactly(localize('downloading.file', 'Downloading {0}...', 'file to download')); }); test('Display progress when downloading', async () => { const tmpFile = { filePath: 'my temp file', dispose: noop }; diff --git a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts index f84099f2d207..af4b41102f64 100644 --- a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts +++ b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts @@ -228,7 +228,7 @@ suite('Set Interpreter Command', () => { recommended, ]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), + placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, @@ -343,7 +343,7 @@ suite('Set Interpreter Command', () => { interpreterItems[5], ]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), + placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, @@ -426,7 +426,7 @@ suite('Set Interpreter Command', () => { const suggestions = [expectedEnterInterpreterPathSuggestion, defaultPathSuggestion, separator, recommended]; const expectedParameters: IQuickPickParameters = { - placeholder: InterpreterQuickPickList.quickPickListPlaceholder.format(currentPythonPath), + placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), items: suggestions, activeItem: recommended, matchOnDetail: true, diff --git a/src/test/interpreters/display.unit.test.ts b/src/test/interpreters/display.unit.test.ts index 59d3b1d7a404..e73522ee2bb1 100644 --- a/src/test/interpreters/display.unit.test.ts +++ b/src/test/interpreters/display.unit.test.ts @@ -19,7 +19,7 @@ import { IApplicationShell, IWorkspaceService } from '../../client/common/applic import { Commands, PYTHON_LANGUAGE } from '../../client/common/constants'; import { IFileSystem } from '../../client/common/platform/types'; import { IDisposableRegistry, IPathUtils, ReadWrite } from '../../client/common/types'; -import { InterpreterQuickPickList, Interpreters } from '../../client/common/utils/localize'; +import { InterpreterQuickPickList } from '../../client/common/utils/localize'; import { Architecture } from '../../client/common/utils/platform'; import { IInterpreterDisplay, @@ -43,6 +43,10 @@ const info: PythonEnvironment = { sysPrefix: '', sysVersion: '', }; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); suite('Interpreters Display', () => { let applicationShell: TypeMoq.IMock; @@ -211,7 +215,13 @@ suite('Interpreters Display', () => { .returns(() => Promise.resolve(activeInterpreter)); await interpreterDisplay.refresh(resource); - traceLogStub.calledOnceWithExactly(Interpreters.pythonInterpreterPath.format(activeInterpreter.path)); + traceLogStub.calledOnceWithExactly( + localize( + 'Interpreters.pythonInterpreterPath', + 'Python interpreter path: {0}', + activeInterpreter.path, + ), + ); }); test('If interpreter is not identified then tooltip should point to python Path', async () => { const resource = Uri.file('x'); diff --git a/src/test/languageServer/watcher.unit.test.ts b/src/test/languageServer/watcher.unit.test.ts index 94f92364fb27..0ed42b0309da 100644 --- a/src/test/languageServer/watcher.unit.test.ts +++ b/src/test/languageServer/watcher.unit.test.ts @@ -4,6 +4,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { ConfigurationChangeEvent, Disposable, Uri } from 'vscode'; +import * as nls from 'vscode-nls'; import { ILanguageServerOutputChannel, LanguageServerType } from '../../client/activation/types'; import { IApplicationShell, ICommandManager, IWorkspaceService } from '../../client/common/application/types'; import { IFileSystem } from '../../client/common/platform/types'; @@ -13,7 +14,6 @@ import { IExtensions, IInterpreterPathService, } from '../../client/common/types'; -import { LanguageService } from '../../client/common/utils/localize'; import { IEnvironmentVariablesProvider } from '../../client/common/variables/types'; import { IInterpreterHelper, IInterpreterService } from '../../client/interpreter/contracts'; import { IServiceContainer } from '../../client/ioc/types'; @@ -22,6 +22,8 @@ import { PylanceLSExtensionManager } from '../../client/languageServer/pylanceLS import { LanguageServerWatcher } from '../../client/languageServer/watcher'; import * as Logging from '../../client/logging'; +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + suite('Language server watcher', () => { let watcher: LanguageServerWatcher; const sandbox = sinon.createSandbox(); @@ -288,7 +290,14 @@ suite('Language server watcher', () => { await watcher.startLanguageServer(LanguageServerType.None); - assert.strictEqual(output, LanguageService.startingNone.format('workspace')); + assert.strictEqual( + output, + localize( + 'LanguageService.startingNone', + 'Editor support is inactive since language server is set to None for {0}.', + 'workspace', + ), + ); }); test(`When starting the language server, if the language server can be started, this.languageServerType should reflect the new language server type`, async () => { From 9b92cd726f133f8e0158aebec75821fc65537684 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Fri, 22 Apr 2022 17:53:06 -0700 Subject: [PATCH 26/39] Fix localize string --- package.nls.json | 193 ------------------ src/client/common/utils/localize.ts | 4 - .../configuration/providers/pyramidLaunch.ts | 10 +- 3 files changed, 9 insertions(+), 198 deletions(-) diff --git a/package.nls.json b/package.nls.json index 19dc3e05ce42..ce18ad0e62a8 100644 --- a/package.nls.json +++ b/package.nls.json @@ -23,199 +23,6 @@ "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", "python.command.python.runLinting.title": "Run Linting", "python.menu.createNewFile.title": "Python File", - "python.snippet.launch.standard.label": "Python: Current File", - "python.snippet.launch.module.label": "Python: Module", - "python.snippet.launch.module.default": "enter-your-module-name", - "python.snippet.launch.attach.label": "Python: Remote Attach", - "python.snippet.launch.attachpid.label": "Python: Attach using Process Id", - "python.snippet.launch.django.label": "Python: Django", - "python.snippet.launch.fastapi.label": "Python: FastAPI", - "python.snippet.launch.flask.label": "Python: Flask", - "python.snippet.launch.pyramid.label": "Python: Pyramid Application", - "Pylance.remindMeLater": "Remind me later", - "Pylance.pylanceNotInstalledMessage": "Pylance extension is not installed.", - "Pylance.pylanceInstalledReloadPromptMessage": "Pylance extension is now installed. Reload window to activate?", - "Pylance.pylanceRevertToJediPrompt": "The Pylance extension is not installed but the python.languageServer value is set to \"Pylance\". Would you like to install the Pylance extension to use Pylance, or revert back to Jedi?", - "Pylance.pylanceInstallPylance": "Install Pylance", - "Pylance.pylanceRevertToJedi": "Revert to Jedi", - "Experiments.inGroup": "Experiment '{0}' is active", - "Experiments.optedOutOf": "Experiment '{0}' is inactive", - "Interpreters.installingPython": "Installing Python into Environment...", - "Interpreters.clearAtWorkspace": "Clear at workspace level", - "Interpreters.RefreshingInterpreters": "Refreshing Python Interpreters", - "Interpreters.entireWorkspace": "Select at workspace level", - "Interpreters.pythonInterpreterPath": "Python interpreter path: {0}", - "Interpreters.DiscoveringInterpreters": "Discovering Python Interpreters", - "Interpreters.condaInheritEnvMessage": "We noticed you're using a conda environment. If you are experiencing issues with this environment in the integrated terminal, we recommend that you let the Python extension change \"terminal.integrated.inheritEnv\" to false in your user settings.", - "Logging.CurrentWorkingDirectory": "cwd:", - "InterpreterQuickPickList.workspaceGroupName": "Workspace", - "InterpreterQuickPickList.globalGroupName": "Global", - "InterpreterQuickPickList.quickPickListPlaceholder": "Selected Interpreter: {0}", - "InterpreterQuickPickList.enterPath.label": "Enter interpreter path...", - "InterpreterQuickPickList.enterPath.placeholder": "Enter path to a Python interpreter.", - "InterpreterQuickPickList.refreshInterpreterList": "Refresh Interpreter list", - "InterpreterQuickPickList.browsePath.label": "Find...", - "InterpreterQuickPickList.browsePath.detail": "Browse your file system to find a Python interpreter.", - "InterpreterQuickPickList.browsePath.title": "Select Python interpreter", - "InterpreterQuickPickList.defaultInterpreterPath.label": "Use Python from `python.defaultInterpreterPath` setting", - "Common.clearAll": "Clear all", - "Common.bannerLabelYes": "Yes", - "Common.bannerLabelNo": "No", - "Common.doNotShowAgain": "Do not show again", - "Common.reload": "Reload", - "Common.moreInfo": "More Info", - "Common.and": "and", - "Common.ok": "Ok", - "Common.error": "Error", - "Common.install": "Install", - "Common.learnMore": "Learn more", - "Common.reportThisIssue": "Report this issue", - "Common.recommended": "Recommended", - "CommonSurvey.remindMeLaterLabel": "Remind me later", - "CommonSurvey.yesLabel": "Yes, take survey now", - "CommonSurvey.noLabel": "No, thanks", - "OutputChannelNames.languageServer": "Python Language Server", - "OutputChannelNames.python": "Python", - "OutputChannelNames.pythonTest": "Python Test Log", - "ExtensionSurveyBanner.bannerMessage": "Can you please take 2 minutes to tell us how the Python extension is working for you?", - "ExtensionSurveyBanner.bannerLabelYes": "Yes, take survey now", - "ExtensionSurveyBanner.bannerLabelNo": "No, thanks", - "ExtensionSurveyBanner.maybeLater": "Maybe later", - "Interpreters.environmentPromptMessage": "We noticed a new virtual environment has been created. Do you want to select it for the workspace folder?", - "Linter.replaceWithSelectedLinter": "Multiple linters are enabled in settings. Replace with '{0}'?", - "Linter.install": "Install a linter to get error reporting.", - "Linter.selectLinter": "Select Linter", - "Installer.noCondaOrPipInstaller": "There is no Conda or Pip installer available in the selected environment.", - "Installer.noPipInstaller": "There is no Pip installer available in the selected environment.", - "Installer.searchForHelp": "Search for help", - "Installer.couldNotInstallLibrary": "Could not install {0}. If pip is not available, please use the package manager of your choice to manually install this library into your Python environment.", - "Installer.dataScienceInstallPrompt": "Data Science library {0} is not installed. Install?", - "diagnostics.removedPythonPathFromSettings": "The \"python.pythonPath\" setting in your settings.json is no longer used by the Python extension. If you want, you can use a new setting called \"python.defaultInterpreterPath\" instead. Keep in mind that you need to change the value of this setting manually as the Python extension doesn’t modify it when you change interpreters. [Learn more](https://aka.ms/AA7jfor).", - "diagnostics.warnSourceMaps": "Source map support is enabled in the Python Extension, this will adversely impact performance of the extension.", - "diagnostics.disableSourceMaps": "Disable Source Map Support", - "diagnostics.warnBeforeEnablingSourceMaps": "Enabling source map support in the Python Extension will adversely impact performance of the extension.", - "diagnostics.enableSourceMapsAndReloadVSC": "Enable and reload Window", - "diagnostics.lsNotSupported": "Your operating system does not meet the minimum requirements of the Python Language Server. Reverting to the alternative autocompletion provider, Jedi.", - "diagnostics.invalidPythonPathInDebuggerSettings": "You need to select a Python interpreter before you start debugging.\n\nTip: click on \"Select Python Interpreter\" in the status bar.", - "diagnostics.invalidPythonPathInDebuggerLaunch": "The Python path in your debug configuration is invalid.", - "diagnostics.invalidDebuggerTypeDiagnostic": "Your launch.json file needs to be updated to change the \"pythonExperimental\" debug configurations to use the \"python\" debugger type, otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?", - "diagnostics.consoleTypeDiagnostic": "Your launch.json file needs to be updated to change the console type string from \"none\" to \"internalConsole\", otherwise Python debugging may not work. Would you like to automatically update your launch.json file now?", - "diagnostics.justMyCodeDiagnostic": "Configuration \"debugStdLib\" in launch.json is no longer supported. It's recommended to replace it with \"justMyCode\", which is the exact opposite of using \"debugStdLib\". Would you like to automatically update your launch.json file to do that?", - "diagnostics.checkIsort5UpgradeGuide": "We found outdated configuration for sorting imports in this workspace. Check the [isort upgrade guide](https://aka.ms/AA9j5x4) to update your settings.", - "diagnostics.yesUpdateLaunch": "Yes, update launch.json", - "diagnostics.invalidTestSettings": "Your settings needs to be updated to change the setting \"python.unitTest.\" to \"python.testing.\", otherwise testing Python code using the extension may not work. Would you like to automatically update your settings now?", - "diagnostics.pylanceDefaultMessage": "The Python extension now includes Pylance to improve completions, code navigation, overall performance and much more! You can learn more about the update and learn how to change your language server [here](https://aka.ms/new-python-bundle).\n\nRead Pylance’s license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license).", - "Common.canceled": "Canceled", - "Common.cancel": "Cancel", - "Common.yesPlease": "Yes, please", - "Common.loadingPythonExtension": "Python extension loading...", - "debug.selectConfigurationTitle": "Select a debug configuration", - "debug.selectConfigurationPlaceholder": "Debug Configuration", - "debug.launchJsonConfigurationsCompletionLabel": "Python", - "debug.launchJsonConfigurationsCompletionDescription": "Select a Python debug configuration", - "debug.debugFileConfigurationLabel": "Python File", - "debug.debugFileConfigurationDescription": "Debug the currently active Python file", - "debug.debugModuleConfigurationLabel": "Module", - "debug.debugModuleConfigurationDescription": "Debug a Python module by invoking it with '-m'", - "debug.moduleEnterModuleTitle": "Debug Module", - "debug.moduleEnterModulePrompt": "Enter a Python module/package name", - "debug.moduleEnterModuleDefault": "enter-your-module-name", - "debug.moduleEnterModuleInvalidNameError": "Enter a valid module name", - "debug.remoteAttachConfigurationLabel": "Remote Attach", - "debug.remoteAttachConfigurationDescription": "Attach to a remote debug server", - "debug.attachRemoteHostTitle": "Remote Debugging", - "debug.attachRemoteHostPrompt": "Enter the host name", - "debug.attachRemoteHostValidationError": "Enter a valid host name or IP address", - "debug.attachRemotePortTitle": "Remote Debugging", - "debug.attachRemotePortPrompt": "Enter the port number that the debug server is listening on", - "debug.attachRemotePortValidationError": "Enter a valid port number", - "debug.attachPidConfigurationLabel": "Attach using Process ID", - "debug.attachPidConfigurationDescription": "Attach to a local process", - "debug.debugDjangoConfigurationLabel": "Django", - "debug.debugDjangoConfigurationDescription": "Launch and debug a Django web application", - "debug.djangoEnterManagePyPathTitle": "Debug Django", - "debug.djangoEnterManagePyPathPrompt": "Enter the path to manage.py ('${workspaceFolderToken}' points to the root of the current workspace folder)", - "debug.djangoEnterManagePyPathInvalidFilePathError": "Enter a valid Python file path", - "debug.debugFastAPIConfigurationLabel": "FastAPI", - "debug.debugFastAPIConfigurationDescription": "Launch and debug a FastAPI web application", - "debug.fastapiEnterAppPathOrNamePathTitle": "Debug FastAPI", - "debug.fastapiEnterAppPathOrNamePathPrompt": "Enter the path to the application, e.g. 'main.py' or 'main'", - "debug.fastapiEnterAppPathOrNamePathInvalidNameError": "Enter a valid name", - "debug.debugFlaskConfigurationLabel": "Flask", - "debug.debugFlaskConfigurationDescription": "Launch and debug a Flask web application", - "debug.flaskEnterAppPathOrNamePathTitle": "Debug Flask", - "debug.flaskEnterAppPathOrNamePathPrompt": "Enter the path to the application, e.g. 'app.py' or 'app'", - "debug.flaskEnterAppPathOrNamePathInvalidNameError": "Enter a valid name", - "debug.debugPyramidConfigurationLabel": "Pyramid", - "debug.debugPyramidConfigurationDescription": "Launch and debug a Pyramid web application", - "debug.pyramidEnterDevelopmentIniPathTitle": "Debug Pyramid", - "debug.pyramidEnterDevelopmentIniPathPrompt": "`Enter the path to development.ini ('${workspaceFolderToken}' points to the root of the current workspace folder)`", - "debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "Enter a valid file path", - "Testing.configureTests": "Configure Test Framework", - "Testing.testNotConfigured": "No test framework configured.", - "Testing.cancelUnittestDiscovery": "Canceled unittest test discovery", - "Testing.errorUnittestDiscovery": "Unittest test discovery error", - "Testing.seePythonOutput": "(see Output > Python)", - "Common.openOutputPanel": "Show output", - "LanguageService.statusItem.name": "Python IntelliSense Status", - "LanguageService.statusItem.text": "Partial Mode", - "LanguageService.virtualWorkspaceStatusItem.detail": "Only limited IntelliSense is supported", - "LanguageService.statusItem.detail": "Limited IntelliSense provided by Pylance", - "LanguageService.lsFailedToStart": "We encountered an issue starting the language server. Reverting to Jedi language engine. Check the Python output panel for details.", - "LanguageService.lsFailedToDownload": "We encountered an issue downloading the language server. Reverting to Jedi language engine. Check the Python output panel for details.", - "LanguageService.lsFailedToExtract": "We encountered an issue extracting the language server. Reverting to Jedi language engine. Check the Python output panel for details.", - "LanguageService.untrustedWorkspaceMessage": "Only Pylance is supported in untrusted workspaces, setting language server to None.", - "LanguageService.downloadFailedOutputMessage": "Language server download failed", - "LanguageService.extractionFailedOutputMessage": "Language server extraction failed", - "LanguageService.extractionCompletedOutputMessage": "Language server download complete", - "LanguageService.extractionDoneOutputMessage": "done", - "LanguageService.reloadVSCodeIfSeachPathHasChanged": "Search paths have changed for this Python interpreter. Please reload the extension to ensure that the IntelliSense works correctly", - "LanguageService.startingPylance": "Starting Pylance language server.", - "LanguageService.startingJedi": "Starting Jedi language server for {0}.", - "LanguageService.startingNone": "Editor support is inactive since language server is set to None.", - "LanguageService.reloadAfterLanguageServerChange": "Please reload the window switching between language servers.", - "AttachProcess.unsupportedOS": "Operating system '{0}' not supported.", - "AttachProcess.attachTitle": "Attach to process", - "AttachProcess.selectProcessPlaceholder": "Select the process to attach to", - "AttachProcess.noProcessSelected": "No process selected", - "AttachProcess.refreshList": "Refresh process list", - "diagnostics.updateSettings": "Yes, update settings", - "Common.noIWillDoItLater": "No, I will do it later", - "Common.notNow": "Not now", - "Common.gotIt": "Got it!", - "Interpreters.selectInterpreterTip": "Tip: you can change the Python interpreter used by the Python extension by clicking on the Python version in the status bar", - "downloading.file": "Downloading {0}...", - "downloading.file.progress": "{0}{1} of {2} KB ({3}%)", - "products.installingModule": "Installing {0}", - "products.formatterNotInstalled": "Formatter {0} is not installed. Install?", - "products.useFormatter": "Use {0}", - "products.invalidFormatterPath": "Path to the {0} formatter is invalid ({1})", - "OutdatedDebugger.updateDebuggerMessage": "We noticed you are attaching to ptvsd (Python debugger), which was deprecated on May 1st, 2020. Please switch to [debugpy](https://aka.ms/migrateToDebugpy).", - "Python27Support.jediMessage": "IntelliSense with Jedi for Python 2.7 is no longer supported. [Learn more](https://aka.ms/python-27-support).", - "Jupyter.extensionRequired": "The Jupyter extension is required to perform that task. Click Yes to open the Jupyter extension installation page.", - "TensorBoard.missingSourceFile": "We could not locate the requested source file on disk. Please manually specify the file.", - "TensorBoard.selectMissingSourceFile": "Choose File", - "TensorBoard.selectMissingSourceFileDescription": "The source file's contents may not match the original contents in the trace.", - "TensorBoard.useCurrentWorkingDirectory": "Use current working directory", - "TensorBoard.currentDirectory": "Current: {0}", - "TensorBoard.logDirectoryPrompt": "Select a log directory to start TensorBoard with", - "TensorBoard.progressMessage": "Starting TensorBoard session...", - "TensorBoard.failedToStartSessionError": "We failed to start a TensorBoard session due to the following error: {0}", - "TensorBoard.nativeTensorBoardPrompt": "VS Code now has integrated TensorBoard support. Would you like to launch TensorBoard? (Tip: Launch TensorBoard anytime by opening the command palette and searching for \"Launch TensorBoard\".)", - "TensorBoard.selectAFolder": "Select a folder", - "TensorBoard.selectAnotherFolder": "Select another folder", - "TensorBoard.selectAFolderDetail": "Select a log directory containing tfevent files", - "TensorBoard.selectAnotherFolderDetail": "Use the file explorer to select another folder", - "TensorBoard.useCurrentWorkingDirectoryDetail": "TensorBoard will search for tfevent files in all subdirectories of the current working directory", - "TensorBoard.installPrompt": "The package TensorBoard is required to launch a TensorBoard session. Would you like to install it?", - "TensorBoard.installTensorBoardAndProfilerPluginPrompt": "TensorBoard >= 2.4.1 and the PyTorch Profiler TensorBoard Plugin are required. Would you like to install these packages?", - "TensorBoard.installProfilerPluginPrompt": "We recommend installing the PyTorch Profiler TensorBoard plugin. Would you like to install the package?", - "TensorBoard.upgradePrompt": "Integrated TensorBoard support is only available for TensorBoard >= 2.4.1. Would you like to upgrade your copy of TensorBoard?", - "TensorBoard.launchNativeTensorBoardSessionCodeAction": "Launch TensorBoard session", - "TensorBoard.launchNativeTensorBoardSessionCodeLens": "▶ Launch TensorBoard Session", - "TensorBoard.enterRemoteUrl": "Enter remote URL", - "TensorBoard.enterRemoteUrlDetail": "Enter a URL pointing to a remote directory containing your TensorBoard log files", - "SwitchToDefaultLS.bannerMessage": "The Microsoft Python Language Server has reached end of life. Your language server has been set to the default for Python in VS Code, Pylance. If you’d like to change your language server, you can learn about how to do so [here](https://devblogs.microsoft.com/python/python-in-visual-studio-code-may-2021-release/#configuring-your-language-server). Read Pylance’s license [here](https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/license).", "python.command.python.setLinter.title": "Select Linter", "python.command.python.sortImports.title": "Sort Imports", "python.command.python.startREPL.title": "Start REPL", diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 6558e3b65f51..1071a61de029 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -487,10 +487,6 @@ export namespace DebugConfigStrings { }; export const enterDevelopmentIniPath = { title: localize('debug.pyramidEnterDevelopmentIniPathTitle', 'Debug Pyramid'), - prompt: localize( - 'debug.pyramidEnterDevelopmentIniPathPrompt', - "`Enter the path to development.ini ('${workspaceFolderToken}' points to the root of the current workspace folder)`", - ), invalid: localize('debug.pyramidEnterDevelopmentIniPathInvalidFilePathError', 'Enter a valid file path'), }; } diff --git a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts index 1c38161aa27a..44e627e34123 100644 --- a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts @@ -17,6 +17,10 @@ import { EventName } from '../../../../telemetry/constants'; import { DebuggerTypeName } from '../../../constants'; import { LaunchRequestArguments } from '../../../types'; import { DebugConfigurationState, DebugConfigurationType, IDebugConfigurationProvider } from '../../types'; +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const workspaceFolderToken = '${workspaceFolder}'; @@ -47,7 +51,11 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat const selectedIniPath = await input.showInputBox({ title: DebugConfigStrings.pyramid.enterDevelopmentIniPath.title, value: defaultIni, - prompt: DebugConfigStrings.pyramid.enterDevelopmentIniPath.prompt, + prompt: localize( + 'debug.pyramidEnterDevelopmentIniPathPrompt', + 'Enter the path to development.ini ({0} points to the root of the current workspace folder)', + workspaceFolderToken, + ), validate: (value) => this.validateIniPath(state ? state.folder : undefined, defaultIni, value), }); if (selectedIniPath) { From 9be935de29a7c9d320a9ee12205300733dd9c151 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Fri, 22 Apr 2022 18:07:17 -0700 Subject: [PATCH 27/39] Fix test in watcher --- src/test/languageServer/watcher.unit.test.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/test/languageServer/watcher.unit.test.ts b/src/test/languageServer/watcher.unit.test.ts index 4206799ee94c..c9d0b930cefa 100644 --- a/src/test/languageServer/watcher.unit.test.ts +++ b/src/test/languageServer/watcher.unit.test.ts @@ -4,7 +4,6 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { ConfigurationChangeEvent, Disposable, Uri, WorkspaceFolder, WorkspaceFoldersChangeEvent } from 'vscode'; -import * as nls from 'vscode-nls'; import { JediLanguageServerManager } from '../../client/activation/jedi/manager'; import { NodeLanguageServerManager } from '../../client/activation/node/manager'; import { ILanguageServerOutputChannel, LanguageServerType } from '../../client/activation/types'; @@ -16,6 +15,7 @@ import { IExtensions, IInterpreterPathService, } from '../../client/common/types'; +import { LanguageService } from '../../client/common/utils/localize'; import { IEnvironmentVariablesProvider } from '../../client/common/variables/types'; import { IInterpreterHelper, IInterpreterService } from '../../client/interpreter/contracts'; import { IServiceContainer } from '../../client/ioc/types'; @@ -25,8 +25,6 @@ import { PylanceLSExtensionManager } from '../../client/languageServer/pylanceLS import { LanguageServerWatcher } from '../../client/languageServer/watcher'; import * as Logging from '../../client/logging'; -const localize: nls.LocalizeFunc = nls.loadMessageBundle(); - suite('Language server watcher', () => { let watcher: LanguageServerWatcher; const sandbox = sinon.createSandbox(); @@ -308,14 +306,7 @@ suite('Language server watcher', () => { await watcher.startLanguageServer(LanguageServerType.None); - assert.strictEqual( - output, - localize( - 'LanguageService.startingNone', - 'Editor support is inactive since language server is set to None for {0}.', - 'workspace', - ), - ); + assert.strictEqual(output, LanguageService.startingNone); }); test(`When starting the language server, if the language server can be started, this.languageServerType should reflect the new language server type`, async () => { From 139d3978f7ed1e610e6d1374f5d15891e4dc7bf7 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 09:42:02 -0700 Subject: [PATCH 28/39] Ignore localization files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index eb8b02d00b17..5bf5dcc12666 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ pydevd*.log nodeLanguageServer/** nodeLanguageServer.*/** dist/** +i18n/** +package.nls.**.json From 153e21ff207343a973683dff78904abfaf4fa1a1 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 12:41:43 -0700 Subject: [PATCH 29/39] Change strings in tests --- .gitignore | 6 ++++-- .../common/experiments/service.unit.test.ts | 5 +---- .../installer/productInstaller.unit.test.ts | 21 ++++++++++--------- .../common/net/fileDownloader.unit.test.ts | 15 ++----------- .../commands/setInterpreter.unit.test.ts | 6 +++--- src/test/interpreters/display.unit.test.ts | 11 ++-------- 6 files changed, 23 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 5bf5dcc12666..296d7b2dbdf8 100644 --- a/.gitignore +++ b/.gitignore @@ -42,5 +42,7 @@ pydevd*.log nodeLanguageServer/** nodeLanguageServer.*/** dist/** -i18n/** -package.nls.**.json +# translation files +*.xlf +*.nls.*.json +*.i18n.json diff --git a/src/test/common/experiments/service.unit.test.ts b/src/test/common/experiments/service.unit.test.ts index d67f2a598bc2..d198b37980b2 100644 --- a/src/test/common/experiments/service.unit.test.ts +++ b/src/test/common/experiments/service.unit.test.ts @@ -9,7 +9,6 @@ import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import { Disposable } from 'vscode-jsonrpc'; import * as tasClient from 'vscode-tas-client'; -import * as nls from 'vscode-nls'; import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment'; import { IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types'; import { WorkspaceService } from '../../../client/common/application/workspace'; @@ -25,8 +24,6 @@ import { PVSC_EXTENSION_ID_FOR_TESTS } from '../../constants'; import { MockOutputChannel } from '../../mockClasses'; import { MockMemento } from '../../mocks/mementos'; -const localize: nls.LocalizeFunc = nls.loadMessageBundle(); - suite('Experimentation service', () => { const extensionVersion = '1.2.3'; const dummyExperimentKey = 'experimentsKey'; @@ -160,7 +157,7 @@ suite('Experimentation service', () => { instance(stateFactory), ); await exp.activate(); - const output = `${localize('Experiments.inGroup', "Experiment '{0}' is active", 'pythonExperiment')}\n`; + const output = "Experiment 'pythonExperiment' is active\n"; assert.strictEqual(outputChannel.output, output); }); diff --git a/src/test/common/installer/productInstaller.unit.test.ts b/src/test/common/installer/productInstaller.unit.test.ts index fcb764ec0a73..ed1be158c0aa 100644 --- a/src/test/common/installer/productInstaller.unit.test.ts +++ b/src/test/common/installer/productInstaller.unit.test.ts @@ -292,8 +292,8 @@ suite('Formatter installer', async () => { test('If black is not installed, offer autopep8 and yapf as options', async () => { const messageOptions = [ Common.bannerLabelYes, - 'Use {0}'.format(ProductNames.get(Product.autopep8)!), - 'Use {0}'.format(ProductNames.get(Product.yapf)!), + `Use ${ProductNames.get(Product.autopep8)!}`, + `Use ${ProductNames.get(Product.yapf)!}`, Common.doNotShowAgain, ]; @@ -324,6 +324,7 @@ suite('Formatter installer', async () => { test('If autopep8 is not installed, offer black and yapf as options', async () => { const messageOptions = [ Common.bannerLabelYes, + 'Use {0}'.format(ProductNames.get(Product.black)!), 'Use {0}'.format(ProductNames.get(Product.yapf)!), Common.doNotShowAgain, @@ -356,8 +357,8 @@ suite('Formatter installer', async () => { test('If yapf is not installed, offer autopep8 and black as options', async () => { const messageOptions = [ Common.bannerLabelYes, - 'Use {0}'.format(ProductNames.get(Product.autopep8)!), - 'Use {0}'.format(ProductNames.get(Product.black)!), + `Use ${ProductNames.get(Product.autopep8)!}`, + `Use ${ProductNames.get(Product.black)!}`, Common.doNotShowAgain, ]; @@ -387,8 +388,8 @@ suite('Formatter installer', async () => { test('If the formatter is not executable as a module, display an error message', async () => { const messageOptions = [ - 'Use {0}'.format(ProductNames.get(Product.autopep8)!), - 'Use {0}'.format(ProductNames.get(Product.yapf)!), + `Use ${ProductNames.get(Product.autopep8)!}`, + `Use ${ProductNames.get(Product.yapf)!}`, Common.doNotShowAgain, ]; @@ -421,8 +422,8 @@ suite('Formatter installer', async () => { test('If "Do not show again" has been selected earlier, do not display the prompt', async () => { const messageOptions = [ Common.bannerLabelYes, - 'Use {0}'.format(ProductNames.get(Product.autopep8)!), - 'Use {0}'.format(ProductNames.get(Product.yapf)!), + `Use ${ProductNames.get(Product.autopep8)!}`, + `Use ${ProductNames.get(Product.yapf)!}`, Common.doNotShowAgain, ]; @@ -449,8 +450,8 @@ suite('Formatter installer', async () => { let value = false; const messageOptions = [ Common.bannerLabelYes, - 'Use {0}'.format(ProductNames.get(Product.autopep8)!), - 'Use {0}'.format(ProductNames.get(Product.yapf)!), + `Use ${ProductNames.get(Product.autopep8)!}`, + `Use ${ProductNames.get(Product.yapf)!}`, Common.doNotShowAgain, ]; diff --git a/src/test/common/net/fileDownloader.unit.test.ts b/src/test/common/net/fileDownloader.unit.test.ts index df55dcb37516..515ed488dc2e 100644 --- a/src/test/common/net/fileDownloader.unit.test.ts +++ b/src/test/common/net/fileDownloader.unit.test.ts @@ -24,10 +24,6 @@ import { IHttpClient } from '../../../client/common/types'; import { EXTENSION_ROOT_DIR } from '../../../client/constants'; import * as logging from '../../../client/logging'; import { noop } from '../../core'; -import * as nls from 'vscode-nls'; - -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); -const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const requestProgress = require('request-progress'); const request = require('request'); @@ -215,14 +211,7 @@ suite('File Downloader', () => { expect(progressReportStub.args[4][0].message).to.equal(getProgressMessage(50, 100)); function getProgressMessage(downloadedKb: number, percentage: number) { - return localize( - 'downloading.file.progress', - '{0}{1} of {2} KB ({3}%)', - 'Downloading-something', - downloadedKb.toFixed(), - totalKb.toFixed(), - percentage.toString(), - ); + return `Downloading-something${downloadedKb.toFixed()} of ${totalKb.toFixed()} KB (${percentage.toString()}%)`; } }); }); @@ -260,7 +249,7 @@ suite('File Downloader', () => { extension: '.pdf', }); - traceLogStub.calledWithExactly(localize('downloading.file', 'Downloading {0}...', 'file to download')); + traceLogStub.calledWithExactly('Downloading file to download...'); }); test('Display progress when downloading', async () => { const tmpFile = { filePath: 'my temp file', dispose: noop }; diff --git a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts index af4b41102f64..94540ab6ae70 100644 --- a/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts +++ b/src/test/configuration/interpreterSelector/commands/setInterpreter.unit.test.ts @@ -228,7 +228,7 @@ suite('Set Interpreter Command', () => { recommended, ]; const expectedParameters: IQuickPickParameters = { - placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), + placeholder: `Selected Interpreter: ${currentPythonPath}`, items: suggestions, activeItem: recommended, matchOnDetail: true, @@ -343,7 +343,7 @@ suite('Set Interpreter Command', () => { interpreterItems[5], ]; const expectedParameters: IQuickPickParameters = { - placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), + placeholder: `Selected Interpreter: ${currentPythonPath}`, items: suggestions, activeItem: recommended, matchOnDetail: true, @@ -426,7 +426,7 @@ suite('Set Interpreter Command', () => { const suggestions = [expectedEnterInterpreterPathSuggestion, defaultPathSuggestion, separator, recommended]; const expectedParameters: IQuickPickParameters = { - placeholder: 'Selected Interpreter: {0}'.format(currentPythonPath), + placeholder: `Selected Interpreter: ${currentPythonPath}`, items: suggestions, activeItem: recommended, matchOnDetail: true, diff --git a/src/test/interpreters/display.unit.test.ts b/src/test/interpreters/display.unit.test.ts index e73522ee2bb1..2d7254afdb6f 100644 --- a/src/test/interpreters/display.unit.test.ts +++ b/src/test/interpreters/display.unit.test.ts @@ -43,10 +43,6 @@ const info: PythonEnvironment = { sysPrefix: '', sysVersion: '', }; -import * as nls from 'vscode-nls'; - -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); -const localize: nls.LocalizeFunc = nls.loadMessageBundle(); suite('Interpreters Display', () => { let applicationShell: TypeMoq.IMock; @@ -216,11 +212,8 @@ suite('Interpreters Display', () => { await interpreterDisplay.refresh(resource); traceLogStub.calledOnceWithExactly( - localize( - 'Interpreters.pythonInterpreterPath', - 'Python interpreter path: {0}', - activeInterpreter.path, - ), + `Python interpreter path: ${activeInterpreter.path}`, + activeInterpreter.path, ); }); test('If interpreter is not identified then tooltip should point to python Path', async () => { From a0534b2584ecdafdc1bd637aa75e5bbfd4325f29 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 12:45:43 -0700 Subject: [PATCH 30/39] Test importing nls in other file --- .../diagnostics/checks/macPythonInterpreter.ts | 12 ++++++++++-- .../diagnostics/checks/pythonInterpreter.ts | 12 ++++++++++-- src/client/browser/extension.ts | 4 +--- src/client/browser/localize.ts | 2 +- src/client/common/experiments/service.ts | 2 +- src/client/common/installer/moduleInstaller.ts | 2 +- src/client/common/installer/productInstaller.ts | 2 +- src/client/common/net/fileDownloader.ts | 2 +- src/client/common/utils/localize.ts | 2 +- .../debugger/extension/attachQuickPick/provider.ts | 2 +- .../configuration/providers/pyramidLaunch.ts | 2 +- src/client/extension.ts | 4 +--- .../interpreterSelector/commands/setInterpreter.ts | 2 +- src/client/interpreter/display/index.ts | 2 +- src/client/languageServer/watcher.ts | 2 +- src/client/linters/linterCommands.ts | 2 +- src/client/tensorBoard/tensorBoardSession.ts | 2 +- src/client/tensorBoard/tensorBoardSessionProvider.ts | 2 +- src/setupNls.ts | 8 ++++++++ 19 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 src/setupNls.ts diff --git a/src/client/application/diagnostics/checks/macPythonInterpreter.ts b/src/client/application/diagnostics/checks/macPythonInterpreter.ts index 0e1e65300d09..a86ddcea6c90 100644 --- a/src/client/application/diagnostics/checks/macPythonInterpreter.ts +++ b/src/client/application/diagnostics/checks/macPythonInterpreter.ts @@ -5,6 +5,7 @@ import { inject, injectable } from 'inversify'; import { DiagnosticSeverity } from 'vscode'; import '../../../common/extensions'; +import * as nls from 'vscode-nls'; import { IPlatformService } from '../../../common/platform/types'; import { IConfigurationService, @@ -22,11 +23,18 @@ import { DiagnosticCodes } from '../constants'; import { DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from '../promptHandler'; import { DiagnosticScope, IDiagnostic, IDiagnosticCommand, IDiagnosticHandlerService } from '../types'; +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + const messages = { - [DiagnosticCodes.MacInterpreterSelectedAndHaveOtherInterpretersDiagnostic]: + [DiagnosticCodes.MacInterpreterSelectedAndHaveOtherInterpretersDiagnostic]: localize( + 'DiagnosticCodes.MacInterpreterSelectedAndHaveOtherInterpretersDiagnostic', 'You have selected the macOS system install of Python, which is not recommended for use with the Python extension. Some functionality will be limited, please select a different interpreter.', - [DiagnosticCodes.MacInterpreterSelectedAndNoOtherInterpretersDiagnostic]: + ), + [DiagnosticCodes.MacInterpreterSelectedAndNoOtherInterpretersDiagnostic]: localize( + 'DiagnosticCodes.MacInterpreterSelectedAndNoOtherInterpretersDiagnostic', 'The macOS system install of Python is not recommended, some functionality in the extension will be limited. Install another version of Python for the best experience.', + ), }; export class InvalidMacPythonInterpreterDiagnostic extends BaseDiagnostic { diff --git a/src/client/application/diagnostics/checks/pythonInterpreter.ts b/src/client/application/diagnostics/checks/pythonInterpreter.ts index f46d5247a24f..8202f6b809fc 100644 --- a/src/client/application/diagnostics/checks/pythonInterpreter.ts +++ b/src/client/application/diagnostics/checks/pythonInterpreter.ts @@ -5,6 +5,7 @@ import { inject, injectable } from 'inversify'; import { DiagnosticSeverity } from 'vscode'; import '../../../common/extensions'; +import * as nls from 'vscode-nls'; import { IConfigurationService, IDisposableRegistry, Resource } from '../../../common/types'; import { IInterpreterService } from '../../../interpreter/contracts'; import { IServiceContainer } from '../../../ioc/types'; @@ -22,11 +23,18 @@ import { IDiagnosticMessageOnCloseHandler, } from '../types'; +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + const messages = { - [DiagnosticCodes.NoPythonInterpretersDiagnostic]: + [DiagnosticCodes.NoPythonInterpretersDiagnostic]: localize( + 'DiagnosticCodes.NoPythonInterpretersDiagnostic', 'Python is not installed. Please download and install Python before using the extension.', - [DiagnosticCodes.NoCurrentlySelectedPythonInterpreterDiagnostic]: + ), + [DiagnosticCodes.NoCurrentlySelectedPythonInterpreterDiagnostic]: localize( + 'DiagnosticCodes.NoCurrentlySelectedPythonInterpreterDiagnostic', 'No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.', + ), }; export class InvalidPythonInterpreterDiagnostic extends BaseDiagnostic { diff --git a/src/client/browser/extension.ts b/src/client/browser/extension.ts index ecf52da2763b..c5df66441651 100644 --- a/src/client/browser/extension.ts +++ b/src/client/browser/extension.ts @@ -1,19 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +import '../../setupNls'; import * as vscode from 'vscode'; import TelemetryReporter from 'vscode-extension-telemetry'; import { LanguageClientOptions, State } from 'vscode-languageclient'; import { LanguageClient } from 'vscode-languageclient/browser'; -import * as nls from 'vscode-nls'; import { LanguageClientMiddlewareBase } from '../activation/languageClientMiddlewareBase'; import { LanguageServerType } from '../activation/types'; import { AppinsightsKey, PVSC_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../common/constants'; import { EventName } from '../telemetry/constants'; import { createStatusItem } from './intellisenseStatus'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); - interface BrowserConfig { distUrl: string; // URL to Pylance's dist folder. } diff --git a/src/client/browser/localize.ts b/src/client/browser/localize.ts index 7be89150867f..ce76f011d7f0 100644 --- a/src/client/browser/localize.ts +++ b/src/client/browser/localize.ts @@ -8,7 +8,7 @@ // IMPORTANT: Do not import any node fs related modules here, as they do not work in browser. import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export namespace LanguageService { diff --git a/src/client/common/experiments/service.ts b/src/client/common/experiments/service.ts index 40669a2395f3..541527a614df 100644 --- a/src/client/common/experiments/service.ts +++ b/src/client/common/experiments/service.ts @@ -14,7 +14,7 @@ import { PVSC_EXTENSION_ID } from '../constants'; import { IExperimentService, IPersistentStateFactory } from '../types'; import { ExperimentationTelemetry } from './telemetry'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const EXP_MEMENTO_KEY = 'VSCode.ABExp.FeatureData'; diff --git a/src/client/common/installer/moduleInstaller.ts b/src/client/common/installer/moduleInstaller.ts index f98c1e61a678..f1f36c2c3bc7 100644 --- a/src/client/common/installer/moduleInstaller.ts +++ b/src/client/common/installer/moduleInstaller.ts @@ -23,7 +23,7 @@ import { ProductNames } from './productNames'; import { IModuleInstaller, InstallOptions, InterpreterUri, ModuleInstallFlags } from './types'; import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index fc6ded667755..3d0a1f3f9b15 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -42,7 +42,7 @@ import { isParentPath } from '../platform/fs-paths'; export { Product } from '../types'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); // Products which may not be available to install from certain package registries, keyed by product name diff --git a/src/client/common/net/fileDownloader.ts b/src/client/common/net/fileDownloader.ts index 0f0c7340cc94..5d7cd099c95d 100644 --- a/src/client/common/net/fileDownloader.ts +++ b/src/client/common/net/fileDownloader.ts @@ -14,7 +14,7 @@ import { IFileSystem, WriteStream } from '../platform/types'; import { DownloadOptions, IFileDownloader, IHttpClient } from '../types'; import { noop } from '../utils/misc'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 1071a61de029..16e39b0f2e3f 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -5,7 +5,7 @@ import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ diff --git a/src/client/debugger/extension/attachQuickPick/provider.ts b/src/client/debugger/extension/attachQuickPick/provider.ts index d848fcc47f9e..bfd0842955fb 100644 --- a/src/client/debugger/extension/attachQuickPick/provider.ts +++ b/src/client/debugger/extension/attachQuickPick/provider.ts @@ -11,7 +11,7 @@ import { PsProcessParser } from './psProcessParser'; import { IAttachItem, IAttachProcessProvider, ProcessListCommand } from './types'; import { WmicProcessParser } from './wmicProcessParser'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts index 44e627e34123..739f4aa9301c 100644 --- a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts @@ -19,7 +19,7 @@ import { LaunchRequestArguments } from '../../../types'; import { DebugConfigurationState, DebugConfigurationType, IDebugConfigurationProvider } from '../../types'; import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const workspaceFolderToken = '${workspaceFolder}'; diff --git a/src/client/extension.ts b/src/client/extension.ts index 5cbd706dbfce..181315b7df5a 100644 --- a/src/client/extension.ts +++ b/src/client/extension.ts @@ -28,6 +28,7 @@ initializeFileLogging(logDispose); //=============================================== // loading starts here +import '../setupNls'; import { ProgressLocation, ProgressOptions, window } from 'vscode'; import { buildApi } from './api'; import { IApplicationShell, IWorkspaceService } from './common/application/types'; @@ -44,9 +45,6 @@ import { IInterpreterService } from './interpreter/contracts'; import { IExtensionApi, IProposedExtensionAPI } from './apiTypes'; import { buildProposedApi } from './proposedApi'; import { WorkspaceService } from './common/application/workspace'; -import * as nls from 'vscode-nls'; - -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); durations.codeLoadingTime = stopWatch.elapsedTime; diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index 4f494af62788..dcc4ad581f4b 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -35,7 +35,7 @@ import { } from '../../types'; import { BaseInterpreterSelectorCommand } from './base'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const untildify = require('untildify'); diff --git a/src/client/interpreter/display/index.ts b/src/client/interpreter/display/index.ts index 9cb6c73e85e8..a74de9e722a2 100644 --- a/src/client/interpreter/display/index.ts +++ b/src/client/interpreter/display/index.ts @@ -17,7 +17,7 @@ import { } from '../contracts'; import * as nls from 'vscode-nls'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /** diff --git a/src/client/languageServer/watcher.ts b/src/client/languageServer/watcher.ts index 0041f7f4f55f..91a48e1277ce 100644 --- a/src/client/languageServer/watcher.ts +++ b/src/client/languageServer/watcher.ts @@ -35,7 +35,7 @@ import { NoneLSExtensionManager } from './noneLSExtensionManager'; import { PylanceLSExtensionManager } from './pylanceLSExtensionManager'; import { ILanguageServerExtensionManager, ILanguageServerWatcher } from './types'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index b228b7176d23..7d76f4f471da 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -13,7 +13,7 @@ import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; import { ILinterManager, ILintingEngine, LinterId } from './types'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export class LinterCommands implements IDisposable { diff --git a/src/client/tensorBoard/tensorBoardSession.ts b/src/client/tensorBoard/tensorBoardSession.ts index a2889318d9f8..8be11e2213da 100644 --- a/src/client/tensorBoard/tensorBoardSession.ts +++ b/src/client/tensorBoard/tensorBoardSession.ts @@ -48,7 +48,7 @@ import { IMultiStepInputFactory } from '../common/utils/multiStepInput'; import { ModuleInstallFlags } from '../common/installer/types'; import { traceError, traceInfo } from '../logging'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); enum Messages { diff --git a/src/client/tensorBoard/tensorBoardSessionProvider.ts b/src/client/tensorBoard/tensorBoardSessionProvider.ts index ed4fce66d00f..624c29a59892 100644 --- a/src/client/tensorBoard/tensorBoardSessionProvider.ts +++ b/src/client/tensorBoard/tensorBoardSessionProvider.ts @@ -18,7 +18,7 @@ import { EventName } from '../telemetry/constants'; import { TensorBoardEntrypoint, TensorBoardEntrypointTrigger } from './constants'; import { TensorBoardSession } from './tensorBoardSession'; -nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const PREFERRED_VIEWGROUP = 'PythonTensorBoardWebviewPreferredViewGroup'; diff --git a/src/setupNls.ts b/src/setupNls.ts new file mode 100644 index 000000000000..22ece182e5ae --- /dev/null +++ b/src/setupNls.ts @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as nls from 'vscode-nls'; + +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone }); From 595ba8931408791e1cfebdd43f97c178626bf020 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 12:47:35 -0700 Subject: [PATCH 31/39] Fix comment in translations in tests --- src/test/common/installer/moduleInstaller.unit.test.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/test/common/installer/moduleInstaller.unit.test.ts b/src/test/common/installer/moduleInstaller.unit.test.ts index 5b302058e8c3..af0562b5ba13 100644 --- a/src/test/common/installer/moduleInstaller.unit.test.ts +++ b/src/test/common/installer/moduleInstaller.unit.test.ts @@ -12,7 +12,6 @@ import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import * as TypeMoq from 'typemoq'; import { CancellationTokenSource, Disposable, ProgressLocation, Uri, WorkspaceConfiguration } from 'vscode'; -import * as nls from 'vscode-nls'; import { IApplicationShell, IWorkspaceService } from '../../../client/common/application/types'; import { STANDARD_OUTPUT_CHANNEL } from '../../../client/common/constants'; import { CondaInstaller } from '../../../client/common/installer/condaInstaller'; @@ -45,8 +44,6 @@ import { IServiceContainer } from '../../../client/ioc/types'; import * as logging from '../../../client/logging'; import { EnvironmentType, ModuleInstallerType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; -const localize: nls.LocalizeFunc = nls.loadMessageBundle(); - const pythonPath = path.join(__dirname, 'python'); /* Complex test to ensure we cover all combinations: @@ -542,11 +539,7 @@ suite('Module Installer', () => { const options = { location: ProgressLocation.Notification, cancellable: true, - title: localize( - 'products.installingModule', - 'Installing {0}', - product.name, - ), + title: `Installing ${product.name}`, }; appShell .setup((a) => a.withProgress(TypeMoq.It.isAny(), TypeMoq.It.isAny())) From 663d108285317c10fc176a1488b2200014f7ac8f Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 13:33:42 -0700 Subject: [PATCH 32/39] Add missing translations --- .../common/installer/productInstaller.ts | 32 +++++++++++++------ src/client/linters/linterCommands.ts | 7 ++-- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index 3d0a1f3f9b15..9703dba57eb2 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -340,12 +340,17 @@ export class LinterInstaller extends BaseInstaller { const options = [selectLinter, doNotShowAgain]; - let message = `Linter ${productName} is not installed.`; + let message = localize('Linter.notInstalled', 'Linter {0} is not installed.', productName); if (this.isExecutableAModule(product, resource)) { options.splice(0, 0, install); } else { const executable = this.getExecutableNameFromSettings(product, resource); - message = `Path to the ${productName} linter is invalid (${executable})`; + message = localize( + 'Linter.invalidPath', + 'Path to the {0} linter is invalid ({1})', + productName, + executable, + ); } const response = await this.appShell.showErrorMessage(message, ...options); if (response === install) { @@ -400,16 +405,25 @@ export class TestFrameworkInstaller extends BaseInstaller { const productName = ProductNames.get(product)!; const options: string[] = []; - let message = `Test framework ${productName} is not installed. Install?`; + let message = localize( + 'TestFramework.notIstalled', + 'Test framework {0} is not installed. Install?', + productName, + ); if (this.isExecutableAModule(product, resource)) { - options.push(...['Yes', 'No']); + options.push(...[Common.bannerLabelYes, Common.bannerLabelNo]); } else { const executable = this.getExecutableNameFromSettings(product, resource); - message = `Path to the ${productName} test framework is invalid (${executable})`; + message = localize( + 'TestFramework.invalidPath', + 'Path to the {0} test framework is invalid ({1})', + productName, + executable, + ); } const item = await this.appShell.showErrorMessage(message, ...options); - return item === 'Yes' ? this.install(product, resource, cancel) : InstallerResponse.Ignore; + return item === Common.bannerLabelYes ? this.install(product, resource, cancel) : InstallerResponse.Ignore; } } @@ -567,10 +581,10 @@ export class DataScienceInstaller extends BaseInstaller { 'Data Science library {0} is not installed. Install?', productName, ), - 'Yes', - 'No', + Common.bannerLabelYes, + Common.bannerLabelNo, ); - if (item === 'Yes') { + if (item === Common.bannerLabelYes) { return this.install(product, resource, cancel); } return InstallerResponse.Ignore; diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index 7d76f4f471da..0c5182f01a9b 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -8,6 +8,7 @@ import * as nls from 'vscode-nls'; import { IApplicationShell, ICommandManager, IDocumentManager } from '../common/application/types'; import { Commands } from '../common/constants'; import { IDisposable } from '../common/types'; +import { Common } from '../common/utils/localize'; import { IServiceContainer } from '../ioc/types'; import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; @@ -79,10 +80,10 @@ export class LinterCommands implements IDisposable { "Multiple linters are enabled in settings. Replace with '{0}'?", selection, ), - 'Yes', - 'No', + Common.bannerLabelYes, + Common.bannerLabelNo, ); - if (response !== 'Yes') { + if (response !== Common.bannerLabelYes) { return; } } From 6cd92df7b61713649db563202853859724fa5537 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 13:36:02 -0700 Subject: [PATCH 33/39] Remove nls config in all files --- .../application/diagnostics/checks/macPythonInterpreter.ts | 1 - src/client/application/diagnostics/checks/pythonInterpreter.ts | 1 - src/client/browser/localize.ts | 1 - src/client/common/experiments/service.ts | 1 - src/client/common/installer/moduleInstaller.ts | 1 - src/client/common/installer/productInstaller.ts | 1 - src/client/common/net/fileDownloader.ts | 1 - src/client/common/utils/localize.ts | 1 - src/client/debugger/extension/attachQuickPick/provider.ts | 1 - .../debugger/extension/configuration/providers/pyramidLaunch.ts | 1 - .../configuration/interpreterSelector/commands/setInterpreter.ts | 1 - src/client/interpreter/display/index.ts | 1 - src/client/languageServer/watcher.ts | 1 - src/client/linters/linterCommands.ts | 1 - src/client/tensorBoard/tensorBoardSession.ts | 1 - src/client/tensorBoard/tensorBoardSessionProvider.ts | 1 - 16 files changed, 16 deletions(-) diff --git a/src/client/application/diagnostics/checks/macPythonInterpreter.ts b/src/client/application/diagnostics/checks/macPythonInterpreter.ts index a86ddcea6c90..d1bebed87ab7 100644 --- a/src/client/application/diagnostics/checks/macPythonInterpreter.ts +++ b/src/client/application/diagnostics/checks/macPythonInterpreter.ts @@ -23,7 +23,6 @@ import { DiagnosticCodes } from '../constants'; import { DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from '../promptHandler'; import { DiagnosticScope, IDiagnostic, IDiagnosticCommand, IDiagnosticHandlerService } from '../types'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const messages = { diff --git a/src/client/application/diagnostics/checks/pythonInterpreter.ts b/src/client/application/diagnostics/checks/pythonInterpreter.ts index 8202f6b809fc..075dc05451df 100644 --- a/src/client/application/diagnostics/checks/pythonInterpreter.ts +++ b/src/client/application/diagnostics/checks/pythonInterpreter.ts @@ -23,7 +23,6 @@ import { IDiagnosticMessageOnCloseHandler, } from '../types'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const messages = { diff --git a/src/client/browser/localize.ts b/src/client/browser/localize.ts index ce76f011d7f0..24f2cde53c9a 100644 --- a/src/client/browser/localize.ts +++ b/src/client/browser/localize.ts @@ -8,7 +8,6 @@ // IMPORTANT: Do not import any node fs related modules here, as they do not work in browser. import * as nls from 'vscode-nls'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export namespace LanguageService { diff --git a/src/client/common/experiments/service.ts b/src/client/common/experiments/service.ts index 541527a614df..75fff9bbcd11 100644 --- a/src/client/common/experiments/service.ts +++ b/src/client/common/experiments/service.ts @@ -14,7 +14,6 @@ import { PVSC_EXTENSION_ID } from '../constants'; import { IExperimentService, IPersistentStateFactory } from '../types'; import { ExperimentationTelemetry } from './telemetry'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const EXP_MEMENTO_KEY = 'VSCode.ABExp.FeatureData'; diff --git a/src/client/common/installer/moduleInstaller.ts b/src/client/common/installer/moduleInstaller.ts index f1f36c2c3bc7..276ce9fc73cb 100644 --- a/src/client/common/installer/moduleInstaller.ts +++ b/src/client/common/installer/moduleInstaller.ts @@ -23,7 +23,6 @@ import { ProductNames } from './productNames'; import { IModuleInstaller, InstallOptions, InterpreterUri, ModuleInstallFlags } from './types'; import * as nls from 'vscode-nls'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index 9703dba57eb2..223769842101 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -42,7 +42,6 @@ import { isParentPath } from '../platform/fs-paths'; export { Product } from '../types'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); // Products which may not be available to install from certain package registries, keyed by product name diff --git a/src/client/common/net/fileDownloader.ts b/src/client/common/net/fileDownloader.ts index 5d7cd099c95d..5c54ae247911 100644 --- a/src/client/common/net/fileDownloader.ts +++ b/src/client/common/net/fileDownloader.ts @@ -14,7 +14,6 @@ import { IFileSystem, WriteStream } from '../platform/types'; import { DownloadOptions, IFileDownloader, IHttpClient } from '../types'; import { noop } from '../utils/misc'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 16e39b0f2e3f..c58011adf004 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -5,7 +5,6 @@ import * as nls from 'vscode-nls'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /* eslint-disable @typescript-eslint/no-namespace, no-shadow */ diff --git a/src/client/debugger/extension/attachQuickPick/provider.ts b/src/client/debugger/extension/attachQuickPick/provider.ts index bfd0842955fb..26bb80067f93 100644 --- a/src/client/debugger/extension/attachQuickPick/provider.ts +++ b/src/client/debugger/extension/attachQuickPick/provider.ts @@ -11,7 +11,6 @@ import { PsProcessParser } from './psProcessParser'; import { IAttachItem, IAttachProcessProvider, ProcessListCommand } from './types'; import { WmicProcessParser } from './wmicProcessParser'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts index 739f4aa9301c..04233df11039 100644 --- a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts @@ -19,7 +19,6 @@ import { LaunchRequestArguments } from '../../../types'; import { DebugConfigurationState, DebugConfigurationType, IDebugConfigurationProvider } from '../../types'; import * as nls from 'vscode-nls'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const workspaceFolderToken = '${workspaceFolder}'; diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index dcc4ad581f4b..89b22e16a37f 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -35,7 +35,6 @@ import { } from '../../types'; import { BaseInterpreterSelectorCommand } from './base'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const untildify = require('untildify'); diff --git a/src/client/interpreter/display/index.ts b/src/client/interpreter/display/index.ts index a74de9e722a2..7c9c8bac47cd 100644 --- a/src/client/interpreter/display/index.ts +++ b/src/client/interpreter/display/index.ts @@ -17,7 +17,6 @@ import { } from '../contracts'; import * as nls from 'vscode-nls'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); /** diff --git a/src/client/languageServer/watcher.ts b/src/client/languageServer/watcher.ts index 91a48e1277ce..43ba059ec17a 100644 --- a/src/client/languageServer/watcher.ts +++ b/src/client/languageServer/watcher.ts @@ -35,7 +35,6 @@ import { NoneLSExtensionManager } from './noneLSExtensionManager'; import { PylanceLSExtensionManager } from './pylanceLSExtensionManager'; import { ILanguageServerExtensionManager, ILanguageServerWatcher } from './types'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); @injectable() diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index 0c5182f01a9b..0f2b1f6fea96 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -14,7 +14,6 @@ import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; import { ILinterManager, ILintingEngine, LinterId } from './types'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); export class LinterCommands implements IDisposable { diff --git a/src/client/tensorBoard/tensorBoardSession.ts b/src/client/tensorBoard/tensorBoardSession.ts index 8be11e2213da..e5bd67c94f6b 100644 --- a/src/client/tensorBoard/tensorBoardSession.ts +++ b/src/client/tensorBoard/tensorBoardSession.ts @@ -48,7 +48,6 @@ import { IMultiStepInputFactory } from '../common/utils/multiStepInput'; import { ModuleInstallFlags } from '../common/installer/types'; import { traceError, traceInfo } from '../logging'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); enum Messages { diff --git a/src/client/tensorBoard/tensorBoardSessionProvider.ts b/src/client/tensorBoard/tensorBoardSessionProvider.ts index 624c29a59892..c71be0b782ac 100644 --- a/src/client/tensorBoard/tensorBoardSessionProvider.ts +++ b/src/client/tensorBoard/tensorBoardSessionProvider.ts @@ -18,7 +18,6 @@ import { EventName } from '../telemetry/constants'; import { TensorBoardEntrypoint, TensorBoardEntrypointTrigger } from './constants'; import { TensorBoardSession } from './tensorBoardSession'; -// nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const PREFERRED_VIEWGROUP = 'PythonTensorBoardWebviewPreferredViewGroup'; From d6e15632fe86560c457139f9cdb9da558ea338fc Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Mon, 25 Apr 2022 16:08:10 -0700 Subject: [PATCH 34/39] Add location steps in the stable pipeline --- build/azure-pipeline.pre-release.yml | 1 + build/azure-pipeline.stable.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 7754c51b0571..5f683b86b2bf 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -33,6 +33,7 @@ extends: - script: npm ci displayName: Install NPM dependencies - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" + displayName: Run translations-import - script: gulp translations-generate displayName: Generate translations diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index daeae384fa32..427eed19b0ce 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -24,6 +24,23 @@ extends: template: azure-pipelines/extension/stable.yml@templates parameters: publishExtension: ${{ parameters.publishExtension }} + + locPushSteps: + - script: npm ci + displayName: Install NPM dependencies + - script: npm run translations-export + displayName: Run translations-export + - pwsh: Move-Item "$(Pipeline.Workspace)/ms-python.python/*" "$(SetTranslationsPath.EnglishStrings)" -Force + displayName: Move vscode-python-translations-export to translations path + + locPullSteps: + - script: npm ci + displayName: Install NPM dependencies + - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" + displayName: Run translations-import + - script: gulp translations-generate + displayName: Generate translations + buildSteps: - task: NodeTool@0 inputs: From 7c9bcf79c8b1de9015d0b6e1d42baf02758f3b5c Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Tue, 3 May 2022 13:55:34 -0700 Subject: [PATCH 35/39] Using new vscode-engineering feature to abstract away gulp (#19063) * try new format * remove nls gulp stuff * back on main * maybe use ../../ * try this * try setting to where bundles are * try new locBundleDestination * try another * try just src * try * try root dir --- build/azure-pipeline.pre-release.yml | 20 +- build/azure-pipeline.stable.yml | 16 +- build/webpack/webpack.extension.config.js | 3 +- gulpfile.js | 124 ---- package-lock.json | 667 +--------------------- package.json | 6 +- 6 files changed, 13 insertions(+), 823 deletions(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 5f683b86b2bf..9143bc01d1be 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -15,28 +15,14 @@ resources: - repository: templates type: github name: microsoft/vscode-engineering - ref: main + ref: tyler/allow-bundle-destination endpoint: Monaco extends: template: azure-pipelines/extension/pre-release.yml@templates parameters: - locPushSteps: - - script: npm ci - displayName: Install NPM dependencies - - script: npm run translations-export - displayName: Run translations-export - - pwsh: Move-Item "$(Pipeline.Workspace)/ms-python.python/*" "$(SetTranslationsPath.EnglishStrings)" -Force - displayName: Move vscode-python-translations-export to translations path - - locPullSteps: - - script: npm ci - displayName: Install NPM dependencies - - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" - displayName: Run translations-import - - script: gulp translations-generate - displayName: Generate translations - + locTsConfigs: $(Build.SourcesDirectory)/tsconfig.json + locBundleDestination: $(Build.SourcesDirectory)/out/client buildSteps: - task: NodeTool@0 inputs: diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index 427eed19b0ce..577a35dff16b 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -25,21 +25,7 @@ extends: parameters: publishExtension: ${{ parameters.publishExtension }} - locPushSteps: - - script: npm ci - displayName: Install NPM dependencies - - script: npm run translations-export - displayName: Run translations-export - - pwsh: Move-Item "$(Pipeline.Workspace)/ms-python.python/*" "$(SetTranslationsPath.EnglishStrings)" -Force - displayName: Move vscode-python-translations-export to translations path - - locPullSteps: - - script: npm ci - displayName: Install NPM dependencies - - script: gulp translations-import --location "$(SetTranslationsPath.TranslatedStrings)" - displayName: Run translations-import - - script: gulp translations-generate - displayName: Generate translations + locTsConfigs: $(Build.SourcesDirectory)/tsconfig.json buildSteps: - task: NodeTool@0 diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index 5b6a1b72eeb5..24c6a8d56109 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -29,8 +29,7 @@ const config = { { loader: 'vscode-nls-dev/lib/webpack-loader', options: { - // points to where the entrypoint is (the extension.ts) - base: path.join(__dirname, '../../src/client'), + base: constants.ExtensionRootDir, }, }, { diff --git a/gulpfile.js b/gulpfile.js index e79abcffe937..2949490abd66 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,14 +21,9 @@ const flat = require('flat'); const { argv } = require('yargs'); const os = require('os'); const rmrf = require('rimraf'); -const nls = require('vscode-nls-dev'); -const sourcemaps = require('gulp-sourcemaps'); const typescript = require('typescript'); -const es = require('event-stream'); -const minimist = require('minimist'); const tsProject = ts.createProject('./tsconfig.json', { typescript }); -const filter = require('gulp-filter'); const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined; @@ -360,122 +355,3 @@ function hasNativeDependencies() { } return false; } - -const translationProjectName = 'ms-python.python'; -const translationExtensionName = 'vscode-python'; - -const defaultLanguages = [ - { id: 'de', folderName: 'de' }, - { id: 'fr', folderName: 'fr' }, - { id: 'es', folderName: 'es' }, - { id: 'cs', folderName: 'cs' }, - { id: 'it', folderName: 'it' }, - { id: 'ja', folderName: 'ja' }, - { id: 'ko', folderName: 'ko' }, - { id: 'pl', folderName: 'pl' }, - { id: 'pt-BR', folderName: 'pt-br' }, - { id: 'ru', folderName: 'ru' }, - { id: 'tr', folderName: 'tr' }, - { id: 'zh-Hans', folderName: 'zh-Hans' }, - { id: 'zh-Hant', folderName: 'zh-Hant' }, - { id: 'qps-ploc', folderName: 'qps-ploc' }, -]; - -// You can find a more complex implementation of the translations in the CPP Extension repository. -// See: https://github.com/microsoft/vscode-cpptools/blob/main/Extension/gulpfile.js#L76 - -// **************************** -// Command: translations-generate -// The following is used to import an i18n directory structure and generate files used at runtime. -// **************************** - -// Generate package.nls.*.json files from: ./i18n/*/package.i18n.json -// Outputs to root path, as these nls files need to be along side package.json - -const generateAdditionalLocFiles = () => - gulp - .src(['package.nls.json']) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) - .pipe(gulp.dest('.')); - -// Generates ./out/nls.bundle..json from files in ./i18n/** *///.i18n.json -// Localized strings are read from these files at runtime. -const generateSrcLocBundle = () => - // Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize. - tsProject - .src() - .pipe(sourcemaps.init()) - .pipe(tsProject()) - .js.pipe(nls.createMetaDataFiles()) - .pipe(nls.createAdditionalLanguageFiles(defaultLanguages, 'i18n')) - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', 'out')) - .pipe(nls.bundleLanguageFiles()) - .pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json'])) - .pipe(gulp.dest('out')); - -gulp.task('translations-generate', gulp.series(generateSrcLocBundle, generateAdditionalLocFiles)); - -// **************************** -// Command: translations-export -// The following is used to export and XLF file containing english strings for translations. -// The result will be written to: ../vscode-extensions-localization-export/ms-vscode/ -// **************************** -const exportTranslations = (done) => { - const jsStream = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()).js.pipe(nls.createMetaDataFiles()); - - // Merge files from all source streams - jsStream - - // Filter down to only the files we need - .pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json'])) - - // Consoldate them into nls.metadata.json, which the xlf is built from. - .pipe(nls.bundleMetaDataFiles('ms-vscode.python', '.')) - - // filter down to just the resulting metadata files - .pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json'])) - - // Add package.nls.json, used to localized package.json - .pipe(gulp.src(['package.nls.json'])) - - // package.nls.json and nls.metadata.json are used to generate the xlf file - // Does not re-queue any files to the stream. Outputs only the XLF file - .pipe(nls.createXlfFiles(translationProjectName, translationExtensionName)) - .pipe(gulp.dest('../')) - .pipe( - es.wait(() => { - done(); - }), - ); -}; - -gulp.task('translations-export', exportTranslations); - -// **************************** -// Command: translations-import -// The following is used to import an XLF file containing all language strings. -// This results in a i18n directory, which should be checked in. -// **************************** - -// Imports translations from raw localized MLCP strings to VS Code .i18n.json files -gulp.task('translations-import', (done) => { - const options = minimist(process.argv.slice(2), { - string: 'location', - default: { - location: '../vscode-translations-import', - }, - }); - es.merge( - defaultLanguages.map((language) => { - const id = language.transifexId || language.id; - return gulp - .src(path.join(options.location, id, `${translationExtensionName}.xlf`)) - .pipe(nls.prepareJsonFiles()) - .pipe(gulp.dest(path.join('./i18n', language.folderName))); - }), - ).pipe( - es.wait(() => { - done(); - }), - ); -}); diff --git a/package-lock.json b/package-lock.json index 63598ca242e6..ecbe553fa057 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "vscode-languageclient": "8.0.0-next.13", "vscode-languageserver": "8.0.0-next.9", "vscode-languageserver-protocol": "3.17.0-next.15", - "vscode-nls": "^5.0.0", + "vscode-nls": "^5.0.1", "vscode-tas-client": "^0.1.22", "winreg": "^1.2.4", "xml2js": "^0.4.19" @@ -87,15 +87,11 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.0", - "event-stream": "^4.0.1", "expose-loader": "^3.1.0", "flat": "^5.0.2", "get-port": "^5.1.1", "gulp": "^4.0.0", - "gulp-filter": "^7.0.0", - "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^5.0.0", - "minimist": "^1.2.6", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.1.7", @@ -302,69 +298,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@gulp-sourcemaps/identity-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", - "integrity": "sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q==", - "dev": true, - "dependencies": { - "acorn": "^6.4.1", - "normalize-path": "^3.0.0", - "postcss": "^7.0.16", - "source-map": "^0.6.0", - "through2": "^3.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/@gulp-sourcemaps/identity-map/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/@gulp-sourcemaps/identity-map/node_modules/through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" - } - }, - "node_modules/@gulp-sourcemaps/map-sources": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", - "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", - "dev": true, - "dependencies": { - "normalize-path": "^2.0.1", - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -1652,15 +1585,6 @@ "node": ">=6" } }, - "node_modules/array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -1816,15 +1740,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -3513,28 +3428,6 @@ "node": "*" } }, - "node_modules/css": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", - "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "source-map": "^0.6.1", - "source-map-resolve": "^0.6.0" - } - }, - "node_modules/css/node_modules/source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" - } - }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -3577,26 +3470,6 @@ "ms": "2.0.0" } }, - "node_modules/debug-fabulous": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", - "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", - "dev": true, - "dependencies": { - "debug": "3.X", - "memoizee": "0.4.X", - "object-assign": "4.X" - } - }, - "node_modules/debug-fabulous/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/debug/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -4024,15 +3897,6 @@ "node": ">=0.10" } }, - "node_modules/detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -5257,31 +5121,6 @@ "node": ">=0.10.0" } }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/event-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", - "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", - "dev": true, - "dependencies": { - "duplexer": "^0.1.1", - "from": "^0.1.7", - "map-stream": "0.0.7", - "pause-stream": "^0.0.11", - "split": "^1.0.1", - "stream-combiner": "^0.2.2", - "through": "^2.3.8" - } - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -6709,66 +6548,6 @@ "node": ">= 0.10" } }, - "node_modules/gulp-filter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz", - "integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==", - "dev": true, - "dependencies": { - "multimatch": "^5.0.0", - "plugin-error": "^1.0.1", - "streamfilter": "^3.0.0", - "to-absolute-glob": "^2.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - }, - "peerDependencies": { - "gulp": ">=4" - }, - "peerDependenciesMeta": { - "gulp": { - "optional": true - } - } - }, - "node_modules/gulp-sourcemaps": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz", - "integrity": "sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ==", - "dev": true, - "dependencies": { - "@gulp-sourcemaps/identity-map": "^2.0.1", - "@gulp-sourcemaps/map-sources": "^1.0.0", - "acorn": "^6.4.1", - "convert-source-map": "^1.0.0", - "css": "^3.0.0", - "debug-fabulous": "^1.0.0", - "detect-newline": "^2.0.0", - "graceful-fs": "^4.0.0", - "source-map": "^0.6.0", - "strip-bom-string": "^1.0.0", - "through2": "^2.0.0" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/gulp-sourcemaps/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/gulp-typescript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.1.tgz", @@ -7756,12 +7535,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -8905,15 +8678,6 @@ "node": ">=10" } }, - "node_modules/lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", - "dev": true, - "dependencies": { - "es5-ext": "~0.10.2" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -9073,22 +8837,6 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, - "node_modules/memoizee": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", - "dev": true, - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.53", - "es6-weak-map": "^2.0.3", - "event-emitter": "^0.3.5", - "is-promise": "^2.2.2", - "lru-queue": "^0.1.0", - "next-tick": "^1.1.0", - "timers-ext": "^0.1.7" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -9704,37 +9452,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/multimatch": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", - "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", - "dev": true, - "dependencies": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/multimatch/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/mute-stdout": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", @@ -9808,12 +9525,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -10989,29 +10700,6 @@ "node": ">=0.10.0" } }, - "node_modules/postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "dev": true, - "dependencies": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "node_modules/postcss/node_modules/picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true - }, "node_modules/postinstall-build": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/postinstall-build/-/postinstall-build-5.0.3.tgz", @@ -12622,32 +12310,6 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, - "node_modules/streamfilter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz", - "integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==", - "dev": true, - "dependencies": { - "readable-stream": "^3.0.6" - }, - "engines": { - "node": ">=8.12.0" - } - }, - "node_modules/streamfilter/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -12770,15 +12432,6 @@ "node": ">=0.10.0" } }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -13173,16 +12826,6 @@ "node": ">=0.6.0" } }, - "node_modules/timers-ext": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", - "dev": true, - "dependencies": { - "es5-ext": "~0.10.46", - "next-tick": "1" - } - }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -14463,9 +14106,9 @@ "integrity": "sha512-Mwj+FemiEk4QUUms1GGvXwDC+laJGVFuA4glbMVJTxfXdfOFZaEuyVlLobjccBo+NzD+5oEzzejTX7nWGNajjQ==" }, "node_modules/vscode-nls": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz", - "integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.1.tgz", + "integrity": "sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A==" }, "node_modules/vscode-nls-dev": { "version": "4.0.0", @@ -15605,58 +15248,6 @@ } } }, - "@gulp-sourcemaps/identity-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz", - "integrity": "sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q==", - "dev": true, - "requires": { - "acorn": "^6.4.1", - "normalize-path": "^3.0.0", - "postcss": "^7.0.16", - "source-map": "^0.6.0", - "through2": "^3.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - }, - "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" - } - } - } - }, - "@gulp-sourcemaps/map-sources": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", - "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", - "dev": true, - "requires": { - "normalize-path": "^2.0.1", - "through2": "^2.0.3" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, "@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -16703,12 +16294,6 @@ "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, "array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -16822,12 +16407,6 @@ "es-abstract": "^1.19.0" } }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -18197,29 +17776,6 @@ "randomfill": "^1.0.3" } }, - "css": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", - "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "source-map": "^0.6.1", - "source-map-resolve": "^0.6.0" - }, - "dependencies": { - "source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" - } - } - } - }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -18267,28 +17823,6 @@ } } }, - "debug-fabulous": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.1.0.tgz", - "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", - "dev": true, - "requires": { - "debug": "3.X", - "memoizee": "0.4.X", - "object-assign": "4.X" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -18620,12 +18154,6 @@ "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -19594,31 +19122,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "event-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", - "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "from": "^0.1.7", - "map-stream": "0.0.7", - "pause-stream": "^0.0.11", - "split": "^1.0.1", - "stream-combiner": "^0.2.2", - "through": "^2.3.8" - } - }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -20821,45 +20324,6 @@ } } }, - "gulp-filter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz", - "integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==", - "dev": true, - "requires": { - "multimatch": "^5.0.0", - "plugin-error": "^1.0.1", - "streamfilter": "^3.0.0", - "to-absolute-glob": "^2.0.2" - } - }, - "gulp-sourcemaps": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz", - "integrity": "sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ==", - "dev": true, - "requires": { - "@gulp-sourcemaps/identity-map": "^2.0.1", - "@gulp-sourcemaps/map-sources": "^1.0.0", - "acorn": "^6.4.1", - "convert-source-map": "^1.0.0", - "css": "^3.0.0", - "debug-fabulous": "^1.0.0", - "detect-newline": "^2.0.0", - "graceful-fs": "^4.0.0", - "source-map": "^0.6.0", - "strip-bom-string": "^1.0.0", - "through2": "^2.0.0" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - } - } - }, "gulp-typescript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.1.tgz", @@ -21531,12 +20995,6 @@ "isobject": "^3.0.1" } }, - "is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true - }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -22455,15 +21913,6 @@ "yallist": "^4.0.0" } }, - "lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", - "dev": true, - "requires": { - "es5-ext": "~0.10.2" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -22599,22 +22048,6 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, - "memoizee": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", - "dev": true, - "requires": { - "d": "^1.0.1", - "es5-ext": "^0.10.53", - "es6-weak-map": "^2.0.3", - "event-emitter": "^0.3.5", - "is-promise": "^2.2.2", - "lru-queue": "^0.1.0", - "next-tick": "^1.1.0", - "timers-ext": "^0.1.7" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -23066,30 +22499,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "multimatch": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", - "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, "mute-stdout": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", @@ -23157,12 +22566,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -24093,24 +23496,6 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "dev": true, - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - }, - "dependencies": { - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true - } - } - }, "postinstall-build": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/postinstall-build/-/postinstall-build-5.0.3.tgz", @@ -25380,28 +24765,6 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, - "streamfilter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz", - "integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==", - "dev": true, - "requires": { - "readable-stream": "^3.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -25499,12 +24862,6 @@ "is-utf8": "^0.2.0" } }, - "strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", - "dev": true - }, "strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -25816,16 +25173,6 @@ "setimmediate": "^1.0.4" } }, - "timers-ext": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", - "dev": true, - "requires": { - "es5-ext": "~0.10.46", - "next-tick": "1" - } - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -26842,9 +26189,9 @@ "integrity": "sha512-Mwj+FemiEk4QUUms1GGvXwDC+laJGVFuA4glbMVJTxfXdfOFZaEuyVlLobjccBo+NzD+5oEzzejTX7nWGNajjQ==" }, "vscode-nls": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz", - "integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.1.tgz", + "integrity": "sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A==" }, "vscode-nls-dev": { "version": "4.0.0", diff --git a/package.json b/package.json index cb519c620d1e..67284eadfde7 100644 --- a/package.json +++ b/package.json @@ -1862,7 +1862,7 @@ "vscode-languageclient": "8.0.0-next.13", "vscode-languageserver": "8.0.0-next.9", "vscode-languageserver-protocol": "3.17.0-next.15", - "vscode-nls": "^5.0.0", + "vscode-nls": "^5.0.1", "vscode-tas-client": "^0.1.22", "winreg": "^1.2.4", "xml2js": "^0.4.19" @@ -1908,15 +1908,11 @@ "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.0", - "event-stream": "^4.0.1", "expose-loader": "^3.1.0", "flat": "^5.0.2", "get-port": "^5.1.1", "gulp": "^4.0.0", - "gulp-filter": "^7.0.0", - "gulp-sourcemaps": "^3.0.0", "gulp-typescript": "^5.0.0", - "minimist": "^1.2.6", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.1.7", From 59706af3fef38d1f057a8eb0d470c2d01f750a26 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Tue, 3 May 2022 17:05:27 -0700 Subject: [PATCH 36/39] Add i18n to vscodeignore --- .vscodeignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscodeignore b/.vscodeignore index ee4685d9067b..cc0c255eb3d5 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -45,6 +45,7 @@ debug_coverage*/** images/**/*.gif images/**/*.png ipywidgets/** +i18n/** news/** node_modules/** obj/** From 3cb9db80b9b01636bbf8d2dceb479ea4edfe933c Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Tue, 3 May 2022 17:19:14 -0700 Subject: [PATCH 37/39] Clean Code --- package.json | 4 +--- package.nls.json | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 37f21bdf5247..a5c09a34c4bf 100644 --- a/package.json +++ b/package.json @@ -1734,10 +1734,8 @@ "scripts": { "package": "gulp clean && gulp prePublishBundle && vsce package -o ms-python-insiders.vsix", "prePublish": "gulp clean && gulp prePublishNonBundle", - "compile": "gulp translations-generate && tsc -watch -p ./", + "compile": "tsc -watch -p ./", "compiled": "deemon npm run compile", - "translations-export": "gulp clean && gulp prePublishNonBundle && gulp translations-export", - "translations-import": "gulp clean && gulp prePublishNonBundle && gulp translations-import", "kill-compiled": "deemon --kill npm run compile", "checkDependencies": "gulp checkDependencies", "test": "node ./out/test/standardTest.js && node ./out/test/multiRootTest.js", diff --git a/package.nls.json b/package.nls.json index 6618d20373c0..361611c7c25c 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,18 +1,18 @@ { + "python.command.python.sortImports.title": "Sort Imports", + "python.command.python.startREPL.title": "Start REPL", + "python.command.python.createTerminal.title": "Create Terminal", "python.command.python.createNewFile.title": "New Python File", "python.command.python.execInTerminal.title": "Run Python File in Terminal", "python.command.python.debugInTerminal.title": "Debug Python File", "python.command.python.execInTerminalIcon.title": "Run Python File", "python.command.python.setInterpreter.title": "Select Interpreter", - "python.command.python.analysis.restartLanguageServer.title": "Restart Language Server", - "python.command.python.clearPersistentStorage.title": "Clear Internal Extension Cache", "python.command.python.clearWorkspaceInterpreter.title": "Clear Workspace Interpreter Setting", + "python.command.python.viewOutput.title": "Show Output", + "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", "python.command.python.configureTests.title": "Configure Tests", - "python.command.python.createTerminal.title": "Create Terminal", - "python.command.python.enableLinting.title": "Enable/Disable Linting", - "python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging", - "python.command.python.launchTensorBoard.title": "Launch TensorBoard", - "python.command.python.refreshTensorBoard.title": "Refresh TensorBoard", + "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", + "python.command.python.refreshTests.title": "Refresh Tests", "python.command.python.refreshingTests.title": "Refreshing Tests", "python.command.python.stopRefreshingTests.title": "Stop Refreshing Tests", @@ -20,15 +20,13 @@ "python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell", "python.command.python.goToPythonObject.title": "Go to Python Object", "python.command.python.reportIssue.title": "Report Issue...", - "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", - "python.command.python.runLinting.title": "Run Linting", - "python.menu.createNewFile.title": "Python File", "python.command.python.setLinter.title": "Select Linter", - "python.command.python.sortImports.title": "Sort Imports", - "python.command.python.startREPL.title": "Start REPL", - "python.command.python.switchOffInsidersChannel.title": "Switch to Default Channel", - "python.command.python.switchToDailyChannel.title": "Switch to Insiders Daily Channel", - "python.command.python.switchToWeeklyChannel.title": "Switch to Insiders Weekly Channel", - "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", - "python.command.python.viewOutput.title": "Show Output" + "python.command.python.enableLinting.title": "Enable/Disable Linting", + "python.command.python.runLinting.title": "Run Linting", + "python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging", + "python.command.python.clearPersistentStorage.title": "Clear Internal Extension Cache", + "python.command.python.analysis.restartLanguageServer.title": "Restart Language Server", + "python.command.python.launchTensorBoard.title": "Launch TensorBoard", + "python.command.python.refreshTensorBoard.title": "Refresh TensorBoard", + "python.menu.createNewFile.title": "Python File" } From fc15653e8bf796509273ebd3734859244265384d Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Tue, 3 May 2022 17:23:49 -0700 Subject: [PATCH 38/39] Remove old translations --- package.nls.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.nls.json b/package.nls.json index 361611c7c25c..e52df951c462 100644 --- a/package.nls.json +++ b/package.nls.json @@ -12,10 +12,6 @@ "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", "python.command.python.configureTests.title": "Configure Tests", "python.command.testing.rerunFailedTests.title": "Rerun Failed Tests", - - "python.command.python.refreshTests.title": "Refresh Tests", - "python.command.python.refreshingTests.title": "Refreshing Tests", - "python.command.python.stopRefreshingTests.title": "Stop Refreshing Tests", "python.command.python.execSelectionInTerminal.title": "Run Selection/Line in Python Terminal", "python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell", "python.command.python.goToPythonObject.title": "Go to Python Object", From c413d157fd304fa45b9299163a127aa931b3a529 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 4 May 2022 07:11:07 -0700 Subject: [PATCH 39/39] update templates to main --- build/azure-pipeline.pre-release.yml | 2 +- build/azure-pipeline.stable.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index 9143bc01d1be..a609b8c58ead 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -15,7 +15,7 @@ resources: - repository: templates type: github name: microsoft/vscode-engineering - ref: tyler/allow-bundle-destination + ref: main endpoint: Monaco extends: diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index 577a35dff16b..df249bb89c10 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -26,6 +26,7 @@ extends: publishExtension: ${{ parameters.publishExtension }} locTsConfigs: $(Build.SourcesDirectory)/tsconfig.json + locBundleDestination: $(Build.SourcesDirectory)/out/client buildSteps: - task: NodeTool@0