From 7d43f741c241ff449a170d56a34712af92fbf848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 14:17:14 +0200 Subject: [PATCH 01/55] arm64 build pipeline --- .../linux/product-build-linux.yml | 33 +++++++----- build/azure-pipelines/linux/publish.sh | 51 ++++++++++--------- build/azure-pipelines/product-build.yml | 10 +++- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 21d963042c8afd..2651a0e3fe5b30 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -3,6 +3,7 @@ steps: mkdir -p .build echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality + echo -n $VSCODE_ARCH > .build/arch displayName: Prepare cache flag - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 @@ -54,19 +55,19 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' - script: | set -e - CHILD_CONCURRENCY=1 yarn --frozen-lockfile + CHILD_CONCURRENCY=1 yarn --frozen-lockfile --arch=$(VSCODE_ARCH) displayName: Install dependencies condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) @@ -85,30 +86,30 @@ steps: - script: | set -e VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ - yarn gulp vscode-linux-x64-min-ci + yarn gulp vscode-linux-$(VSCODE_ARCH)-min-ci VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ - yarn gulp vscode-reh-linux-x64-min-ci + yarn gulp vscode-reh-linux-$(VSCODE_ARCH)-min-ci VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ - yarn gulp vscode-reh-web-linux-x64-min-ci + yarn gulp vscode-reh-web-linux-$(VSCODE_ARCH)-min-ci displayName: Build - script: | set -e service xvfb start displayName: Start xvfb - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests" displayName: Run unit tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e DISPLAY=:10 yarn test-browser --build --browser chromium --tfs "Browser Unit Tests" displayName: Run unit tests (Browser) - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | # Figure out the full absolute path of the product we just built @@ -121,14 +122,14 @@ steps: VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests" displayName: Run integration tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \ DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium displayName: Run integration tests (Browser) - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e @@ -138,11 +139,11 @@ steps: VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ DISPLAY=:10 ./resources/server/test/test-remote-integration.sh displayName: Run remote integration tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - task: PublishPipelineArtifact@0 inputs: - artifactName: crash-dump-linux + artifactName: 'crash-dump-linux-$(VSCODE_ARCH)' targetPath: .build/crashes displayName: 'Publish Crash Reports' continueOnError: true @@ -161,6 +162,7 @@ steps: yarn gulp "vscode-linux-x64-build-rpm" yarn gulp "vscode-linux-x64-prepare-snap" displayName: Build packages + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: @@ -180,20 +182,23 @@ steps: ] SessionTimeout: 120 displayName: Codesign rpm + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) - script: | set -e AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \ AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \ VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ + VSCODE_ARCH="$(VSCODE_ARCH)" \ ./build/azure-pipelines/linux/publish.sh displayName: Publish - task: PublishPipelineArtifact@0 displayName: 'Publish Pipeline Artifact' inputs: - artifactName: snap-x64 + artifactName: 'snap-$(VSCODE_ARCH)' targetPath: .build/linux/snap-tarball + condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection' diff --git a/build/azure-pipelines/linux/publish.sh b/build/azure-pipelines/linux/publish.sh index 7e360be6cb4e50..e90b6c909d6c10 100755 --- a/build/azure-pipelines/linux/publish.sh +++ b/build/azure-pipelines/linux/publish.sh @@ -4,11 +4,10 @@ REPO="$(pwd)" ROOT="$REPO/.." # Publish tarball -PLATFORM_LINUX="linux-x64" +PLATFORM_LINUX="linux-$VSCODE_ARCH" BUILDNAME="VSCode-$PLATFORM_LINUX" -BUILD="$ROOT/$BUILDNAME" BUILD_VERSION="$(date +%s)" -[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz" +[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$VSCODE_ARCH-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$VSCODE_ARCH-$BUILD_VERSION.tar.gz" TARBALL_PATH="$ROOT/$TARBALL_FILENAME" rm -rf $ROOT/code-*.tar.* @@ -27,25 +26,27 @@ rm -rf $ROOT/vscode-server-*.tar.* node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH" -# Publish DEB -PLATFORM_DEB="linux-deb-x64" -DEB_ARCH="amd64" -DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" -DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" - -node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH" - -# Publish RPM -PLATFORM_RPM="linux-rpm-x64" -RPM_ARCH="x86_64" -RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" -RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" - -node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH" - -# Publish Snap -# Pack snap tarball artifact, in order to preserve file perms -mkdir -p $REPO/.build/linux/snap-tarball -SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-x64.tar.gz" -rm -rf $SNAP_TARBALL_PATH -(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap) +if [ "$VSCODE_ARCH" == "x64" ]; then + # Publish DEB + PLATFORM_DEB="linux-deb-$VSCODE_ARCH" + DEB_ARCH="amd64" + DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" + DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" + + node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH" + + # Publish RPM + PLATFORM_RPM="linux-rpm-$VSCODE_ARCH" + RPM_ARCH="x86_64" + RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" + RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" + + node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH" + + # Publish Snap + # Pack snap tarball artifact, in order to preserve file perms + mkdir -p $REPO/.build/linux/snap-tarball + SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$VSCODE_ARCH.tar.gz" + rm -rf $SNAP_TARBALL_PATH + (cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap) +fi diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 1f3a080508661a..54754215922541 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -13,6 +13,9 @@ resources: - container: vscode-x64 image: vscodehub.azurecr.io/vscode-linux-build-agent:x64 endpoint: VSCodeHub + - container: vscode-arm64 + image: vscodehub.azurecr.io/vscode-linux-build-agent:buster-arm64 + endpoint: VSCodeHub - container: snapcraft image: snapcore/snapcraft:stable @@ -64,6 +67,8 @@ stages: - job: Linux condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true')) container: vscode-x64 + variables: + VSCODE_ARCH: x64 steps: - template: linux/product-build-linux.yml @@ -72,6 +77,8 @@ stages: - Linux condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true')) container: snapcraft + variables: + VSCODE_ARCH: x64 steps: - template: linux/snap-build-linux.yml @@ -84,10 +91,11 @@ stages: - job: LinuxArm64 condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true')) + container: vscode-arm64 variables: VSCODE_ARCH: arm64 steps: - - template: linux/product-build-linux-multiarch.yml + - template: linux/product-build-linux.yml - job: LinuxAlpine condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true')) From 45f9763c834a8f3f2927a4ec7ff765abe4023f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 14:19:34 +0200 Subject: [PATCH 02/55] fix conditions --- .../linux/product-build-linux.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 2651a0e3fe5b30..fa2a562e814c0d 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -97,19 +97,19 @@ steps: set -e service xvfb start displayName: Start xvfb - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests" displayName: Run unit tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e DISPLAY=:10 yarn test-browser --build --browser chromium --tfs "Browser Unit Tests" displayName: Run unit tests (Browser) - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | # Figure out the full absolute path of the product we just built @@ -122,14 +122,14 @@ steps: VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests" displayName: Run integration tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \ DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium displayName: Run integration tests (Browser) - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e @@ -139,7 +139,7 @@ steps: VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ DISPLAY=:10 ./resources/server/test/test-remote-integration.sh displayName: Run remote integration tests (Electron) - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64']), eq(variables['VSCODE_STEP_ON_IT'], 'false')) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - task: PublishPipelineArtifact@0 inputs: @@ -162,7 +162,7 @@ steps: yarn gulp "vscode-linux-x64-build-rpm" yarn gulp "vscode-linux-x64-prepare-snap" displayName: Build packages - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: @@ -182,7 +182,7 @@ steps: ] SessionTimeout: 120 displayName: Codesign rpm - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - script: | set -e @@ -198,7 +198,7 @@ steps: inputs: artifactName: 'snap-$(VSCODE_ARCH)' targetPath: .build/linux/snap-tarball - condition: and(succeeded(), eq(variables['VSCODE_ARCH', 'x64'])) + condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection' From 7f57a448517c74395cbb18e7dce5559eb3373f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 14:35:46 +0200 Subject: [PATCH 03/55] distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 09d7e57699e677..b7490377512d83 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "a2863a9e80e1f2a5d4bdb01c4ac5154c9d7d133d", + "distro": "e7785c415611ea4e39b1f5e6ccc87fda019bfbd2", "author": { "name": "Microsoft Corporation" }, @@ -193,4 +193,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} +} \ No newline at end of file From 2f3491ab754bf36711c3d7a731967c377b136cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 14:51:11 +0200 Subject: [PATCH 04/55] fix compile cache --- build/azure-pipelines/product-compile.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index ab0dbb932c604c..cef693d4576240 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -3,11 +3,12 @@ steps: mkdir -p .build echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality + echo -n $VSCODE_ARCH > .build/arch displayName: Prepare cache flag - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .build/commit, .build/quality' + keyfile: '.build/arch, build/.cachesalt, .build/commit, .build/quality' targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min' vstsFeed: 'npm-vscode' platformIndependent: true @@ -54,7 +55,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true')) @@ -67,7 +68,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), ne(variables['CacheRestored'], 'true')) From f7684f6caa89c03d6cdc43a6cb1ab054b9b1f3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 15:39:06 +0200 Subject: [PATCH 05/55] distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b7490377512d83..5b781b3404439a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "e7785c415611ea4e39b1f5e6ccc87fda019bfbd2", + "distro": "4aa8fa3bae3eb0120881b7de0756ace5ce7091ca", "author": { "name": "Microsoft Corporation" }, @@ -193,4 +193,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} \ No newline at end of file +} From c434a70e89d207afe6a1cf453ac159b234872a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 7 Sep 2020 19:45:51 +0200 Subject: [PATCH 06/55] fix compilation cache --- build/azure-pipelines/linux/product-build-linux.yml | 5 ++++- build/azure-pipelines/product-compile.yml | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index fa2a562e814c0d..45f581540b1c5c 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -3,7 +3,6 @@ steps: mkdir -p .build echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality - echo -n $VSCODE_ARCH > .build/arch displayName: Prepare cache flag - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 @@ -53,6 +52,10 @@ steps: git merge $(node -p "require('./package.json').distro") displayName: Merge distro +- script: | + echo -n $VSCODE_ARCH > .build/arch + displayName: Prepare arch cache flag + - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index cef693d4576240..2eff40b53d1062 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -3,12 +3,11 @@ steps: mkdir -p .build echo -n $BUILD_SOURCEVERSION > .build/commit echo -n $VSCODE_QUALITY > .build/quality - echo -n $VSCODE_ARCH > .build/arch displayName: Prepare cache flag - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: '.build/arch, build/.cachesalt, .build/commit, .build/quality' + keyfile: 'build/.cachesalt, .build/commit, .build/quality' targetfolder: '.build, out-build, out-vscode-min, out-vscode-reh-min, out-vscode-reh-web-min' vstsFeed: 'npm-vscode' platformIndependent: true @@ -53,6 +52,10 @@ steps: displayName: Merge distro condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true')) +- script: | + echo -n $VSCODE_ARCH > .build/arch + displayName: Prepare arch cache flag + - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: keyfile: '.build/arch, build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' From 23e743d14ecfc0f486297af6ad226c3c3f75229f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 09:41:23 +0200 Subject: [PATCH 07/55] cleanup gulpfile reh --- build/gulpfile.reh.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index f2ea1bd37010b1..5f367d1f0777d2 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -37,19 +37,11 @@ const BUILD_TARGETS = [ const noop = () => { return Promise.resolve(); }; -gulp.task('vscode-reh-win32-ia32-min', noop); -gulp.task('vscode-reh-win32-x64-min', noop); -gulp.task('vscode-reh-darwin-min', noop); -gulp.task('vscode-reh-linux-x64-min', noop); -gulp.task('vscode-reh-linux-armhf-min', noop); -gulp.task('vscode-reh-linux-arm64-min', noop); -gulp.task('vscode-reh-linux-alpine-min', noop); - -gulp.task('vscode-reh-web-win32-ia32-min', noop); -gulp.task('vscode-reh-web-win32-x64-min', noop); -gulp.task('vscode-reh-web-darwin-min', noop); -gulp.task('vscode-reh-web-linux-x64-min', noop); -gulp.task('vscode-reh-web-linux-alpine-min', noop); +BUILD_TARGETS.forEach(({ platform, arch }) => { + for (const target of ['reh', 'reh-web']) { + gulp.task(`vscode-${target}-${platform}${ arch ? `-${arch}` : '' }-min`, noop); + } +}); function getNodeVersion() { const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8'); From 47d8a2560605b5b6b013719f7f385ec9750cae9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 09:41:28 +0200 Subject: [PATCH 08/55] build vscode armhf --- build/azure-pipelines/product-build.yml | 6 +++++- build/gulpfile.vscode.js | 4 ++-- build/gulpfile.vscode.linux.js | 6 +++--- build/lib/electron.js | 2 +- build/lib/electron.ts | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 54754215922541..a80379e7606e56 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -16,6 +16,9 @@ resources: - container: vscode-arm64 image: vscodehub.azurecr.io/vscode-linux-build-agent:buster-arm64 endpoint: VSCodeHub + - container: vscode-armhf + image: vscodehub.azurecr.io/vscode-linux-build-agent:buster-armhf + endpoint: VSCodeHub - container: snapcraft image: snapcore/snapcraft:stable @@ -84,10 +87,11 @@ stages: - job: LinuxArmhf condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true')) + container: vscode-armhf variables: VSCODE_ARCH: armhf steps: - - template: linux/product-build-linux-multiarch.yml + - template: linux/product-build-linux.yml - job: LinuxArm64 condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true')) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 2c86b2808e01ef..d046aa71ed2f2c 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -263,7 +263,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op let result = all .pipe(util.skipDirectories()) .pipe(util.fixWin32DirectoryPermissions()) - .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true }))) + .pipe(electron(_.extend({}, config, { platform, arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: true }))) .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true })); if (platform === 'linux') { @@ -324,7 +324,7 @@ const BUILD_TARGETS = [ { platform: 'darwin', arch: null, opts: { stats: true } }, { platform: 'linux', arch: 'ia32' }, { platform: 'linux', arch: 'x64' }, - { platform: 'linux', arch: 'arm' }, + { platform: 'linux', arch: 'armhf' }, { platform: 'linux', arch: 'arm64' }, ]; BUILD_TARGETS.forEach(buildTarget => { diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index e8e0c1541d04d5..f11a49d1670f1e 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -23,7 +23,7 @@ const commit = util.getVersion(root); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); function getDebPackageArch(arch) { - return { x64: 'amd64', arm: 'armhf', arm64: 'arm64' }[arch]; + return { x64: 'amd64', armhf: 'armhf', arm64: 'arm64' }[arch]; } function prepareDebPackage(arch) { @@ -115,7 +115,7 @@ function getRpmBuildPath(rpmArch) { } function getRpmPackageArch(arch) { - return { x64: 'x86_64', arm: 'armhf', arm64: 'arm64' }[arch]; + return { x64: 'x86_64', armhf: 'armhf', arm64: 'arm64' }[arch]; } function prepareRpmPackage(arch) { @@ -246,7 +246,7 @@ function buildSnapPackage(arch) { const BUILD_TARGETS = [ { arch: 'x64' }, - { arch: 'arm' }, + { arch: 'armhf' }, { arch: 'arm64' }, ]; diff --git a/build/lib/electron.js b/build/lib/electron.js index bb71f14c12d29d..3c7a876d60772b 100644 --- a/build/lib/electron.js +++ b/build/lib/electron.js @@ -82,7 +82,7 @@ function getElectron(arch) { return () => { const electronOpts = _.extend({}, exports.config, { platform: process.platform, - arch, + arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: true, keepDefaultApp: true }); diff --git a/build/lib/electron.ts b/build/lib/electron.ts index e0beca78079350..e969aa8ecba7f0 100644 --- a/build/lib/electron.ts +++ b/build/lib/electron.ts @@ -88,7 +88,7 @@ function getElectron(arch: string): () => NodeJS.ReadWriteStream { return () => { const electronOpts = _.extend({}, config, { platform: process.platform, - arch, + arch: arch === 'armhf' ? 'arm' : arch, ffmpegChromium: true, keepDefaultApp: true }); From 54d8e4ea0c9e2cd486c659aa97a3781078624278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 09:43:22 +0200 Subject: [PATCH 09/55] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b781b3404439a..5e05dbde40c364 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "4aa8fa3bae3eb0120881b7de0756ace5ce7091ca", + "distro": "072600857f7c674daf79daa6ae00cd4d4851f04b", "author": { "name": "Microsoft Corporation" }, From 41a90e7c50ecefa655866d5e20d3a66342ba5d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 10:46:54 +0200 Subject: [PATCH 10/55] fix yarn arch --- build/azure-pipelines/linux/product-build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 45f581540b1c5c..4e98b487da6dff 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -64,7 +64,7 @@ steps: - script: | set -e - CHILD_CONCURRENCY=1 yarn --frozen-lockfile --arch=$(VSCODE_ARCH) + CHILD_CONCURRENCY=1 npm_config_arch=$(VSCODE_ARCH) yarn --frozen-lockfile displayName: Install dependencies condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) From e73d8797cac618422c50e1e53c71f4335186f78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 11:33:29 +0200 Subject: [PATCH 11/55] fix armhf build --- build/azure-pipelines/linux/product-build-linux.yml | 2 +- build/azure-pipelines/product-build.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 4e98b487da6dff..91dc644e4f7077 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -64,7 +64,7 @@ steps: - script: | set -e - CHILD_CONCURRENCY=1 npm_config_arch=$(VSCODE_ARCH) yarn --frozen-lockfile + CHILD_CONCURRENCY=1 npm_config_arch=$(NPM_ARCH) yarn --frozen-lockfile displayName: Install dependencies condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index a80379e7606e56..c45f6926f4fa4f 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -72,6 +72,7 @@ stages: container: vscode-x64 variables: VSCODE_ARCH: x64 + NPM_ARCH: x64 steps: - template: linux/product-build-linux.yml @@ -90,6 +91,7 @@ stages: container: vscode-armhf variables: VSCODE_ARCH: armhf + NPM_ARCH: arm steps: - template: linux/product-build-linux.yml @@ -98,6 +100,7 @@ stages: container: vscode-arm64 variables: VSCODE_ARCH: arm64 + NPM_ARCH: arm64 steps: - template: linux/product-build-linux.yml From 0f550c2acb5a232917962213f8a5d4f3b9dac573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 14:45:42 +0200 Subject: [PATCH 12/55] another attempt --- build/azure-pipelines/product-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index c45f6926f4fa4f..3e091e69149ec8 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -91,7 +91,7 @@ stages: container: vscode-armhf variables: VSCODE_ARCH: armhf - NPM_ARCH: arm + NPM_ARCH: armv7l steps: - template: linux/product-build-linux.yml From 1003166b7d2eb8ba1dd3e3517b56846cd063ede0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 16:24:51 +0200 Subject: [PATCH 13/55] :lipstick: --- build/gulpfile.vscode.linux.js | 40 +++++++++++++--------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index f11a49d1670f1e..f0a7dcf3284fcd 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -250,29 +250,19 @@ const BUILD_TARGETS = [ { arch: 'arm64' }, ]; -BUILD_TARGETS.forEach((buildTarget) => { - const arch = buildTarget.arch; - - { - const debArch = getDebPackageArch(arch); - const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch))); - // gulp.task(prepareDebTask); - const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch))); - gulp.task(buildDebTask); - } - - { - const rpmArch = getRpmPackageArch(arch); - const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch))); - // gulp.task(prepareRpmTask); - const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch))); - gulp.task(buildRpmTask); - } - - { - const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch))); - gulp.task(prepareSnapTask); - const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch))); - gulp.task(buildSnapTask); - } +BUILD_TARGETS.forEach(({ arch }) => { + const debArch = getDebPackageArch(arch); + const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch))); + const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch))); + gulp.task(buildDebTask); + + const rpmArch = getRpmPackageArch(arch); + const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch))); + const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch))); + gulp.task(buildRpmTask); + + const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch))); + gulp.task(prepareSnapTask); + const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch))); + gulp.task(buildSnapTask); }); From 1f99a829e6f07edc2b5d50f494b715dbc3b7c8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 16:29:14 +0200 Subject: [PATCH 14/55] produce deb, rpm packages --- .../linux/product-build-linux.yml | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 91dc644e4f7077..39b43f0007c22f 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -119,27 +119,27 @@ steps: # including the remote server and configure the integration tests # to run with these builds instead of running out of sources. set -e - APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64 + APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \ DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests" displayName: Run integration tests (Electron) condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-$(VSCODE_ARCH)" \ DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium displayName: Run integration tests (Browser) condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) - script: | set -e - APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64 + APP_ROOT=$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH) APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName") INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \ - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-$(VSCODE_ARCH)" \ DISPLAY=:10 ./resources/server/test/test-remote-integration.sh displayName: Run remote integration tests (Electron) condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), eq(variables['VSCODE_STEP_ON_IT'], 'false')) @@ -161,16 +161,20 @@ steps: - script: | set -e - yarn gulp "vscode-linux-x64-build-deb" - yarn gulp "vscode-linux-x64-build-rpm" - yarn gulp "vscode-linux-x64-prepare-snap" - displayName: Build packages + yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-deb" + yarn gulp "vscode-linux-$(VSCODE_ARCH)-build-rpm" + displayName: Build deb, rpm packages + +- script: | + set -e + yarn gulp "vscode-linux-$(VSCODE_ARCH)-prepare-snap" + displayName: Prepare snap package condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: ConnectedServiceName: 'ESRP CodeSign' - FolderPath: '.build/linux/rpm/x86_64' + FolderPath: '.build/linux/rpm' Pattern: '*.rpm' signConfigType: inlineSignParams inlineOperation: | @@ -185,7 +189,6 @@ steps: ] SessionTimeout: 120 displayName: Codesign rpm - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - script: | set -e From 034f6fc5ba9f0f00983f2aeb559af411b2fb22e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Tue, 8 Sep 2020 20:57:07 +0200 Subject: [PATCH 15/55] fix rpm --- build/gulpfile.vscode.linux.js | 2 +- resources/linux/rpm/dependencies.json | 132 +++++++++++++++++++++++++- 2 files changed, 132 insertions(+), 2 deletions(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index f0a7dcf3284fcd..3efb4ebf1f4c75 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -115,7 +115,7 @@ function getRpmBuildPath(rpmArch) { } function getRpmPackageArch(arch) { - return { x64: 'x86_64', armhf: 'armhf', arm64: 'arm64' }[arch]; + return { x64: 'x86_64', armhf: 'armv7hl', arm64: 'aarch64' }[arch]; } function prepareRpmPackage(arch) { diff --git a/resources/linux/rpm/dependencies.json b/resources/linux/rpm/dependencies.json index 34f127e1ae5932..07e2b307fcdb7b 100644 --- a/resources/linux/rpm/dependencies.json +++ b/resources/linux/rpm/dependencies.json @@ -63,5 +63,135 @@ "libxcb.so.1()(64bit)", "libxkbfile.so.1()(64bit)", "libsecret-1.so.0()(64bit)" + ], + "aarch64": [ + "libpthread.so.0()(aarch64)", + "libpthread.so.0(GLIBC_2.2.5)(aarch64)", + "libpthread.so.0(GLIBC_2.3.2)(aarch64)", + "libpthread.so.0(GLIBC_2.3.3)(aarch64)", + "libgtk-3.so.0()(aarch64)", + "libgdk-x11-2.0.so.0()(aarch64)", + "libatk-1.0.so.0()(aarch64)", + "libgio-2.0.so.0()(aarch64)", + "libpangocairo-1.0.so.0()(aarch64)", + "libgdk_pixbuf-2.0.so.0()(aarch64)", + "libcairo.so.2()(aarch64)", + "libpango-1.0.so.0()(aarch64)", + "libfreetype.so.6()(aarch64)", + "libfontconfig.so.1()(aarch64)", + "libgobject-2.0.so.0()(aarch64)", + "libdbus-1.so.3()(aarch64)", + "libXi.so.6()(aarch64)", + "libXcursor.so.1()(aarch64)", + "libXdamage.so.1()(aarch64)", + "libXrandr.so.2()(aarch64)", + "libXcomposite.so.1()(aarch64)", + "libXext.so.6()(aarch64)", + "libXfixes.so.3()(aarch64)", + "libXrender.so.1()(aarch64)", + "libX11.so.6()(aarch64)", + "libXss.so.1()(aarch64)", + "libXtst.so.6()(aarch64)", + "libgmodule-2.0.so.0()(aarch64)", + "librt.so.1()(aarch64)", + "libglib-2.0.so.0()(aarch64)", + "libnss3.so()(aarch64)", + "libnssutil3.so()(aarch64)", + "libsmime3.so()(aarch64)", + "libnspr4.so()(aarch64)", + "libasound.so.2()(aarch64)", + "libcups.so.2()(aarch64)", + "libdl.so.2()(aarch64)", + "libexpat.so.1()(aarch64)", + "libstdc++.so.6()(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4)(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4.10)(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4.11)(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4.14)(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4.15)(aarch64)", + "libstdc++.so.6(GLIBCXX_3.4.9)(aarch64)", + "libm.so.6()(aarch64)", + "libm.so.6(GLIBC_2.2.5)(aarch64)", + "libgcc_s.so.1()(aarch64)", + "libgcc_s.so.1(GCC_3.0)(aarch64)", + "libgcc_s.so.1(GCC_4.0.0)(aarch64)", + "libc.so.6()(aarch64)", + "libc.so.6(GLIBC_2.11)(aarch64)", + "libc.so.6(GLIBC_2.2.5)(aarch64)", + "libc.so.6(GLIBC_2.3)(aarch64)", + "libc.so.6(GLIBC_2.3.2)(aarch64)", + "libc.so.6(GLIBC_2.3.4)(aarch64)", + "libc.so.6(GLIBC_2.4)(aarch64)", + "libc.so.6(GLIBC_2.6)(aarch64)", + "libc.so.6(GLIBC_2.7)(aarch64)", + "libc.so.6(GLIBC_2.9)(aarch64)", + "libxcb.so.1()(aarch64)", + "libxkbfile.so.1()(aarch64)", + "libsecret-1.so.0()(aarch64)" + ], + "armv7hl": [ + "libpthread.so.0()(armv7hl)", + "libpthread.so.0(GLIBC_2.2.5)(armv7hl)", + "libpthread.so.0(GLIBC_2.3.2)(armv7hl)", + "libpthread.so.0(GLIBC_2.3.3)(armv7hl)", + "libgtk-3.so.0()(armv7hl)", + "libgdk-x11-2.0.so.0()(armv7hl)", + "libatk-1.0.so.0()(armv7hl)", + "libgio-2.0.so.0()(armv7hl)", + "libpangocairo-1.0.so.0()(armv7hl)", + "libgdk_pixbuf-2.0.so.0()(armv7hl)", + "libcairo.so.2()(armv7hl)", + "libpango-1.0.so.0()(armv7hl)", + "libfreetype.so.6()(armv7hl)", + "libfontconfig.so.1()(armv7hl)", + "libgobject-2.0.so.0()(armv7hl)", + "libdbus-1.so.3()(armv7hl)", + "libXi.so.6()(armv7hl)", + "libXcursor.so.1()(armv7hl)", + "libXdamage.so.1()(armv7hl)", + "libXrandr.so.2()(armv7hl)", + "libXcomposite.so.1()(armv7hl)", + "libXext.so.6()(armv7hl)", + "libXfixes.so.3()(armv7hl)", + "libXrender.so.1()(armv7hl)", + "libX11.so.6()(armv7hl)", + "libXss.so.1()(armv7hl)", + "libXtst.so.6()(armv7hl)", + "libgmodule-2.0.so.0()(armv7hl)", + "librt.so.1()(armv7hl)", + "libglib-2.0.so.0()(armv7hl)", + "libnss3.so()(armv7hl)", + "libnssutil3.so()(armv7hl)", + "libsmime3.so()(armv7hl)", + "libnspr4.so()(armv7hl)", + "libasound.so.2()(armv7hl)", + "libcups.so.2()(armv7hl)", + "libdl.so.2()(armv7hl)", + "libexpat.so.1()(armv7hl)", + "libstdc++.so.6()(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4)(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4.10)(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4.11)(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4.14)(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4.15)(armv7hl)", + "libstdc++.so.6(GLIBCXX_3.4.9)(armv7hl)", + "libm.so.6()(armv7hl)", + "libm.so.6(GLIBC_2.2.5)(armv7hl)", + "libgcc_s.so.1()(armv7hl)", + "libgcc_s.so.1(GCC_3.0)(armv7hl)", + "libgcc_s.so.1(GCC_4.0.0)(armv7hl)", + "libc.so.6()(armv7hl)", + "libc.so.6(GLIBC_2.11)(armv7hl)", + "libc.so.6(GLIBC_2.2.5)(armv7hl)", + "libc.so.6(GLIBC_2.3)(armv7hl)", + "libc.so.6(GLIBC_2.3.2)(armv7hl)", + "libc.so.6(GLIBC_2.3.4)(armv7hl)", + "libc.so.6(GLIBC_2.4)(armv7hl)", + "libc.so.6(GLIBC_2.6)(armv7hl)", + "libc.so.6(GLIBC_2.7)(armv7hl)", + "libc.so.6(GLIBC_2.9)(armv7hl)", + "libxcb.so.1()(armv7hl)", + "libxkbfile.so.1()(armv7hl)", + "libsecret-1.so.0()(armv7hl)" ] -} \ No newline at end of file +} From 799db29ff57d8969fbe856e010676cb7e80cdbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 08:55:52 +0200 Subject: [PATCH 16/55] install dot net core sdk --- build/azure-pipelines/linux/product-build-linux.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 39b43f0007c22f..270beb898a0fc7 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -171,6 +171,12 @@ steps: displayName: Prepare snap package condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) +# needed for code signing +- task: UseDotNet@2 + displayName: 'Install .NET Core SDK 2.x' + inputs: + version: 2.x + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 inputs: ConnectedServiceName: 'ESRP CodeSign' From 0a2801b3df0943dddb3c43e83ce0b0b38e04279c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 09:03:10 +0200 Subject: [PATCH 17/55] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d04db1ccf5049..2b1df662edc0f7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "072600857f7c674daf79daa6ae00cd4d4851f04b", + "distro": "ed835987521462369e4cc7f402bb64026de40c10", "author": { "name": "Microsoft Corporation" }, From c4b273b3c39422eba6a74bec2e3de4150c9b2e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 09:09:44 +0200 Subject: [PATCH 18/55] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b1df662edc0f7..a1625fa79caa78 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "ed835987521462369e4cc7f402bb64026de40c10", + "distro": "2eef91bd5c0c8f6bab1fa8b17425ca835971fd0a", "author": { "name": "Microsoft Corporation" }, From 079b1918a513600ee0e7d2a9c7eb3082b52649a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 09:18:30 +0200 Subject: [PATCH 19/55] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a1625fa79caa78..f85c894f80e643 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "2eef91bd5c0c8f6bab1fa8b17425ca835971fd0a", + "distro": "7d3851461457124c16c9ab4b223500bc48e35d05", "author": { "name": "Microsoft Corporation" }, From 0bc0291c5e9de6ecc5ba68f94f107955d32111d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 13:49:46 +0200 Subject: [PATCH 20/55] publish arm deb and rpm --- build/azure-pipelines/linux/publish.sh | 36 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/build/azure-pipelines/linux/publish.sh b/build/azure-pipelines/linux/publish.sh index e90b6c909d6c10..e0462b819dce3b 100755 --- a/build/azure-pipelines/linux/publish.sh +++ b/build/azure-pipelines/linux/publish.sh @@ -26,23 +26,33 @@ rm -rf $ROOT/vscode-server-*.tar.* node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH" -if [ "$VSCODE_ARCH" == "x64" ]; then - # Publish DEB - PLATFORM_DEB="linux-deb-$VSCODE_ARCH" - DEB_ARCH="amd64" - DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" - DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" +# Publish DEB +case $VSCODE_ARCH in + x64) DEB_ARCH="amd64" ;; + *) DEB_ARCH="$VSCODE_ARCH" ;; +esac + +PLATFORM_DEB="linux-deb-$VSCODE_ARCH" +DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" +DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" - node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH" +node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH" - # Publish RPM - PLATFORM_RPM="linux-rpm-$VSCODE_ARCH" - RPM_ARCH="x86_64" - RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" - RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" +# Publish RPM +case $VSCODE_ARCH in + x64) RPM_ARCH="amd64" ;; + armhf) RPM_ARCH="armv7hl" ;; + arm64) RPM_ARCH="aarch64" ;; + *) RPM_ARCH="$VSCODE_ARCH" ;; +esac - node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH" +PLATFORM_RPM="linux-rpm-$VSCODE_ARCH" +RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" +RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" +node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH" + +if [ "$VSCODE_ARCH" == "x64" ]; then # Publish Snap # Pack snap tarball artifact, in order to preserve file perms mkdir -p $REPO/.build/linux/snap-tarball From f481704216ba220da1546d4f7eb87bd6b4f6c2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 14:08:53 +0200 Subject: [PATCH 21/55] distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f85c894f80e643..ebeaa4b11bafb5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "7d3851461457124c16c9ab4b223500bc48e35d05", + "distro": "7d8ba0b3c315aa37b4f5a11a93e6e34e4d2c8abe", "author": { "name": "Microsoft Corporation" }, From e05b06ec876df55c5877042510812f3703d30e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 9 Sep 2020 15:07:00 +0200 Subject: [PATCH 22/55] fix arch --- build/azure-pipelines/linux/publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/linux/publish.sh b/build/azure-pipelines/linux/publish.sh index e0462b819dce3b..72fe2ad7b30e4a 100755 --- a/build/azure-pipelines/linux/publish.sh +++ b/build/azure-pipelines/linux/publish.sh @@ -40,7 +40,7 @@ node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_F # Publish RPM case $VSCODE_ARCH in - x64) RPM_ARCH="amd64" ;; + x64) RPM_ARCH="x86_64" ;; armhf) RPM_ARCH="armv7hl" ;; arm64) RPM_ARCH="aarch64" ;; *) RPM_ARCH="$VSCODE_ARCH" ;; From 9d87cd68ea14f6920b2609388e46ca19d6bd2fbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Sep 2020 16:34:59 +0000 Subject: [PATCH 23/55] Bump yargs-parser in /extensions/css-language-features/server Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2. - [Release notes](https://github.com/yargs/yargs-parser/releases) - [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md) - [Commits](https://github.com/yargs/yargs-parser/commits) Signed-off-by: dependabot[bot] --- extensions/css-language-features/server/yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index c93e187a941057..b3f3f0efcb74fb 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -789,7 +789,7 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yargs-parser@13.1.2, yargs-parser@^13.1.2: +yargs-parser@13.1.2, yargs-parser@^13.1.1: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== @@ -797,10 +797,10 @@ yargs-parser@13.1.2, yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== +yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" From 8684731436d8e69a44ff306a5e0c6d66571047ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 11 Sep 2020 07:57:46 +0200 Subject: [PATCH 24/55] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ebeaa4b11bafb5..b89236e2944336 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "7d8ba0b3c315aa37b4f5a11a93e6e34e4d2c8abe", + "distro": "3729948d337954299b7e3b183f66034d51e4ad69", "author": { "name": "Microsoft Corporation" }, From 2e2d14cb13de1e4727aa05731c613bd57e3897e2 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 11 Sep 2020 09:41:31 +0200 Subject: [PATCH 25/55] some jsdoc for https://github.com/microsoft/vscode/issues/54938 --- src/vs/vscode.proposed.d.ts | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 893c80ca37fd56..b8fb428bdc55d8 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -717,16 +717,69 @@ declare module 'vscode' { //#region file-decorations: https://github.com/microsoft/vscode/issues/54938 + // TODO@jrieken FileDecoration, FileDecorationProvider etc. + // TODO@jrieken Add selector notion to limit decorations to a view. + // TODO@jrieken Rename `Decoration.letter` to `short` so that it could be used for coverage et al. + export class Decoration { + + /** + * A letter that represents this decoration. + */ letter?: string; + + /** + * The human-readable title for this decoration. + */ title?: string; + + /** + * The color of this decoration. + */ color?: ThemeColor; + + /** + * The priority of this decoration. + */ priority?: number; + + /** + * A flag expressing that this decoration should be + * propagted to its parents. + */ bubble?: boolean; + + /** + * Creates a new decoration. + * + * @param letter A letter that represents the decoration. + * @param title The title of the decoration. + * @param color The color of the decoration. + */ + constructor(letter?: string, title?: string, color?: ThemeColor); } + /** + * The decoration provider interfaces defines the contract between extensions and + * file decorations. + */ export interface DecorationProvider { + + /** + * An event to signal decorations for one or many files have changed. + * + * @see [EventEmitter](#EventEmitter + */ onDidChangeDecorations: Event; + + /** + * Provide decorations for a given uri. + * + * + * @param uri The uri of the file to provide a decoration for. + * @param token A cancellation token. + * @returns A decoration or a thenable that resolves to such. + */ provideDecoration(uri: Uri, token: CancellationToken): ProviderResult; } From 37a11b4314892f8c3ee605c2393ad9bac03cf0bb Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 11 Sep 2020 09:46:16 +0200 Subject: [PATCH 26/55] try to fix build (linux) --- resources/linux/rpm/code.spec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index 4c0b9db4718a59..617010d81b84b5 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -23,7 +23,7 @@ mkdir -p %{buildroot}/usr/share/zsh/site-functions cp -r usr/share/@@NAME@@/* %{buildroot}/usr/share/@@NAME@@ cp -r usr/share/applications/@@NAME@@.desktop %{buildroot}/usr/share/applications cp -r usr/share/applications/@@NAME@@-url-handler.desktop %{buildroot}/usr/share/applications -cp -r usr/share/mime/packages/@@NAME@@-workspace.xml %{buildroot}/usr/share/mime/packages/@@NAME-workspace.xml +cp -r usr/share/mime/packages/@@NAME@@-workspace.xml %{buildroot}/usr/share/mime/packages/@@NAME@@-workspace.xml cp -r usr/share/pixmaps/@@ICON@@.png %{buildroot}/usr/share/pixmaps cp usr/share/bash-completion/completions/@@NAME@@ %{buildroot}/usr/share/bash-completion/completions/@@NAME@@ cp usr/share/zsh/site-functions/_@@NAME@@ %{buildroot}/usr/share/zsh/site-functions/_@@NAME@@ From 87847325a66f098621f6650a16d665c9cd07f15a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 11 Sep 2020 09:49:18 +0200 Subject: [PATCH 27/55] electron - set spellcheck: false again for windows --- src/vs/code/electron-main/auth.ts | 1 + src/vs/code/electron-main/sharedProcess.ts | 1 + src/vs/code/electron-main/window.ts | 1 + src/vs/platform/issue/electron-main/issueMainService.ts | 2 ++ test/unit/electron/index.js | 1 + 5 files changed, 6 insertions(+) diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts index ca071cf2836f20..ad6c47e5a31390 100644 --- a/src/vs/code/electron-main/auth.ts +++ b/src/vs/code/electron-main/auth.ts @@ -64,6 +64,7 @@ export class ProxyAuthHandler extends Disposable { contextIsolation: true, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, devTools: false } }; diff --git a/src/vs/code/electron-main/sharedProcess.ts b/src/vs/code/electron-main/sharedProcess.ts index a6ef6be6ce11a9..86ebb7ff93257e 100644 --- a/src/vs/code/electron-main/sharedProcess.ts +++ b/src/vs/code/electron-main/sharedProcess.ts @@ -45,6 +45,7 @@ export class SharedProcess implements ISharedProcess { nodeIntegration: true, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, nativeWindowOpen: true, images: false, webgl: false, diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 40cbd5b9a43f74..39444b538395dd 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -169,6 +169,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { preload: URI.parse(this.doGetPreloadUrl()).fsPath, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, nativeWindowOpen: true, webviewTag: true, zoomFactor: zoomLevelToZoomFactor(windowConfig?.zoomLevel), diff --git a/src/vs/platform/issue/electron-main/issueMainService.ts b/src/vs/platform/issue/electron-main/issueMainService.ts index 31e3888364ec3d..817951f6be532d 100644 --- a/src/vs/platform/issue/electron-main/issueMainService.ts +++ b/src/vs/platform/issue/electron-main/issueMainService.ts @@ -199,6 +199,7 @@ export class IssueMainService implements ICommonIssueService { preload: URI.parse(require.toUrl('vs/base/parts/sandbox/electron-browser/preload.js')).fsPath, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, nativeWindowOpen: true, zoomFactor: zoomLevelToZoomFactor(data.zoomLevel), ...this.environmentService.sandbox ? @@ -264,6 +265,7 @@ export class IssueMainService implements ICommonIssueService { preload: URI.parse(require.toUrl('vs/base/parts/sandbox/electron-browser/preload.js')).fsPath, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, nativeWindowOpen: true, zoomFactor: zoomLevelToZoomFactor(data.zoomLevel), ...this.environmentService.sandbox ? diff --git a/test/unit/electron/index.js b/test/unit/electron/index.js index 6685ff8f713881..9aeaaccc844c8a 100644 --- a/test/unit/electron/index.js +++ b/test/unit/electron/index.js @@ -121,6 +121,7 @@ app.on('ready', () => { nodeIntegration: true, enableWebSQL: false, enableRemoteModule: false, + spellcheck: false, nativeWindowOpen: true, webviewTag: true } From 55a7f0aa48eb429f094a82a9098fa7db602d7e45 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 11 Sep 2020 10:10:35 +0200 Subject: [PATCH 28/55] update search file, https://github.com/microsoft/vscode/issues/106395 --- .vscode/searches/TrustedTypes.code-search | 137 +++------------------- 1 file changed, 15 insertions(+), 122 deletions(-) diff --git a/.vscode/searches/TrustedTypes.code-search b/.vscode/searches/TrustedTypes.code-search index 369b141ce3ca67..87510473f036e1 100644 --- a/.vscode/searches/TrustedTypes.code-search +++ b/.vscode/searches/TrustedTypes.code-search @@ -4,7 +4,7 @@ # Excluding: *.test.ts # ContextLines: 3 -39 results - 23 files +26 results - 15 files src/vs/base/browser/markdownRenderer.ts: 156 const strValue = values[0]; @@ -32,45 +32,6 @@ src/vs/base/browser/ui/contextview/contextview.ts: 162 ${SHADOW_ROOT_CSS} 163 -src/vs/base/browser/ui/menu/menu.ts: - 229 private initializeStyleSheet(container: HTMLElement): void { - 230 if (isInShadowDOM(container)) { - 231 this.styleSheet = createStyleSheet(container); - 232: this.styleSheet.innerHTML = MENU_WIDGET_CSS; - 233 } else { - 234 if (!Menu.globalStyleSheet) { - 235 Menu.globalStyleSheet = createStyleSheet(); - 236: Menu.globalStyleSheet.innerHTML = MENU_WIDGET_CSS; - 237 } - 238 - 239 this.styleSheet = Menu.globalStyleSheet; - -src/vs/base/browser/ui/selectBox/selectBoxCustom.ts: - 367 content.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { outline: none !important; }`); - 368 } - 369 - 370: this.styleElement.innerHTML = content.join('\n'); - 371 - 372 this.applyStyles(); - 373 } - - 680 }); - 681 - 682 - 683: container.innerHTML = this.options[longest].text + (!!this.options[longest].decoratorRight ? (this.options[longest].decoratorRight + ' ') : ''); - 684 elementWidth = dom.getTotalWidth(container); - 685 } - 686 - -src/vs/base/parts/quickinput/browser/quickInput.ts: - 1693 } - 1694 const newStyles = content.join('\n'); - 1695 if (newStyles !== this.ui.styleSheet.innerHTML) { - 1696: this.ui.styleSheet.innerHTML = newStyles; - 1697 } - 1698 } - 1699 } - src/vs/code/electron-browser/workbench/workbench.js: 124 const style = document.createElement('style'); 125 style.className = 'initialShellColors'; @@ -114,21 +75,13 @@ src/vs/code/electron-sandbox/issue/issueReporterMain.ts: 250 } src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts: - 282 this.listeners.clear(); - 283 - 284 const tableHead = document.createElement('thead'); - 285: tableHead.innerHTML = ` - 286 ${localize('cpu', "CPU %")} - 287 ${localize('memory', "Memory (MB)")} - 288 ${localize('pid', "PID")} - - 319 content.push(`.highest { color: ${styles.highlightForeground}; }`); - 320 } - 321 - 322: styleTag.innerHTML = content.join('\n'); - 323 if (document.head) { - 324 document.head.appendChild(styleTag); - 325 } + 320 content.push(`.highest { color: ${styles.highlightForeground}; }`); + 321 } + 322 + 323: styleTag.innerHTML = content.join('\n'); + 324 if (document.head) { + 325 document.head.appendChild(styleTag); + 326 } src/vs/editor/browser/view/domLineBreaksComputer.ts: 107 allCharOffsets[i] = tmp[0]; @@ -221,41 +174,6 @@ src/vs/editor/test/browser/controller/imeTester.ts: 74 75 let startBtn = document.createElement('button'); -src/vs/workbench/contrib/comments/browser/commentsView.ts: - 109 content.push(`.comments-panel .comments-panel-container .text code { color: ${codeTextForegroundColor}; }`); - 110 } - 111 - 112: styleElement.innerHTML = content.join('\n'); - 113 } - 114 - 115 private async renderComments(): Promise { - -src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts: - 692 } - 693 - 694 if (label) { - 695: this._headingLabel.innerHTML = strings.escape(label); - 696 this._headingLabel.setAttribute('aria-label', label); - 697 } - 698 } - - 916 font-weight: ${fontInfo.fontWeight}; - 917 }`); - 918 - 919: this._styleElement.innerHTML = content.join('\n'); - 920 - 921 // Editor decorations should also be responsive to theme changes - 922 this.setCommentEditorDecorations(); - -src/vs/workbench/contrib/debug/browser/repl.ts: - 306 const replInputLineHeight = this.replInput.getOption(EditorOption.lineHeight); - 307 - 308 // Set the font size, font family, line height and align the twistie to be centered, and input theme color - 309: this.styleElement.innerHTML = ` - 310 .repl .repl-tree .expression { - 311 font-size: ${fontSize}px; - 312 font-family: ${fontFamily}; - src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts: 454 455 private getMarkdownDragImage(templateData: MarkdownCellRenderTemplate): HTMLElement { @@ -265,21 +183,13 @@ src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts: 459 // Remove all rendered content nodes after the 460 const markdownContent = dragImageContainer.querySelector('.cell.markdown')!; - 598 - 599 private getDragImageImpl(templateData: BaseCellRenderTemplate, editor: ICodeEditor, type: 'code' | 'markdown'): HTMLElement | null { - 600 const dragImageContainer = DOM.$(`.cell-drag-image.monaco-list-row.focused.${type}-cell-row`); - 601: dragImageContainer.innerHTML = templateData.container.innerHTML; - 602 - 603 const editorContainer = dragImageContainer.querySelector('.cell-editor-container'); - 604 if (!editorContainer) { - - 610 return null; - 611 } - 612 - 613: editorContainer.innerHTML = richEditorText; - 614 - 615 return dragImageContainer; - 616 } + 611 return null; + 612 } + 613 + 614: editorContainer.innerHTML = richEditorText; + 615 + 616 return dragImageContainer; + 617 } src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts: 375 addMouseoverListeners(outputNode, outputId); @@ -290,14 +200,6 @@ src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts: 380 domEval(outputNode); 381 } else { -src/vs/workbench/contrib/webview/browser/webviewIconManager.ts: - 61 } - 62 } - 63 } - 64: this._styleElement.innerHTML = cssRules.join('\n'); - 65 } - 66 } - src/vs/workbench/contrib/webview/browser/pre/main.js: 386 // apply default styles 387 const defaultStyles = newDocument.createElement('style'); @@ -307,15 +209,6 @@ src/vs/workbench/contrib/webview/browser/pre/main.js: 391 392 applyStyles(newDocument, newDocument.body); -src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts: - 328 - 329 const prodName = container.querySelector('.welcomePage .title .caption') as HTMLElement; - 330 if (prodName) { - 331: prodName.innerHTML = this.productService.nameLong; - 332 } - 333 - 334 recentlyOpened.then(({ workspaces }) => { - src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts: 281 282 const content = model.main.textEditorModel.getValue(EndOfLinePreference.LF); From a46ba1f84c7fefbb08106d8013d0c513ba2754de Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 11 Sep 2020 10:26:38 +0200 Subject: [PATCH 29/55] :up: web playground --- resources/web/code-web.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/web/code-web.js b/resources/web/code-web.js index 450e2c0159fb28..e0742e5f83867b 100644 --- a/resources/web/code-web.js +++ b/resources/web/code-web.js @@ -28,7 +28,7 @@ const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'built const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions'); const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html'); -const WEB_PLAYGROUND_VERSION = '0.0.8'; +const WEB_PLAYGROUND_VERSION = '0.0.9'; const args = minimist(process.argv, { boolean: [ From 3994ae4c9ec6ee6ec5ee57592f54c66a844ccdc1 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 11 Sep 2020 10:29:31 +0200 Subject: [PATCH 30/55] Trusted types - don't use innerHTML for rapid render, https://github.com/microsoft/vscode/issues/106395 --- .../electron-browser/workbench/workbench.js | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index f44b74ffc7dc3a..821e9b29253a64 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -124,7 +124,7 @@ function showPartsSplash(configuration) { const style = document.createElement('style'); style.className = 'initialShellColors'; document.head.appendChild(style); - style.innerHTML = `body { background-color: ${shellBackground}; color: ${shellForeground}; margin: 0; padding: 0; }`; + style.textContent = `body { background-color: ${shellBackground}; color: ${shellForeground}; margin: 0; padding: 0; }`; if (data && data.layoutInfo) { // restore parts if possible (we might not always store layout info) @@ -148,22 +148,29 @@ function showPartsSplash(configuration) { // ensure there is enough space layoutInfo.sideBarWidth = Math.min(layoutInfo.sideBarWidth, window.innerWidth - (layoutInfo.activityBarWidth + layoutInfo.editorPartMinWidth)); + // part: title + const titleDiv = document.createElement('div'); + titleDiv.setAttribute('style', `position: absolute; width: 100%; left: 0; top: 0; height: ${layoutInfo.titleBarHeight}px; background-color: ${colorInfo.titleBarBackground}; -webkit-app-region: drag;`); + splash.appendChild(titleDiv); + + // part: activity bar + const activityDiv = document.createElement('div'); + activityDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: 0; width: ${layoutInfo.activityBarWidth}px; background-color: ${colorInfo.activityBarBackground};`); + splash.appendChild(activityDiv); + + // part: side bar (only when opening workspace/folder) if (configuration.folderUri || configuration.workspace) { // folder or workspace -> status bar color, sidebar - splash.innerHTML = ` -
-
-
-
- `; - } else { - // empty -> speical status bar color, no sidebar - splash.innerHTML = ` -
-
-
- `; + const sideDiv = document.createElement('div'); + sideDiv.setAttribute('style', `position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: ${layoutInfo.activityBarWidth}px; width: ${layoutInfo.sideBarWidth}px; background-color: ${colorInfo.sideBarBackground};`); + splash.appendChild(sideDiv); } + + // part: statusbar + const statusDiv = document.createElement('div'); + statusDiv.setAttribute('style', `position: absolute; width: 100%; bottom: 0; left: 0; height: ${layoutInfo.statusBarHeight}px; background-color: ${configuration.folderUri || configuration.workspace ? colorInfo.statusBarBackground : colorInfo.statusBarNoFolderBackground};`); + splash.appendChild(statusDiv); + document.body.appendChild(splash); } From 8e12a92976c6c853995632ffc0e30616019a2974 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 11 Sep 2020 10:33:33 +0200 Subject: [PATCH 31/55] Remove Schemas.vscodeRemote from simple file dialog --- src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts b/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts index e12556d03d1722..fdad20143b71b6 100644 --- a/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts +++ b/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts @@ -108,7 +108,7 @@ export class SimpleFileDialog { private remoteAuthority: string | undefined; private requiresTrailing: boolean = false; private trailing: string | undefined; - protected scheme: string = Schemas.vscodeRemote; + protected scheme: string; private contextKey: IContextKey; private userEnteredPathSegment: string = ''; private autoCompletePathSegment: string = ''; @@ -141,6 +141,7 @@ export class SimpleFileDialog { ) { this.remoteAuthority = this.environmentService.configuration.remoteAuthority; this.contextKey = RemoteFileDialogContext.bindTo(contextKeyService); + this.scheme = this.pathService.defaultUriScheme; } set busy(busy: boolean) { From 13aca0a170f12a37193614568386631ea59a2712 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 11 Sep 2020 11:40:05 +0200 Subject: [PATCH 32/55] debt - remove some any casts from window --- src/vs/base/browser/dom.ts | 6 +++--- src/vs/editor/browser/controller/pointerHandler.ts | 6 +++--- .../workbench/services/themes/browser/fileIconThemeData.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index fe50083857a1cb..fc835c5129f15b 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -410,9 +410,9 @@ export function getClientArea(element: HTMLElement): Dimension { } // If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight - if (platform.isIOS && (window).visualViewport) { - const width = (window).visualViewport.width; - const height = (window).visualViewport.height - ( + if (platform.isIOS && window.visualViewport) { + const width = window.visualViewport.width; + const height = window.visualViewport.height - ( browser.isStandalone // in PWA mode, the visual viewport always includes the safe-area-inset-bottom (which is for the home indicator) // even when you are using the onscreen monitor, the visual viewport will include the area between system statusbar and the onscreen keyboard diff --git a/src/vs/editor/browser/controller/pointerHandler.ts b/src/vs/editor/browser/controller/pointerHandler.ts index 2b930bb846167b..83fd67d6fd830c 100644 --- a/src/vs/editor/browser/controller/pointerHandler.ts +++ b/src/vs/editor/browser/controller/pointerHandler.ts @@ -50,7 +50,7 @@ class StandardPointerHandler extends MouseHandler implements IDisposable { this._installGestureHandlerTimeout = -1; // TODO@Alex: replace the usage of MSGesture here with something that works across all browsers - if ((window).MSGesture) { + if (window.MSGesture) { const touchGesture = new MSGesture(); const penGesture = new MSGesture(); touchGesture.target = this.viewHelper.linesContentDomNode; @@ -226,9 +226,9 @@ export class PointerHandler extends Disposable { super(); if ((platform.isIOS && BrowserFeatures.pointerEvents)) { this.handler = this._register(new PointerEventHandler(context, viewController, viewHelper)); - } else if ((window).TouchEvent) { + } else if (window.TouchEvent) { this.handler = this._register(new TouchHandler(context, viewController, viewHelper)); - } else if (window.navigator.pointerEnabled || (window).PointerEvent) { + } else if (window.navigator.pointerEnabled || window.PointerEvent) { this.handler = this._register(new StandardPointerHandler(context, viewController, viewHelper)); } else { this.handler = this._register(new MouseHandler(context, viewController, viewHelper)); diff --git a/src/vs/workbench/services/themes/browser/fileIconThemeData.ts b/src/vs/workbench/services/themes/browser/fileIconThemeData.ts index a2ff7a5513ed38..e5fe74b3a85269 100644 --- a/src/vs/workbench/services/themes/browser/fileIconThemeData.ts +++ b/src/vs/workbench/services/themes/browser/fileIconThemeData.ts @@ -377,5 +377,5 @@ function _processIconThemeDocument(id: string, iconThemeDocumentLocation: URI, i return result; } function escapeCSS(str: string) { - return (window)['CSS'].escape(str); + return window.CSS.escape(str); } From 1f1ac9a2a3e29a5f4d9a5fceb69116acfa4f25ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 11 Sep 2020 12:45:54 +0200 Subject: [PATCH 33/55] update distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b89236e2944336..70614a6bf86ed3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.50.0", - "distro": "3729948d337954299b7e3b183f66034d51e4ad69", + "distro": "fd69c0b76c1d86e5ea0c8651f87571091fab2c22", "author": { "name": "Microsoft Corporation" }, @@ -193,4 +193,4 @@ "windows-mutex": "0.3.0", "windows-process-tree": "0.2.4" } -} +} \ No newline at end of file From bea7a2334e462b8fcb62d56a987035b2887cf21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 11 Sep 2020 13:13:08 +0200 Subject: [PATCH 34/55] fix linux build --- resources/linux/rpm/code.spec.template | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index 617010d81b84b5..bb08834cc146e9 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -20,6 +20,7 @@ mkdir -p %{buildroot}/usr/share/applications mkdir -p %{buildroot}/usr/share/pixmaps mkdir -p %{buildroot}/usr/share/bash-completion/completions mkdir -p %{buildroot}/usr/share/zsh/site-functions +mkdir -p %{buildroot}/usr/share/mime/packages cp -r usr/share/@@NAME@@/* %{buildroot}/usr/share/@@NAME@@ cp -r usr/share/applications/@@NAME@@.desktop %{buildroot}/usr/share/applications cp -r usr/share/applications/@@NAME@@-url-handler.desktop %{buildroot}/usr/share/applications From bc38b0accb3c62180317c63dbe7323200977db0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Fri, 11 Sep 2020 13:55:29 +0200 Subject: [PATCH 35/55] argh --- resources/linux/rpm/code.spec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template index bb08834cc146e9..3407d4a0c51e86 100644 --- a/resources/linux/rpm/code.spec.template +++ b/resources/linux/rpm/code.spec.template @@ -65,7 +65,7 @@ update-mime-database /usr/share/mime &> /dev/null || : /usr/share/@@NAME@@/ /usr/share/applications/@@NAME@@.desktop /usr/share/applications/@@NAME@@-url-handler.desktop -/usr/share/mime/packages/@@NAME-workspace.xml +/usr/share/mime/packages/@@NAME@@-workspace.xml /usr/share/pixmaps/@@ICON@@.png /usr/share/bash-completion/completions/@@NAME@@ /usr/share/zsh/site-functions/_@@NAME@@ From 1fccb9e58c7b03f218ccab2124b0262b1d1bcb9a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 11 Sep 2020 14:54:03 +0200 Subject: [PATCH 36/55] proxy authentication does not work on 1.49 (#106434) --- src/vs/code/electron-main/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts index ad6c47e5a31390..dd0d67ae21e5d0 100644 --- a/src/vs/code/electron-main/auth.ts +++ b/src/vs/code/electron-main/auth.ts @@ -93,9 +93,9 @@ export class ProxyAuthHandler extends Disposable { if (channel === 'vscode:proxyAuthResponse') { const { username, password } = credentials; cb(username, password); + win.removeListener('close', onWindowClose); + win.close(); } - win.removeListener('close', onWindowClose); - win.close(); }); win.loadURL(url); } From 292001621a300b10be5f1eff0225db5e37cb198b Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 11 Sep 2020 17:01:45 +0200 Subject: [PATCH 37/55] do not use hasClass and first #103454 --- .../browser/debugConfigurationManager.ts | 4 +- .../debug/browser/debugEditorContribution.ts | 3 +- .../workbench/contrib/debug/browser/repl.ts | 3 +- .../contrib/debug/common/debugModel.ts | 4 +- .../debugANSIHandling.test.ts | 97 +++++++++---------- .../files/browser/views/explorerViewer.ts | 4 +- 6 files changed, 56 insertions(+), 59 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts index ee4b7b6ec245b7..cc245009912d37 100644 --- a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts @@ -37,7 +37,7 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cance import { withUndefinedAsNull } from 'vs/base/common/types'; import { sequence } from 'vs/base/common/async'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; -import { first, flatten } from 'vs/base/common/arrays'; +import { flatten } from 'vs/base/common/arrays'; import { getVisibleAndSorted } from 'vs/workbench/contrib/debug/common/debugUtils'; import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes'; @@ -518,7 +518,7 @@ export class ConfigurationManager implements IConfigurationManager { const rootUri = this.historyService.getLastActiveWorkspaceRoot(); launch = this.getLaunch(rootUri); if (!launch || launch.getConfigurationNames().length === 0) { - launch = first(this.launches, l => !!(l && l.getConfigurationNames().length), launch) || this.launches[0]; + launch = this.launches.find(l => !!(l && l.getConfigurationNames().length)) || launch || this.launches[0]; } } diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts index b8d3efa299b1fb..a2c9b9a3164342 100644 --- a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts @@ -26,7 +26,6 @@ import { ExceptionWidget } from 'vs/workbench/contrib/debug/browser/exceptionWid import { FloatingClickWidget } from 'vs/workbench/browser/parts/editor/editorWidgets'; import { Position } from 'vs/editor/common/core/position'; import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands'; -import { first } from 'vs/base/common/arrays'; import { memoize, createMemoizer } from 'vs/base/common/decorators'; import { IEditorHoverOptions, EditorOption } from 'vs/editor/common/config/editorOptions'; import { DebugHoverWidget } from 'vs/workbench/contrib/debug/browser/debugHover'; @@ -373,7 +372,7 @@ export class DebugEditorContribution implements IDebugEditorContribution { } // First call stack frame that is available is the frame where exception has been thrown - const exceptionSf = first(callStack, sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize'), undefined); + const exceptionSf = callStack.find(sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize')); if (!exceptionSf || exceptionSf !== focusedSf) { this.closeExceptionWidget(); return; diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index ae1a5b16013668..bdef5e66cf2724 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -37,7 +37,6 @@ import { transparent, editorForeground } from 'vs/platform/theme/common/colorReg import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems'; import { CompletionContext, CompletionList, CompletionProviderRegistry, CompletionItem, completionKindFromString, CompletionItemKind, CompletionItemInsertTextRule } from 'vs/editor/common/modes'; -import { first } from 'vs/base/common/arrays'; import { ITreeNode, ITreeContextMenuEvent, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; @@ -360,7 +359,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { if (focusedSession) { session = focusedSession; } else if (!treeInput || sessionsToIgnore.has(treeInput)) { - session = first(this.debugService.getModel().getSessions(true), s => !sessionsToIgnore.has(s)) || undefined; + session = this.debugService.getModel().getSessions(true).find(s => !sessionsToIgnore.has(s)); } } if (session) { diff --git a/src/vs/workbench/contrib/debug/common/debugModel.ts b/src/vs/workbench/contrib/debug/common/debugModel.ts index 72a88b3ecd3dff..a76c411801f04d 100644 --- a/src/vs/workbench/contrib/debug/common/debugModel.ts +++ b/src/vs/workbench/contrib/debug/common/debugModel.ts @@ -10,7 +10,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { generateUuid } from 'vs/base/common/uuid'; import { RunOnceScheduler } from 'vs/base/common/async'; import { isString, isUndefinedOrNull } from 'vs/base/common/types'; -import { distinct, lastIndex, first } from 'vs/base/common/arrays'; +import { distinct, lastIndex } from 'vs/base/common/arrays'; import { Range, IRange } from 'vs/editor/common/core/range'; import { ITreeElement, IExpression, IExpressionContainer, IDebugSession, IStackFrame, IExceptionBreakpoint, IBreakpoint, IFunctionBreakpoint, IDebugModel, @@ -421,7 +421,7 @@ export class Thread implements IThread { } getTopStackFrame(): IStackFrame | undefined { - return first(this.getCallStack(), sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize'), undefined); + return this.getCallStack().find(sf => !!(sf && sf.source && sf.source.available && sf.source.presentationHint !== 'deemphasize')); } get stateLabel(): string { diff --git a/src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts index abe90db10c1f29..fbf28920af5c24 100644 --- a/src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts +++ b/src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import * as dom from 'vs/base/browser/dom'; import { generateUuid } from 'vs/base/common/uuid'; import { appendStylizedStringToContainer, handleANSIOutput, calcANSI8bitColor } from 'vs/workbench/contrib/debug/browser/debugANSIHandling'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; @@ -58,8 +57,8 @@ suite('Debug - ANSI Handling', () => { child = root.firstChild!; if (child instanceof HTMLSpanElement) { assert.equal('content1', child.textContent); - assert(dom.hasClass(child, 'class1')); - assert(dom.hasClass(child, 'class2')); + assert(child.classList.contains('class1')); + assert(child.classList.contains('class2')); } else { assert.fail('Unexpected assertion error'); } @@ -67,8 +66,8 @@ suite('Debug - ANSI Handling', () => { child = root.lastChild!; if (child instanceof HTMLSpanElement) { assert.equal('content2', child.textContent); - assert(dom.hasClass(child, 'class2')); - assert(dom.hasClass(child, 'class3')); + assert(child.classList.contains('class2')); + assert(child.classList.contains('class3')); } else { assert.fail('Unexpected assertion error'); } @@ -143,17 +142,17 @@ suite('Debug - ANSI Handling', () => { // Bold code assertSingleSequenceElement('\x1b[1m', (child) => { - assert(dom.hasClass(child, 'code-bold'), 'Bold formatting not detected after bold ANSI code.'); + assert(child.classList.contains('code-bold'), 'Bold formatting not detected after bold ANSI code.'); }); // Italic code assertSingleSequenceElement('\x1b[3m', (child) => { - assert(dom.hasClass(child, 'code-italic'), 'Italic formatting not detected after italic ANSI code.'); + assert(child.classList.contains('code-italic'), 'Italic formatting not detected after italic ANSI code.'); }); // Underline code assertSingleSequenceElement('\x1b[4m', (child) => { - assert(dom.hasClass(child, 'code-underline'), 'Underline formatting not detected after underline ANSI code.'); + assert(child.classList.contains('code-underline'), 'Underline formatting not detected after underline ANSI code.'); }); for (let i = 30; i <= 37; i++) { @@ -161,12 +160,12 @@ suite('Debug - ANSI Handling', () => { // Foreground colour class assertSingleSequenceElement('\x1b[' + i + 'm', (child) => { - assert(dom.hasClass(child, customClassName), `Custom foreground class not found on element after foreground ANSI code #${i}.`); + assert(child.classList.contains(customClassName), `Custom foreground class not found on element after foreground ANSI code #${i}.`); }); // Cancellation code removes colour class assertSingleSequenceElement('\x1b[' + i + ';39m', (child) => { - assert(dom.hasClass(child, customClassName) === false, 'Custom foreground class still found after foreground cancellation code.'); + assert(child.classList.contains(customClassName) === false, 'Custom foreground class still found after foreground cancellation code.'); assertInlineColor(child, 'foreground', undefined, 'Custom color style still found after foreground cancellation code.'); }); } @@ -176,12 +175,12 @@ suite('Debug - ANSI Handling', () => { // Foreground colour class assertSingleSequenceElement('\x1b[' + i + 'm', (child) => { - assert(dom.hasClass(child, customClassName), `Custom background class not found on element after background ANSI code #${i}.`); + assert(child.classList.contains(customClassName), `Custom background class not found on element after background ANSI code #${i}.`); }); // Cancellation code removes colour class assertSingleSequenceElement('\x1b[' + i + ';49m', (child) => { - assert(dom.hasClass(child, customClassName) === false, 'Custom background class still found after background cancellation code.'); + assert(child.classList.contains(customClassName) === false, 'Custom background class still found after background cancellation code.'); assertInlineColor(child, 'foreground', undefined, 'Custom color style still found after background cancellation code.'); }); } @@ -190,31 +189,31 @@ suite('Debug - ANSI Handling', () => { assertSingleSequenceElement('\x1b[1;3;4;30;41m', (child) => { assert.equal(5, child.classList.length, 'Incorrect number of classes found for different ANSI codes.'); - assert(dom.hasClass(child, 'code-bold')); - assert(dom.hasClass(child, 'code-italic'), 'Different ANSI codes should not cancel each other.'); - assert(dom.hasClass(child, 'code-underline'), 'Different ANSI codes should not cancel each other.'); - assert(dom.hasClass(child, 'code-foreground-colored'), 'Different ANSI codes should not cancel each other.'); - assert(dom.hasClass(child, 'code-background-colored'), 'Different ANSI codes should not cancel each other.'); + assert(child.classList.contains('code-bold')); + assert(child.classList.contains('code-italic'), 'Different ANSI codes should not cancel each other.'); + assert(child.classList.contains('code-underline'), 'Different ANSI codes should not cancel each other.'); + assert(child.classList.contains('code-foreground-colored'), 'Different ANSI codes should not cancel each other.'); + assert(child.classList.contains('code-background-colored'), 'Different ANSI codes should not cancel each other.'); }); // New foreground codes don't remove old background codes and vice versa assertSingleSequenceElement('\x1b[40;31;42;33m', (child) => { assert.equal(2, child.classList.length); - assert(dom.hasClass(child, 'code-background-colored'), 'New foreground ANSI code should not cancel existing background formatting.'); - assert(dom.hasClass(child, 'code-foreground-colored'), 'New background ANSI code should not cancel existing foreground formatting.'); + assert(child.classList.contains('code-background-colored'), 'New foreground ANSI code should not cancel existing background formatting.'); + assert(child.classList.contains('code-foreground-colored'), 'New background ANSI code should not cancel existing foreground formatting.'); }); // Duplicate codes do not change output assertSingleSequenceElement('\x1b[1;1;4;1;4;4;1;4m', (child) => { - assert(dom.hasClass(child, 'code-bold'), 'Duplicate formatting codes should have no effect.'); - assert(dom.hasClass(child, 'code-underline'), 'Duplicate formatting codes should have no effect.'); + assert(child.classList.contains('code-bold'), 'Duplicate formatting codes should have no effect.'); + assert(child.classList.contains('code-underline'), 'Duplicate formatting codes should have no effect.'); }); // Extra terminating semicolon does not change output assertSingleSequenceElement('\x1b[1;4;m', (child) => { - assert(dom.hasClass(child, 'code-bold'), 'Extra semicolon after ANSI codes should have no effect.'); - assert(dom.hasClass(child, 'code-underline'), 'Extra semicolon after ANSI codes should have no effect.'); + assert(child.classList.contains('code-bold'), 'Extra semicolon after ANSI codes should have no effect.'); + assert(child.classList.contains('code-underline'), 'Extra semicolon after ANSI codes should have no effect.'); }); // Cancellation code removes multiple codes @@ -232,12 +231,12 @@ suite('Debug - ANSI Handling', () => { // As these are controlled by theme, difficult to check actual color value // Foreground codes should add standard classes assertSingleSequenceElement('\x1b[38;5;' + i + 'm', (child) => { - assert(dom.hasClass(child, 'code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); + assert(child.classList.contains('code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); }); // Background codes should add standard classes assertSingleSequenceElement('\x1b[48;5;' + i + 'm', (child) => { - assert(dom.hasClass(child, 'code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); + assert(child.classList.contains('code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); }); } @@ -245,13 +244,13 @@ suite('Debug - ANSI Handling', () => { for (let i = 16; i <= 255; i++) { // Foreground codes should add custom class and inline style assertSingleSequenceElement('\x1b[38;5;' + i + 'm', (child) => { - assert(dom.hasClass(child, 'code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); + assert(child.classList.contains('code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); assertInlineColor(child, 'foreground', (calcANSI8bitColor(i) as RGBA), `Incorrect or no color styling found after foreground 8-bit color code 38;5;${i}`); }); // Background codes should add custom class and inline style assertSingleSequenceElement('\x1b[48;5;' + i + 'm', (child) => { - assert(dom.hasClass(child, 'code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); + assert(child.classList.contains('code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); assertInlineColor(child, 'background', (calcANSI8bitColor(i) as RGBA), `Incorrect or no color styling found after background 8-bit color code 48;5;${i}`); }); } @@ -263,7 +262,7 @@ suite('Debug - ANSI Handling', () => { // Should ignore any codes after the ones needed to determine color assertSingleSequenceElement('\x1b[48;5;100;42;77;99;4;24m', (child) => { - assert(dom.hasClass(child, 'code-background-colored')); + assert(child.classList.contains('code-background-colored')); assert.equal(1, child.classList.length); assertInlineColor(child, 'background', (calcANSI8bitColor(100) as RGBA)); }); @@ -277,13 +276,13 @@ suite('Debug - ANSI Handling', () => { let color = new RGBA(r, g, b); // Foreground codes should add class and inline style assertSingleSequenceElement(`\x1b[38;2;${r};${g};${b}m`, (child) => { - assert(dom.hasClass(child, 'code-foreground-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); + assert(child.classList.contains('code-foreground-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); assertInlineColor(child, 'foreground', color); }); // Background codes should add class and inline style assertSingleSequenceElement(`\x1b[48;2;${r};${g};${b}m`, (child) => { - assert(dom.hasClass(child, 'code-background-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); + assert(child.classList.contains('code-background-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); assertInlineColor(child, 'background', color); }); } @@ -303,7 +302,7 @@ suite('Debug - ANSI Handling', () => { // Should ignore any codes after the ones needed to determine color assertSingleSequenceElement('\x1b[48;2;100;42;77;99;200;75m', (child) => { - assert(dom.hasClass(child, 'code-background-colored'), `Color code with extra (valid) items "48;2;100;42;77;99;200;75" should still treat initial part as valid code and add class "code-background-custom".`); + assert(child.classList.contains('code-background-colored'), `Color code with extra (valid) items "48;2;100;42;77;99;200;75" should still treat initial part as valid code and add class "code-background-custom".`); assert.equal(1, child.classList.length, `Color code with extra items "48;2;100;42;77;99;200;75" should add one and only one class. (classes found: ${child.classList}).`); assertInlineColor(child, 'background', new RGBA(100, 42, 77), `Color code "48;2;100;42;77;99;200;75" should style background-color as rgb(100,42,77).`); }); @@ -337,35 +336,35 @@ suite('Debug - ANSI Handling', () => { // Multiple codes affect the same text assertSingleSequenceElement('\x1b[1m\x1b[3m\x1b[4m\x1b[32m', (child) => { - assert(dom.hasClass(child, 'code-bold'), 'Bold class not found after multiple different ANSI codes.'); - assert(dom.hasClass(child, 'code-italic'), 'Italic class not found after multiple different ANSI codes.'); - assert(dom.hasClass(child, 'code-underline'), 'Underline class not found after multiple different ANSI codes.'); - assert(dom.hasClass(child, 'code-foreground-colored'), 'Foreground color class not found after multiple different ANSI codes.'); + assert(child.classList.contains('code-bold'), 'Bold class not found after multiple different ANSI codes.'); + assert(child.classList.contains('code-italic'), 'Italic class not found after multiple different ANSI codes.'); + assert(child.classList.contains('code-underline'), 'Underline class not found after multiple different ANSI codes.'); + assert(child.classList.contains('code-foreground-colored'), 'Foreground color class not found after multiple different ANSI codes.'); }); // Consecutive codes do not affect previous ones assertMultipleSequenceElements('\x1b[1mbold\x1b[32mgreen\x1b[4munderline\x1b[3mitalic\x1b[0mnothing', [ (bold) => { assert.equal(1, bold.classList.length); - assert(dom.hasClass(bold, 'code-bold'), 'Bold class not found after bold ANSI code.'); + assert(bold.classList.contains('code-bold'), 'Bold class not found after bold ANSI code.'); }, (green) => { assert.equal(2, green.classList.length); - assert(dom.hasClass(green, 'code-bold'), 'Bold class not found after both bold and color ANSI codes.'); - assert(dom.hasClass(green, 'code-foreground-colored'), 'Color class not found after color ANSI code.'); + assert(green.classList.contains('code-bold'), 'Bold class not found after both bold and color ANSI codes.'); + assert(green.classList.contains('code-foreground-colored'), 'Color class not found after color ANSI code.'); }, (underline) => { assert.equal(3, underline.classList.length); - assert(dom.hasClass(underline, 'code-bold'), 'Bold class not found after bold, color, and underline ANSI codes.'); - assert(dom.hasClass(underline, 'code-foreground-colored'), 'Color class not found after color and underline ANSI codes.'); - assert(dom.hasClass(underline, 'code-underline'), 'Underline class not found after underline ANSI code.'); + assert(underline.classList.contains('code-bold'), 'Bold class not found after bold, color, and underline ANSI codes.'); + assert(underline.classList.contains('code-foreground-colored'), 'Color class not found after color and underline ANSI codes.'); + assert(underline.classList.contains('code-underline'), 'Underline class not found after underline ANSI code.'); }, (italic) => { assert.equal(4, italic.classList.length); - assert(dom.hasClass(italic, 'code-bold'), 'Bold class not found after bold, color, underline, and italic ANSI codes.'); - assert(dom.hasClass(italic, 'code-foreground-colored'), 'Color class not found after color, underline, and italic ANSI codes.'); - assert(dom.hasClass(italic, 'code-underline'), 'Underline class not found after underline and italic ANSI codes.'); - assert(dom.hasClass(italic, 'code-italic'), 'Italic class not found after italic ANSI code.'); + assert(italic.classList.contains('code-bold'), 'Bold class not found after bold, color, underline, and italic ANSI codes.'); + assert(italic.classList.contains('code-foreground-colored'), 'Color class not found after color, underline, and italic ANSI codes.'); + assert(italic.classList.contains('code-underline'), 'Underline class not found after underline and italic ANSI codes.'); + assert(italic.classList.contains('code-italic'), 'Italic class not found after italic ANSI code.'); }, (nothing) => { assert.equal(0, nothing.classList.length, 'One or more style classes still found after reset ANSI code.'); @@ -376,21 +375,21 @@ suite('Debug - ANSI Handling', () => { assertMultipleSequenceElements('\x1b[34msimple\x1b[38;2;100;100;100m24bit\x1b[38;5;3m8bitsimple\x1b[38;5;101m8bitadvanced', [ (simple) => { assert.equal(1, simple.classList.length, 'Foreground ANSI color code should add one class.'); - assert(dom.hasClass(simple, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + assert(simple.classList.contains('code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); }, (adv24Bit) => { assert.equal(1, adv24Bit.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); - assert(dom.hasClass(adv24Bit, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + assert(adv24Bit.classList.contains('code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); assertInlineColor(adv24Bit, 'foreground', new RGBA(100, 100, 100), '24-bit RGBA ANSI color code (100,100,100) should add matching color inline style.'); }, (adv8BitSimple) => { assert.equal(1, adv8BitSimple.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); - assert(dom.hasClass(adv8BitSimple, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + assert(adv8BitSimple.classList.contains('code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); // Won't assert color because it's theme based }, (adv8BitAdvanced) => { assert.equal(1, adv8BitAdvanced.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); - assert(dom.hasClass(adv8BitAdvanced, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + assert(adv8BitAdvanced.classList.contains('code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); } ], 4); diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index 9700ce94e9afcd..fc91b8bfcf213a 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -1456,8 +1456,8 @@ function getIconLabelNameFromHTMLElement(target: HTMLElement | EventTarget | Ele let element: HTMLElement | null = target; - while (element && !DOM.hasClass(element, 'monaco-list-row')) { - if (DOM.hasClass(element, 'label-name') && element.hasAttribute('data-icon-label-count')) { + while (element && !element.classList.contains('monaco-list-row')) { + if (element.classList.contains('label-name') && element.hasAttribute('data-icon-label-count')) { const count = Number(element.getAttribute('data-icon-label-count')); const index = Number(element.getAttribute('data-icon-label-index')); From 93c96b63c0ad62ac9d9c1dc5a76763c2786f9300 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 11 Sep 2020 17:19:56 +0200 Subject: [PATCH 38/55] debug and explroer: do not use dom.addClass, dom.toggleClass --- .../contrib/debug/browser/baseDebugView.ts | 16 ++++++++-------- .../contrib/debug/browser/breakpointsView.ts | 14 +++++++------- .../contrib/debug/browser/callStackView.ts | 18 +++++++++--------- .../debug/browser/debugActionViewItems.ts | 4 ++-- .../contrib/debug/browser/debugToolBar.ts | 4 ++-- .../contrib/debug/browser/debugViewlet.ts | 3 +-- .../contrib/debug/browser/loadedScriptsView.ts | 7 +++---- src/vs/workbench/contrib/debug/browser/repl.ts | 6 +++--- .../contrib/debug/browser/replFilter.ts | 2 +- .../contrib/debug/browser/replViewer.ts | 6 +++--- .../debug/browser/statusbarColorProvider.ts | 10 +++++----- .../contrib/debug/browser/variablesView.ts | 4 ++-- .../debug/browser/watchExpressionsView.ts | 5 ++--- .../contrib/files/browser/explorerViewlet.ts | 3 +-- .../files/browser/views/explorerView.ts | 12 ++++++------ .../files/browser/views/explorerViewer.ts | 16 ++++++++-------- .../files/browser/views/openEditorsView.ts | 10 +++++----- .../remote/browser/explorerViewItems.ts | 4 +--- 18 files changed, 69 insertions(+), 75 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts index 5d4be69a867c24..e449ec3836d4ed 100644 --- a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts +++ b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts @@ -43,7 +43,7 @@ export interface IVariableTemplateData { export function renderViewTree(container: HTMLElement): HTMLElement { const treeContainer = $('.'); - dom.addClass(treeContainer, 'debug-view-content'); + treeContainer.classList.add('debug-view-content'); container.appendChild(treeContainer); return treeContainer; } @@ -55,9 +55,9 @@ export function renderExpressionValue(expressionOrValue: IExpressionContainer | container.className = 'value'; // when resolving expressions we represent errors from the server as a variable with name === null. if (value === null || ((expressionOrValue instanceof Expression || expressionOrValue instanceof Variable || expressionOrValue instanceof ReplEvaluationResult) && !expressionOrValue.available)) { - dom.addClass(container, 'unavailable'); + container.classList.add('unavailable'); if (value !== Expression.DEFAULT_VALUE) { - dom.addClass(container, 'error'); + container.classList.add('error'); } } else if ((expressionOrValue instanceof ExpressionContainer) && options.showChanged && expressionOrValue.valueChanged && value !== Expression.DEFAULT_VALUE) { // value changed color has priority over other colors. @@ -67,13 +67,13 @@ export function renderExpressionValue(expressionOrValue: IExpressionContainer | if (options.colorize && typeof expressionOrValue !== 'string') { if (expressionOrValue.type === 'number' || expressionOrValue.type === 'boolean' || expressionOrValue.type === 'string') { - dom.addClass(container, expressionOrValue.type); + container.classList.add(expressionOrValue.type); } else if (!isNaN(+value)) { - dom.addClass(container, 'number'); + container.classList.add('number'); } else if (booleanRegex.test(value)) { - dom.addClass(container, 'boolean'); + container.classList.add('boolean'); } else if (stringRegex.test(value)) { - dom.addClass(container, 'string'); + container.classList.add('string'); } } @@ -103,7 +103,7 @@ export function renderVariable(variable: Variable, data: IVariableTemplateData, text += ':'; } data.label.set(text, highlights, variable.type ? variable.type : variable.name); - dom.toggleClass(data.name, 'virtual', !!variable.presentationHint && variable.presentationHint.kind === 'virtual'); + data.name.classList.toggle('virtual', !!variable.presentationHint && variable.presentationHint.kind === 'virtual'); } else if (variable.value && typeof variable.name === 'string' && variable.name) { data.label.set(':'); } diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index e2138294a00681..188205abf49024 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -86,8 +86,8 @@ export class BreakpointsView extends ViewPane { public renderBody(container: HTMLElement): void { super.renderBody(container); - dom.addClass(this.element, 'debug-pane'); - dom.addClass(container, 'debug-breakpoints'); + this.element.classList.add('debug-pane'); + container.classList.add('debug-breakpoints'); const delegate = new BreakpointsDelegate(this.debugService); this.list = >this.instantiationService.createInstance(WorkbenchList, 'Breakpoints', container, delegate, [ @@ -369,7 +369,7 @@ class BreakpointsRenderer implements IListRenderer, index: number, data: IStackFrameTemplateData): void { const stackFrame = element.element; - dom.toggleClass(data.stackFrame, 'disabled', !stackFrame.source || !stackFrame.source.available || isDeemphasized(stackFrame)); - dom.toggleClass(data.stackFrame, 'label', stackFrame.presentationHint === 'label'); - dom.toggleClass(data.stackFrame, 'subtle', stackFrame.presentationHint === 'subtle'); + data.stackFrame.classList.toggle('disabled', !stackFrame.source || !stackFrame.source.available || isDeemphasized(stackFrame)); + data.stackFrame.classList.toggle('label', stackFrame.presentationHint === 'label'); + data.stackFrame.classList.toggle('subtle', stackFrame.presentationHint === 'subtle'); const hasActions = !!stackFrame.thread.session.capabilities.supportsRestartFrame && stackFrame.presentationHint !== 'label' && stackFrame.presentationHint !== 'subtle'; - dom.toggleClass(data.stackFrame, 'has-actions', hasActions); + data.stackFrame.classList.toggle('has-actions', hasActions); data.file.title = stackFrame.source.inMemory ? stackFrame.source.uri.path : this.labelService.getUriLabel(stackFrame.source.uri); if (stackFrame.source.raw.origin) { @@ -648,9 +648,9 @@ class StackFramesRenderer implements ICompressibleTreeRenderer { if (this.action.enabled && e.button === 0) { - dom.addClass(this.start, 'active'); + this.start.classList.add('active'); } })); this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_UP, () => { diff --git a/src/vs/workbench/contrib/debug/browser/debugToolBar.ts b/src/vs/workbench/contrib/debug/browser/debugToolBar.ts index 7f60e726eef049..c91ad32759fd85 100644 --- a/src/vs/workbench/contrib/debug/browser/debugToolBar.ts +++ b/src/vs/workbench/contrib/debug/browser/debugToolBar.ts @@ -142,7 +142,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution { })); this._register(dom.addDisposableGenericMouseDownListner(this.dragArea, (event: MouseEvent) => { - dom.addClass(this.dragArea, 'dragged'); + this.dragArea.classList.add('dragged'); const mouseMoveListener = dom.addDisposableGenericMouseMoveListner(window, (e: MouseEvent) => { const mouseMoveEvent = new StandardMouseEvent(e); @@ -154,7 +154,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution { const mouseUpListener = dom.addDisposableGenericMouseUpListner(window, (e: MouseEvent) => { this.storePosition(); - dom.removeClass(this.dragArea, 'dragged'); + this.dragArea.classList.remove('dragged'); mouseMoveListener.dispose(); mouseUpListener.dispose(); diff --git a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts index 9496cfa18987bf..1d805139611c00 100644 --- a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts @@ -6,7 +6,6 @@ import 'vs/css!./media/debugViewlet'; import * as nls from 'vs/nls'; import { IAction, IActionViewItem } from 'vs/base/common/actions'; -import * as DOM from 'vs/base/browser/dom'; import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration, CONTEXT_DEBUG_UX, CONTEXT_DEBUG_UX_KEY, REPL_VIEW_ID } from 'vs/workbench/contrib/debug/common/debug'; import { StartAction, ConfigureAction, SelectAndStartAction, FocusSessionAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { StartDebugActionViewItem, FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems'; @@ -91,7 +90,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer { create(parent: HTMLElement): void { super.create(parent); - DOM.addClass(parent, 'debug-viewlet'); + parent.classList.add('debug-viewlet'); } focus(): void { diff --git a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts index ef585e084aa521..2181397cc6067a 100644 --- a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import * as dom from 'vs/base/browser/dom'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { normalize, isAbsolute, posix } from 'vs/base/common/path'; import { ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer'; @@ -441,9 +440,9 @@ export class LoadedScriptsView extends ViewPane { renderBody(container: HTMLElement): void { super.renderBody(container); - dom.addClass(this.element, 'debug-pane'); - dom.addClass(container, 'debug-loaded-scripts'); - dom.addClass(container, 'show-file-icons'); + this.element.classList.add('debug-pane'); + container.classList.add('debug-loaded-scripts'); + container.classList.add('show-file-icons'); this.treeContainer = renderViewTree(container); diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index bdef5e66cf2724..06620126115c58 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -534,7 +534,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { this.replDelegate = new ReplDelegate(this.configurationService); const wordWrap = this.configurationService.getValue('debug').console.wordWrap; - dom.toggleClass(treeContainer, 'word-wrap', wordWrap); + treeContainer.classList.toggle('word-wrap', wordWrap); const linkDetector = this.instantiationService.createInstance(LinkDetector); this.tree = >this.instantiationService.createInstance( WorkbenchAsyncDataTree, @@ -609,8 +609,8 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { this._register(this.replInput.onDidFocusEditorText(() => this.updateInputDecoration())); this._register(this.replInput.onDidBlurEditorText(() => this.updateInputDecoration())); - this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.FOCUS, () => dom.addClass(this.replInputContainer, 'synthetic-focus'))); - this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.BLUR, () => dom.removeClass(this.replInputContainer, 'synthetic-focus'))); + this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.FOCUS, () => this.replInputContainer.classList.add('synthetic-focus'))); + this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.BLUR, () => this.replInputContainer.classList.remove('synthetic-focus'))); } private onContextMenu(e: ITreeContextMenuEvent): void { diff --git a/src/vs/workbench/contrib/debug/browser/replFilter.ts b/src/vs/workbench/contrib/debug/browser/replFilter.ts index 7cfdef6dde960c..0aeb15472c1870 100644 --- a/src/vs/workbench/contrib/debug/browser/replFilter.ts +++ b/src/vs/workbench/contrib/debug/browser/replFilter.ts @@ -119,7 +119,7 @@ export class ReplFilterActionViewItem extends BaseActionViewItem { render(container: HTMLElement): void { this.container = container; - DOM.addClass(this.container, 'repl-panel-filter-container'); + this.container.classList.add('repl-panel-filter-container'); this.element = DOM.append(this.container, DOM.$('')); this.element.className = this.class; diff --git a/src/vs/workbench/contrib/debug/browser/replViewer.ts b/src/vs/workbench/contrib/debug/browser/replViewer.ts index 99b071635d41cd..4fbb33ebc605ba 100644 --- a/src/vs/workbench/contrib/debug/browser/replViewer.ts +++ b/src/vs/workbench/contrib/debug/browser/replViewer.ts @@ -147,7 +147,7 @@ export class ReplSimpleElementsRenderer implements ITreeRenderer element.sourceData; @@ -226,7 +226,7 @@ export class ReplRawObjectsRenderer implements ITreeRenderer>this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'VariablesView', treeContainer, new VariablesDelegate(), diff --git a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts index 9cf18480f2b426..6391f21d7ffb0e 100644 --- a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts +++ b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts @@ -5,7 +5,6 @@ import * as nls from 'vs/nls'; import { RunOnceScheduler } from 'vs/base/common/async'; -import * as dom from 'vs/base/browser/dom'; import { CollapseAction } from 'vs/workbench/browser/viewlet'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IDebugService, IExpression, CONTEXT_WATCH_EXPRESSIONS_FOCUSED } from 'vs/workbench/contrib/debug/common/debug'; @@ -68,8 +67,8 @@ export class WatchExpressionsView extends ViewPane { renderBody(container: HTMLElement): void { super.renderBody(container); - dom.addClass(this.element, 'debug-pane'); - dom.addClass(container, 'debug-watch'); + this.element.classList.add('debug-pane'); + container.classList.add('debug-watch'); const treeContainer = renderViewTree(container); const expressionsRenderer = this.instantiationService.createInstance(WatchExpressionsRenderer); diff --git a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts index 560a311196efc7..50567746fe9f62 100644 --- a/src/vs/workbench/contrib/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts @@ -5,7 +5,6 @@ import 'vs/css!./media/explorerviewlet'; import { localize } from 'vs/nls'; -import * as DOM from 'vs/base/browser/dom'; import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext, VIEW_ID } from 'vs/workbench/contrib/files/common/files'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; @@ -189,7 +188,7 @@ export class ExplorerViewPaneContainer extends ViewPaneContainer { create(parent: HTMLElement): void { super.create(parent); - DOM.addClass(parent, 'explorer-viewlet'); + parent.classList.add('explorer-viewlet'); } protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane { diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 07da7f744fda9f..75f19930b9ee3a 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -324,13 +324,13 @@ export class ExplorerView extends ViewPane { } this.horizontalScrolling = undefined; - DOM.removeClass(this.treeContainer, 'highlight'); + this.treeContainer.classList.remove('highlight'); } await this.refresh(false, stat.parent, false); if (isEditing) { - DOM.addClass(this.treeContainer, 'highlight'); + this.treeContainer.classList.add('highlight'); this.tree.reveal(stat); } else { this.tree.domFocus(); @@ -825,12 +825,12 @@ export class ExplorerView extends ViewPane { } function createFileIconThemableTreeContainerScope(container: HTMLElement, themeService: IThemeService): IDisposable { - DOM.addClass(container, 'file-icon-themable-tree'); - DOM.addClass(container, 'show-file-icons'); + container.classList.add('file-icon-themable-tree'); + container.classList.add('show-file-icons'); const onDidChangeFileIconTheme = (theme: IFileIconTheme) => { - DOM.toggleClass(container, 'align-icons-and-twisties', theme.hasFileIcons && !theme.hasFolderIcons); - DOM.toggleClass(container, 'hide-arrows', theme.hidesExplorerArrows === true); + container.classList.toggle('align-icons-and-twisties', theme.hasFileIcons && !theme.hasFolderIcons); + container.classList.toggle('hide-arrows', theme.hidesExplorerArrows === true); }; onDidChangeFileIconTheme(themeService.getFileIconTheme()); diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index fc91b8bfcf213a..e06fc13446c59d 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -171,7 +171,7 @@ export class CompressedNavigationController implements ICompressedNavigationCont this.updateCollapsed(this.collapsed); if (this._index < this.labels.length) { - DOM.addClass(this.labels[this._index], 'active'); + this.labels[this._index].classList.add('active'); } } @@ -212,9 +212,9 @@ export class CompressedNavigationController implements ICompressedNavigationCont return; } - DOM.removeClass(this.labels[this._index], 'active'); + this.labels[this._index].classList.remove('active'); this._index = index; - DOM.addClass(this.labels[this._index], 'active'); + this.labels[this._index].classList.add('active'); this._onDidChange.fire(); } @@ -285,7 +285,7 @@ export class FilesRenderer implements ICompressibleTreeRenderer { this.compressedDragOverElement = iconLabelName.element; this.compressedDropTargetDisposable.dispose(); this.compressedDropTargetDisposable = toDisposable(() => { - DOM.removeClass(iconLabelName.element, 'drop-target'); + iconLabelName.element.classList.remove('drop-target'); this.compressedDragOverElement = undefined; }); - DOM.addClass(iconLabelName.element, 'drop-target'); + iconLabelName.element.classList.add('drop-target'); } return typeof result === 'boolean' ? result : { ...result, feedback: [] }; diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 054cd51755289b..355895869469a3 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -206,8 +206,8 @@ export class OpenEditorsView extends ViewPane { renderBody(container: HTMLElement): void { super.renderBody(container); - dom.addClass(container, 'open-editors'); - dom.addClass(container, 'show-file-icons'); + container.classList.add('open-editors'); + container.classList.add('show-file-icons'); const delegate = new OpenEditorsDelegate(); @@ -431,10 +431,10 @@ export class OpenEditorsView extends ViewPane { let dirty = this.workingCopyService.dirtyCount; if (dirty === 0) { - dom.addClass(this.dirtyCountElement, 'hidden'); + this.dirtyCountElement.classList.add('hidden'); } else { this.dirtyCountElement.textContent = nls.localize('dirtyCounter', "{0} unsaved", dirty); - dom.removeClass(this.dirtyCountElement, 'hidden'); + this.dirtyCountElement.classList.remove('hidden'); } } @@ -595,7 +595,7 @@ class OpenEditorRenderer implements IListRenderer 1) { super.render(container); - dom.addClass(container, 'switch-remote'); + container.classList.add('switch-remote'); } } From c2da75080d889d1fa0aa31c706d55ac8717b27ac Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 11 Sep 2020 17:34:48 +0200 Subject: [PATCH 39/55] do not use deprecated dom helper methods #103454 --- .../browser/ui/selectBox/selectBoxCustom.ts | 32 +++++++++---------- .../browser/ui/selectBox/selectBoxNative.ts | 2 +- .../browser/breakpointEditorContribution.ts | 2 +- .../debug/browser/debugActionViewItems.ts | 4 +-- .../contrib/debug/browser/replFilter.ts | 3 +- .../contrib/debug/common/debugger.ts | 3 +- .../contrib/debug/common/replModel.ts | 3 +- .../contrib/files/common/explorerModel.ts | 4 +-- .../remote/browser/explorerViewItems.ts | 3 +- 9 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts index ae0ecb88eb6e1b..af72ef943e8c16 100644 --- a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts +++ b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts @@ -45,7 +45,7 @@ class SelectListRenderer implements IListRenderer { - dom.toggleClass(this.selectDropDownContainer, 'visible', false); - dom.toggleClass(this.selectElement, 'synthetic-focus', false); + this.selectDropDownContainer.classList.remove('visible'); + this.selectElement.classList.remove('synthetic-focus'); }, anchorPosition: this._dropDownPosition }, this.selectBoxOptions.optionsAsChildren ? this.container : undefined); @@ -455,8 +455,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi render: (container: HTMLElement) => this.renderSelectDropDown(container), layout: () => this.layoutSelectDropDown(), onHide: () => { - dom.toggleClass(this.selectDropDownContainer, 'visible', false); - dom.toggleClass(this.selectElement, 'synthetic-focus', false); + this.selectDropDownContainer.classList.remove('visible'); + this.selectElement.classList.remove('synthetic-focus'); }, anchorPosition: this._dropDownPosition }, this.selectBoxOptions.optionsAsChildren ? this.container : undefined); @@ -529,7 +529,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi if (this.selectList) { // Make visible to enable measurements - dom.toggleClass(this.selectDropDownContainer, 'visible', true); + this.selectDropDownContainer.classList.add('visible'); const selectPosition = dom.getDomNodePagePosition(this.selectElement); const styles = getComputedStyle(this.selectElement); @@ -584,8 +584,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi this.selectDropDownContainer.appendChild(this.selectionDetailsPane); this.selectDropDownContainer.appendChild(this.selectDropDownListContainer); - dom.removeClass(this.selectionDetailsPane, 'border-top'); - dom.addClass(this.selectionDetailsPane, 'border-bottom'); + this.selectionDetailsPane.classList.remove('border-top'); + this.selectionDetailsPane.classList.add('border-bottom'); } else { this._dropDownPosition = AnchorPosition.BELOW; @@ -594,8 +594,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi this.selectDropDownContainer.appendChild(this.selectDropDownListContainer); this.selectDropDownContainer.appendChild(this.selectionDetailsPane); - dom.removeClass(this.selectionDetailsPane, 'border-bottom'); - dom.addClass(this.selectionDetailsPane, 'border-top'); + this.selectionDetailsPane.classList.remove('border-bottom'); + this.selectionDetailsPane.classList.add('border-top'); } // Do full layout on showSelectDropDown only return true; @@ -655,8 +655,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi // Maintain focus outline on parent select as well as list container - tabindex for focus this.selectDropDownListContainer.setAttribute('tabindex', '0'); - dom.toggleClass(this.selectElement, 'synthetic-focus', true); - dom.toggleClass(this.selectDropDownContainer, 'synthetic-focus', true); + this.selectElement.classList.add('synthetic-focus'); + this.selectDropDownContainer.classList.add('synthetic-focus'); return true; } else { diff --git a/src/vs/base/browser/ui/selectBox/selectBoxNative.ts b/src/vs/base/browser/ui/selectBox/selectBoxNative.ts index b5a553b94d508b..b6ed0f12383818 100644 --- a/src/vs/base/browser/ui/selectBox/selectBoxNative.ts +++ b/src/vs/base/browser/ui/selectBox/selectBoxNative.ts @@ -143,7 +143,7 @@ export class SelectBoxNative extends Disposable implements ISelectBoxDelegate { } public render(container: HTMLElement): void { - dom.addClass(container, 'select-container'); + container.classList.add('select-container'); container.appendChild(this.selectElement); this.setOptions(this.options, this.selected); this.applyStyles(); diff --git a/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts b/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts index 71aecb597c2568..cce739eb88bd16 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts @@ -627,7 +627,7 @@ class InlineBreakpointWidget implements IContentWidget, IDisposable { return null; } // Workaround: since the content widget can not be placed before the first column we need to force the left position - dom.toggleClass(this.domNode, 'line-start', this.range.startColumn === 1); + this.domNode.classList.toggle('line-start', this.range.startColumn === 1); return { position: { lineNumber: this.range.startLineNumber, column: this.range.startColumn - 1 }, diff --git a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts index 579fea20e50790..bc8446382974a2 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts @@ -84,10 +84,10 @@ export class StartDebugActionViewItem implements IActionViewItem { } })); this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_UP, () => { - dom.removeClass(this.start, 'active'); + this.start.classList.remove('active'); })); this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_OUT, () => { - dom.removeClass(this.start, 'active'); + this.start.classList.remove('active'); })); this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => { diff --git a/src/vs/workbench/contrib/debug/browser/replFilter.ts b/src/vs/workbench/contrib/debug/browser/replFilter.ts index 0aeb15472c1870..978564cbfd9608 100644 --- a/src/vs/workbench/contrib/debug/browser/replFilter.ts +++ b/src/vs/workbench/contrib/debug/browser/replFilter.ts @@ -5,7 +5,6 @@ import { matchesFuzzy } from 'vs/base/common/filters'; import { splitGlobAware } from 'vs/base/common/glob'; -import * as strings from 'vs/base/common/strings'; import { ITreeFilter, TreeVisibility, TreeFilterResult } from 'vs/base/browser/ui/tree/tree'; import { IReplElement } from 'vs/workbench/contrib/debug/common/debug'; import * as DOM from 'vs/base/browser/dom'; @@ -42,7 +41,7 @@ export class ReplFilter implements ITreeFilter { if (query && query !== '') { const filters = splitGlobAware(query, ',').map(s => s.trim()).filter(s => !!s.length); for (const f of filters) { - if (strings.startsWith(f, '!')) { + if (f.startsWith('!')) { this._parsedQueries.push({ type: 'exclude', query: f.slice(1) }); } else { this._parsedQueries.push({ type: 'include', query: f }); diff --git a/src/vs/workbench/contrib/debug/common/debugger.ts b/src/vs/workbench/contrib/debug/common/debugger.ts index f467b6e4cbd928..6f0a211b3bdb18 100644 --- a/src/vs/workbench/contrib/debug/common/debugger.ts +++ b/src/vs/workbench/contrib/debug/common/debugger.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import * as strings from 'vs/base/common/strings'; import * as objects from 'vs/base/common/objects'; import { isObject } from 'vs/base/common/types'; import { IJSONSchema, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema'; @@ -171,7 +170,7 @@ export class Debugger implements IDebugger { // fix formatting const editorConfig = this.configurationService.getValue(); if (editorConfig.editor && editorConfig.editor.insertSpaces) { - content = content.replace(new RegExp('\t', 'g'), strings.repeat(' ', editorConfig.editor.tabSize)); + content = content.replace(new RegExp('\t', 'g'), ' '.repeat(editorConfig.editor.tabSize)); } return Promise.resolve(content); diff --git a/src/vs/workbench/contrib/debug/common/replModel.ts b/src/vs/workbench/contrib/debug/common/replModel.ts index 85f6d1dd32fe5a..04297b0e910325 100644 --- a/src/vs/workbench/contrib/debug/common/replModel.ts +++ b/src/vs/workbench/contrib/debug/common/replModel.ts @@ -10,7 +10,6 @@ import { ExpressionContainer } from 'vs/workbench/contrib/debug/common/debugMode import { isString, isUndefinedOrNull, isObject } from 'vs/base/common/types'; import { basenameOrAuthority } from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; -import { endsWith } from 'vs/base/common/strings'; import { generateUuid } from 'vs/base/common/uuid'; import { Emitter } from 'vs/base/common/event'; @@ -203,7 +202,7 @@ export class ReplModel { if (typeof data === 'string') { const previousElement = this.replElements.length ? this.replElements[this.replElements.length - 1] : undefined; - if (previousElement instanceof SimpleReplElement && previousElement.severity === sev && !endsWith(previousElement.value, '\n') && !endsWith(previousElement.value, '\r\n')) { + if (previousElement instanceof SimpleReplElement && previousElement.severity === sev && !previousElement.value.endsWith('\n') && !previousElement.value.endsWith('\r\n')) { previousElement.value += data; this._onDidChangeElements.fire(); } else { diff --git a/src/vs/workbench/contrib/files/common/explorerModel.ts b/src/vs/workbench/contrib/files/common/explorerModel.ts index 5e3d1f8ad54612..fd4655c500187d 100644 --- a/src/vs/workbench/contrib/files/common/explorerModel.ts +++ b/src/vs/workbench/contrib/files/common/explorerModel.ts @@ -8,7 +8,7 @@ import { isEqual } from 'vs/base/common/extpath'; import { posix } from 'vs/base/common/path'; import { ResourceMap } from 'vs/base/common/map'; import { IFileStat, IFileService, FileSystemProviderCapabilities } from 'vs/platform/files/common/files'; -import { rtrim, startsWithIgnoreCase, startsWith, equalsIgnoreCase } from 'vs/base/common/strings'; +import { rtrim, startsWithIgnoreCase, equalsIgnoreCase } from 'vs/base/common/strings'; import { coalesce } from 'vs/base/common/arrays'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -363,7 +363,7 @@ export class ExplorerItem { // For performance reasons try to do the comparison as fast as possible const ignoreCase = !this.fileService.hasCapability(resource, FileSystemProviderCapabilities.PathCaseSensitive); if (resource && this.resource.scheme === resource.scheme && equalsIgnoreCase(this.resource.authority, resource.authority) && - (ignoreCase ? startsWithIgnoreCase(resource.path, this.resource.path) : startsWith(resource.path, this.resource.path))) { + (ignoreCase ? startsWithIgnoreCase(resource.path, this.resource.path) : resource.path.startsWith(this.resource.path))) { return this.findByPath(rtrim(resource.path, posix.sep), this.resource.path.length, ignoreCase); } diff --git a/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts b/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts index ec83f187b66a4b..7f48fe3ed20549 100644 --- a/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts +++ b/src/vs/workbench/contrib/remote/browser/explorerViewItems.ts @@ -11,7 +11,6 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView import { IRemoteExplorerService, REMOTE_EXPLORER_TYPE_KEY } from 'vs/workbench/services/remote/common/remoteExplorerService'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; import { IViewDescriptor } from 'vs/workbench/common/views'; -import { startsWith } from 'vs/base/common/strings'; import { isStringArray } from 'vs/base/common/types'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; @@ -82,7 +81,7 @@ export class SwitchRemoteViewItem extends SelectActionViewItem { static createOptionItems(views: IViewDescriptor[], contextKeyService: IContextKeyService): IRemoteSelectItem[] { let options: IRemoteSelectItem[] = []; views.forEach(view => { - if (view.group && startsWith(view.group, 'targets') && view.remoteAuthority && (!view.when || contextKeyService.contextMatchesRules(view.when))) { + if (view.group && view.group.startsWith('targets') && view.remoteAuthority && (!view.when || contextKeyService.contextMatchesRules(view.when))) { options.push({ text: view.name, authority: isStringArray(view.remoteAuthority) ? view.remoteAuthority : [view.remoteAuthority] }); } }); From 133d95e61892e304af8763b6df1412af5a87f32d Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 11 Sep 2020 17:59:23 +0200 Subject: [PATCH 40/55] adopt new amd loader with support for TrustedScriptURL, add typings for TrustedTypesFactory et al, https://github.com/microsoft/vscode/issues/106396 --- src/typings/trustedTypes.d.ts | 36 +++++++++++++++ src/vs/base/worker/workerMain.ts | 3 +- .../code/browser/workbench/workbench-dev.html | 1 + src/vs/code/browser/workbench/workbench.html | 1 + src/vs/loader.js | 45 +++++++++++++++++++ .../worker/extensionHostWorkerMain.ts | 3 +- 6 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 src/typings/trustedTypes.d.ts diff --git a/src/typings/trustedTypes.d.ts b/src/typings/trustedTypes.d.ts new file mode 100644 index 00000000000000..feb4af291844eb --- /dev/null +++ b/src/typings/trustedTypes.d.ts @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// see https://w3c.github.io/webappsec-trusted-types/dist/spec/ +// this isn't complete nor 100% correct + +type TrustedHTML = string & object; +type TrustedScript = string; +type TrustedScriptURL = string; + +interface TrustedTypePolicyOptions { + createHTML?: (value: string) => string + createScript?: (value: string) => string + createScriptURL?: (value: string) => string +} + +interface TrustedTypePolicy { + readonly name: string; + createHTML(input: string, ...more: any[]): TrustedHTML + createScript(input: string, ...more: any[]): TrustedScript + createScriptURL(input: string, ...more: any[]): TrustedScriptURL +} + +interface TrustedTypePolicyFactory { + createPolicy(policyName: string, object: TrustedTypePolicyOptions): TrustedTypePolicy; +} + +interface Window { + trustedTypes: TrustedTypePolicyFactory | undefined; +} + +interface WorkerGlobalScope { + trustedTypes: TrustedTypePolicyFactory | undefined; +} diff --git a/src/vs/base/worker/workerMain.ts b/src/vs/base/worker/workerMain.ts index 22bc88f1c00baa..71c6724e984e71 100644 --- a/src/vs/base/worker/workerMain.ts +++ b/src/vs/base/worker/workerMain.ts @@ -14,7 +14,8 @@ require.config({ baseUrl: monacoBaseUrl, - catchError: true + catchError: true, + createTrustedScriptURL: (value: string) => value, }); let loadCode = function (moduleId: string) { diff --git a/src/vs/code/browser/workbench/workbench-dev.html b/src/vs/code/browser/workbench/workbench-dev.html index 8cf808998ebc32..0142bb7f53dfa3 100644 --- a/src/vs/code/browser/workbench/workbench-dev.html +++ b/src/vs/code/browser/workbench/workbench-dev.html @@ -33,6 +33,7 @@ self.require = { baseUrl: `${window.location.origin}/static/out`, recordStats: true, + createTrustedScriptURL: value => value, paths: { 'vscode-textmate': `${window.location.origin}/static/remote/web/node_modules/vscode-textmate/release/main`, 'vscode-oniguruma': `${window.location.origin}/static/remote/web/node_modules/vscode-oniguruma/release/main`, diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 385357683485c9..d56e3fdd36a7cf 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -31,6 +31,7 @@ self.require = { baseUrl: `${window.location.origin}/static/out`, recordStats: true, + createTrustedScriptURL: value => value, paths: { 'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`, 'vscode-oniguruma': `${window.location.origin}/static/node_modules/vscode-oniguruma/release/main`, diff --git a/src/vs/loader.js b/src/vs/loader.js index 5da6a16b13e40c..3b71c723592418 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -618,8 +618,37 @@ var AMDLoader; }; return OnlyOnceScriptLoader; }()); + var trustedTypesPolyfill = new /** @class */(function () { + function class_1() { + } + class_1.prototype.installIfNeeded = function () { + if (typeof globalThis.trustedTypes !== 'undefined') { + return; // already defined + } + var _defaultRules = { + createHTML: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createHTML\' member'); }, + createScript: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createScript\' member'); }, + createScriptURL: function () { throw new Error('Policy\'s TrustedTypePolicyOptions did not specify a \'createScriptURL\' member'); }, + }; + globalThis.trustedTypes = { + createPolicy: function (name, rules) { + var _a, _b, _c; + return { + name: name, + createHTML: (_a = rules.createHTML) !== null && _a !== void 0 ? _a : _defaultRules.createHTML, + createScript: (_b = rules.createScript) !== null && _b !== void 0 ? _b : _defaultRules.createScript, + createScriptURL: (_c = rules.createScriptURL) !== null && _c !== void 0 ? _c : _defaultRules.createScriptURL, + }; + } + }; + }; + return class_1; + }()); + //#endregion var BrowserScriptLoader = /** @class */ (function () { function BrowserScriptLoader() { + // polyfill trustedTypes-support if missing + trustedTypesPolyfill.installIfNeeded(); } /** * Attach load / error listeners to a script element and remove them when either one has fired. @@ -662,6 +691,13 @@ var AMDLoader; script.setAttribute('async', 'async'); script.setAttribute('type', 'text/javascript'); this.attachListeners(script, callback, errorback); + var createTrustedScriptURL = moduleManager.getConfig().getOptionsLiteral().createTrustedScriptURL; + if (createTrustedScriptURL) { + if (!this.scriptSourceURLPolicy) { + this.scriptSourceURLPolicy = trustedTypes.createPolicy('amdLoader', { createScriptURL: createTrustedScriptURL }); + } + scriptSrc = this.scriptSourceURLPolicy.createScriptURL(scriptSrc); + } script.setAttribute('src', scriptSrc); // Propagate CSP nonce to dynamically created script tag. var cspNonce = moduleManager.getConfig().getOptionsLiteral().cspNonce; @@ -675,8 +711,17 @@ var AMDLoader; }()); var WorkerScriptLoader = /** @class */ (function () { function WorkerScriptLoader() { + // polyfill trustedTypes-support if missing + trustedTypesPolyfill.installIfNeeded(); } WorkerScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) { + var createTrustedScriptURL = moduleManager.getConfig().getOptionsLiteral().createTrustedScriptURL; + if (createTrustedScriptURL) { + if (!this.scriptSourceURLPolicy) { + this.scriptSourceURLPolicy = trustedTypes.createPolicy('amdLoader', { createScriptURL: createTrustedScriptURL }); + } + scriptSrc = this.scriptSourceURLPolicy.createScriptURL(scriptSrc); + } try { importScripts(scriptSrc); callback(); diff --git a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts index 79455414c06b95..b39a5cbb9eadbc 100644 --- a/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts +++ b/src/vs/workbench/services/extensions/worker/extensionHostWorkerMain.ts @@ -14,7 +14,8 @@ require.config({ baseUrl: monacoBaseUrl, - catchError: true + catchError: true, + createTrustedScriptURL: (value: string) => value }); require(['vs/workbench/services/extensions/worker/extensionHostWorker'], () => { }, err => console.error(err)); From b0a913b761f79ddd2f5074354008cdc8b7cbdadd Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 11 Sep 2020 18:01:59 +0200 Subject: [PATCH 41/55] explorer: Should maintain row focus after deleting a file fixes #71315 --- .../workbench/contrib/files/browser/views/explorerView.ts | 7 +++++++ src/vs/workbench/contrib/files/common/explorerService.ts | 1 + src/vs/workbench/contrib/files/common/files.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 75f19930b9ee3a..72e20cee13d1b2 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -588,6 +588,13 @@ export class ExplorerView extends ViewPane { return this.tree.updateChildren(toRefresh, recursive); } + focusNextIfItemFocused(item: ExplorerItem): void { + const focus = this.tree.getFocus(); + if (focus.length === 1 && focus[0] === item) { + this.tree.focusNext(); + } + } + getOptimalWidth(): number { const parentNode = this.tree.getHTMLElement(); const childNodes = ([] as HTMLElement[]).slice.call(parentNode.querySelectorAll('.explorer-item .label-name')); // select all file labels diff --git a/src/vs/workbench/contrib/files/common/explorerService.ts b/src/vs/workbench/contrib/files/common/explorerService.ts index 4ad1fc336d7971..32a1b2fbe4d86d 100644 --- a/src/vs/workbench/contrib/files/common/explorerService.ts +++ b/src/vs/workbench/contrib/files/common/explorerService.ts @@ -278,6 +278,7 @@ export class ExplorerService implements IExplorerService { const parent = element.parent; // Remove Element from Parent (Model) parent.removeChild(element); + this.view?.focusNextIfItemFocused(element); // Refresh Parent (View) await this.view?.refresh(false, parent); } diff --git a/src/vs/workbench/contrib/files/common/files.ts b/src/vs/workbench/contrib/files/common/files.ts index f0042c844bbbbe..87d64214cab79b 100644 --- a/src/vs/workbench/contrib/files/common/files.ts +++ b/src/vs/workbench/contrib/files/common/files.ts @@ -65,6 +65,7 @@ export interface IExplorerView { setTreeInput(): Promise; itemsCopied(tats: ExplorerItem[], cut: boolean, previousCut: ExplorerItem[] | undefined): void; setEditable(stat: ExplorerItem, isEditing: boolean): Promise; + focusNextIfItemFocused(item: ExplorerItem): void; } export const IExplorerService = createDecorator('explorerService'); From 5c76fc51e043dd4af9423b6be5b0ed7f9f6b845d Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Fri, 11 Sep 2020 09:52:37 -0700 Subject: [PATCH 42/55] Update Codicons: add 'magnet' icon https://github.com/microsoft/vscode-codicons/commit/4c6115529dd1fa20b635f32f9271f50030b0722e --- .../browser/ui/codicons/codicon/codicon.ttf | Bin 61312 -> 61532 bytes src/vs/base/common/codicons.ts | 1 + 2 files changed, 1 insertion(+) diff --git a/src/vs/base/browser/ui/codicons/codicon/codicon.ttf b/src/vs/base/browser/ui/codicons/codicon/codicon.ttf index cb5265534337214cb6200dc7206ed83e3efb8834..bb7ce5a58291a55c67f7f02fdc5a6d66c1459b88 100644 GIT binary patch delta 3120 zcmYM$3s98T6$kMD*#(vYf)A8OK#@g=h{(QxU2u5_xXMFRSb0hSc|-weVp6mzi*{=G{W7EVY1dX+6+-t10iB*H9=XyF*hTr%9zI_e* z-E+=m$$U}?SmJBDsI@EPbL5Sr4ry|cX`X2}qcI06{P`rC&F4W0M{ zKOfI8N*QSH?^=8~v1B*!K7WWIVsQI|JG!RkKL?!42j-+c9xxYqK>7m#W83BCwwS_C z5o!F0AHjROn=AgGpWiZmY`nzR;V|e&`G?;_9{)mmhQ=pOQ%>lZA!N)nFFE4w2f`Qv z1fg&lAL9!CiGSf5{*6!YDX!xdKEn)d6Nt!2Arwj`3a2O^&7x?E zp}91VVrc=z(>;_-izuBkXenjVGRmUmw1RTTLRPYoopLFU^2tdqDxj6*rV=WpRa8dh zR6(n82v6fMj-VJNs6sVrP(~@JL@m~!00~IM^XNez4v>TIe+-tD;|F*NSILamF^ZeG zfmi4Y_#^%b7ZoB0zd|n_!%<$%F#nv08~&7t$e1X-z%hgRcz2cKBh5apieRVUr9*Iw z;6+5ROW-VLx8Q|Eut(rk&R)Tbjo|$PFK})ZTmT4e6L4_$2`&l*`+c1*LNC6U6l$+%G7B^HD)@oZk`@$$3CfBIo0R7ITgXO5*ebnfky* zjNlUj`oq61Xg24Qf=hgKR$LgDI26BE<6?(O7F_mF3k5d-)FQ#H0F@%RDWLdo(6~LI z_LY&R65|(2kt1S48gqx#WzvoE`wSs^lVa@f;$gtncyCT z;t{2BH$p8J+?P<+4;RRJG zc#J_+2_9%r)q+PGRE^*v2URP0+(E4uKAwC~8wAflsEq=*IqL-R->2#Y@rCjVGIDMb z6vEjcD3r5NkcqQNP&j9^peW83z5XrSFthlgRZukNW=l&3dB32goLdEDa&8l(JD^Wc7H7Yp<(vb8 zbk%Pcq^o{VkS_W!G9MpESN#Kmbk#p7NLT$1LAuf(5~M5rVL`gmza&Uk`j8-9={p7K zO5Y_&7x$M1adB@@kMIQ}UBzD!q^o#Xkgj5Vml)|P9ucIgc()*3#Crs-_V>nrl~Vkd z<2Tat{^EocaliMC#_d(cH1snz;@l9W#4Rn!an7Qay;d@mU}%fH}8SG3;9*~ zNAs^athgV*6Tis3WV+zO~0H^DA2_hpP@$ovI2}FQ^`>{%-Y|nxvXDH8bnn>-Mf2Uw5H4qSmuM zdVSUUJ?l?xIItnGv1;SKIzwG{U0>bR`t16l`blq?x52x|d&YZfQ`RQWrXvjz4JR87 z_Qu%8^v3+gwT;g<&NS6EjW$g;cQ+qvzS3fC8Ectt&1vT!xft3NwYxpA%=xn`3vAbs_!lJR?0Loy-nfD9doz zv&ozqO{V!~hn??gt~G8!+=67HPlmcXodxcIJJng{Of5Q5ROsyNzVk*PV6dJzal-1g zTk34afX!Op@LEHCq19&GSK#XC9=h|g+fB|?XDa{7`A~Ou&kP3q zg5c+Ko*xRk^92FUZfC?f?YwHL%pp&CU~>00T*Vi0LE>;m1joc5sgj3}a0~y%7A(XV zI`Jfah-DIs282m29zr*+;FtIrPRKIs#Sp$M_sU)9k$Eyj=E&U=ED;hT_sC2mQ+cTm69$Qk}27e zBl%Jwg|bSDq*zKkho{Uco{Kf8K^d|T0T*7zX7piHQh5KvQH-bX3f`Cb_ziaBWBePZ zB?!O8MPy1A5^xl~c$^Cv;F%VD%X3QnJ>ek%Q&=7LVV5@~cIq|2=~lSvsS26xzQC(Z ziYo?Zv%(o>ui`4gxliF3^M1vZg|kH=mC4ezxY}^~71tfkR>cZ{vrVxU;IIKaS3{y? z%;OW9C9$5|&{)a!bcMzyUg4`ligf|Utym#&h80dQcPd%tIU2gceJ`(eDOL}hFDdje z*(sLHV}3=+6y{^fwwc4$w&ZT+SCz2holzwb%sonCn0uAn!}I`4?13c;XP<)o@~hK5l0aKtjKVS+KCkf0d#hC(A zq&Qt*iWTP!jJt#f;>dw1RUAGrs};u(Oqt?9f+<%VO)zT|hZIbO;<$pTR2*C|Rf;1F zrbcm?!K_to&NY}?#R&&fr#S0i)+yX()+^!PY8sUIFxM;bWpZ1x#E-c_NdU7+Ng%UX zNeHvWu73+Z5Xy^IB~zJgO2U}!N~SS8luT!KDw)CTQZkF#tz#&l6dA;CCi!Hl-Ld!P+~jaQ{?7B5_$4~ zk|gGXN|Kp_N?7scAtkozw=1z#|7j(*>USuyRsXOOTlJq&VhjDVN?7Q%=5xFtu@(J! zCAOl6l-P>4cZtMS^so|J(L0scihe|K6WcoH3o_SpeNLUc>?w&@At|2i5n1k6`1%2b z_nF^P+{$3St+=VdJf*n3!91=6i}8BFy&{w?>#}IGF7L z_D(#jxL?9Nr?_*%{6OKTr^)5=KH};Scf$3=If;dd+Y_B6zod?&(WLXqk;!ez`;*V6 zASEqjDCLFJ?9_c}`_nG2oVoJRm6PeU>HE^pWn^d6WbDcq%e*TyKC>lrILj|g*#qF**Bk&gI<9ZOI+V9m(s+8_)O4AIYC6Xeu~UIKObH@JQk0s@he@i{gsfigp*d zpDS{T(~G-`zfpX#q_AXH$!n!;rDs=HtlnQ1UDi?dba_~LQ~9OxTWew}k}3u&MkT~qyN_4CzE&EcBKwQ*|)YLjZ)YA5UB>kih9tqWVXcimXM ztG=WDnfe Date: Fri, 11 Sep 2020 10:21:13 -0700 Subject: [PATCH 43/55] Remove unused 'SettingSearch' issue type --- .../issue/issueReporterMain.ts | 81 ++----------------- .../issue/issueReporterModel.ts | 42 ---------- .../issue/test/testReporterModel.test.ts | 11 --- src/vs/platform/issue/common/issue.ts | 10 +-- 4 files changed, 8 insertions(+), 136 deletions(-) diff --git a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts index cc33ad9c397b27..108f02d1abd1d3 100644 --- a/src/vs/code/electron-sandbox/issue/issueReporterMain.ts +++ b/src/vs/code/electron-sandbox/issue/issueReporterMain.ts @@ -23,7 +23,7 @@ import { localize } from 'vs/nls'; import { isRemoteDiagnosticError, SystemInfo } from 'vs/platform/diagnostics/common/diagnostics'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService'; -import { ISettingsSearchIssueReporterData, IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue'; +import { IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; const MAX_URL_LENGTH = 2045; @@ -148,10 +148,6 @@ export class IssueReporter extends Disposable { applyZoom(configuration.data.zoomLevel); this.applyStyles(configuration.data.styles); this.handleExtensionData(configuration.data.enabledExtensions); - - if (configuration.data.issueType === IssueType.SettingsSearchIssue) { - this.handleSettingsSearchData(configuration.data); - } } render(): void { @@ -244,7 +240,7 @@ export class IssueReporter extends Disposable { content.push(`.monaco-text-button:not(.disabled):hover, .monaco-text-button:focus { background-color: ${styles.buttonHoverBackground} !important; }`); } - styleTag.innerHTML = content.join('\n'); + styleTag.textContent = content.join('\n'); document.head.appendChild(styleTag); document.body.style.color = styles.color || ''; } @@ -266,39 +262,6 @@ export class IssueReporter extends Disposable { this.updateExtensionSelector(installedExtensions); } - private handleSettingsSearchData(data: ISettingsSearchIssueReporterData): void { - this.issueReporterModel.update({ - actualSearchResults: data.actualSearchResults, - query: data.query, - filterResultCount: data.filterResultCount - }); - this.updateSearchedExtensionTable(data.enabledExtensions); - this.updateSettingsSearchDetails(data); - } - - private updateSettingsSearchDetails(data: ISettingsSearchIssueReporterData): void { - const target = document.querySelector('.block-settingsSearchResults .block-info'); - if (target) { - const queryDiv = $('div', undefined, `Query: "${data.query}"` as string); - const countDiv = $('div', undefined, `Literal match count: ${data.filterResultCount}` as string); - const detailsDiv = $('.block-settingsSearchResults-details', undefined, queryDiv, countDiv); - - const table = $('table', undefined, - $('tr', undefined, - $('th', undefined, 'Setting'), - $('th', undefined, 'Extension'), - $('th', undefined, 'Score'), - ), - ...data.actualSearchResults.map(setting => $('tr', undefined, - $('td', undefined, setting.key), - $('td', undefined, setting.extensionId), - $('td', undefined, String(setting.score).slice(0, 5)), - )) - ); - reset(target, detailsDiv, table); - } - } - private initServices(configuration: IssueReporterConfiguration): void { const serviceCollection = new ServiceCollection(); const mainProcessService = new MainProcessService(configuration.windowId); @@ -498,10 +461,6 @@ export class IssueReporter extends Disposable { return true; } - if (issueType === IssueType.SettingsSearchIssue) { - return true; - } - return false; } @@ -668,16 +627,11 @@ export class IssueReporter extends Disposable { const typeSelect = this.getElementById('issue-type')! as HTMLSelectElement; const { issueType } = this.issueReporterModel.getData(); - if (issueType === IssueType.SettingsSearchIssue) { - reset(typeSelect, makeOption(IssueType.SettingsSearchIssue, localize('settingsSearchIssue', "Settings Search Issue"))); - typeSelect.disabled = true; - } else { - reset(typeSelect, - makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")), - makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")), - makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue")) - ); - } + reset(typeSelect, + makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")), + makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")), + makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue")) + ); typeSelect.value = issueType.toString(); @@ -791,13 +745,6 @@ export class IssueReporter extends Disposable { if (fileOnExtension) { show(extensionSelector); } - } else if (issueType === IssueType.SettingsSearchIssue) { - show(blockContainer); - show(searchedExtensionsBlock); - show(settingsSearchResultsBlock); - - reset(descriptionTitle, localize('expectedResults', "Expected Results"), $('span.required-input', undefined, '*')); - reset(descriptionSubtitle, localize('settingsSearchResultsDescription', "Please list the results that you were expecting to see when you searched with this query. We support GitHub-flavored Markdown. You will be able to edit your issue and add screenshots when we preview it on GitHub.")); } } @@ -1135,20 +1082,6 @@ export class IssueReporter extends Disposable { } } - private updateSearchedExtensionTable(extensions: IssueReporterExtensionData[]): void { - const target = document.querySelector('.block-searchedExtensions .block-info'); - if (target) { - if (!extensions.length) { - target.innerText = 'Extensions: none'; - return; - } - - const table = this.getExtensionTableHtml(extensions); - target.innerText = ''; - target.appendChild(table); - } - } - private getExtensionTableHtml(extensions: IssueReporterExtensionData[]): HTMLTableElement { return $('table', undefined, $('tr', undefined, diff --git a/src/vs/code/electron-sandbox/issue/issueReporterModel.ts b/src/vs/code/electron-sandbox/issue/issueReporterModel.ts index 08bb22994a94bc..b529e48cd76c1a 100644 --- a/src/vs/code/electron-sandbox/issue/issueReporterModel.ts +++ b/src/vs/code/electron-sandbox/issue/issueReporterModel.ts @@ -102,8 +102,6 @@ ${this.getInfos()} return 'Bug'; } else if (this._data.issueType === IssueType.PerformanceIssue) { return 'Performance Issue'; - } else if (this._data.issueType === IssueType.SettingsSearchIssue) { - return 'Settings Search Issue'; } else { return 'Feature Request'; } @@ -135,17 +133,6 @@ ${this.getInfos()} } } - if (this._data.issueType === IssueType.SettingsSearchIssue) { - if (this._data.includeSearchedExtensions) { - info += this.generateExtensionsMd(); - } - - if (this._data.includeSettingsSearchDetails) { - info += this.generateSettingSearchResultsMd(); - info += '\n' + this.generateSettingsSearchResultDetailsMd(); - } - } - return info; } @@ -243,35 +230,6 @@ ${tableHeader} ${table} ${themeExclusionStr} -`; - } - - private generateSettingsSearchResultDetailsMd(): string { - return ` -Query: ${this._data.query} -Literal matches: ${this._data.filterResultCount}`; - } - - private generateSettingSearchResultsMd(): string { - if (!this._data.actualSearchResults) { - return ''; - } - - if (!this._data.actualSearchResults.length) { - return `No fuzzy results`; - } - - const tableHeader = `Setting|Extension|Score ----|---|---`; - const table = this._data.actualSearchResults.map(setting => { - return `${setting.key}|${setting.extensionId}|${String(setting.score).slice(0, 5)}`; - }).join('\n'); - - return `
Results - -${tableHeader} -${table} -
`; } } diff --git a/src/vs/code/electron-sandbox/issue/test/testReporterModel.test.ts b/src/vs/code/electron-sandbox/issue/test/testReporterModel.test.ts index 4d31af3dde7653..b09f4fb760f4e2 100644 --- a/src/vs/code/electron-sandbox/issue/test/testReporterModel.test.ts +++ b/src/vs/code/electron-sandbox/issue/test/testReporterModel.test.ts @@ -218,16 +218,5 @@ Remote OS version: Linux x64 4.18.0 assert.equal(issueReporterModel.fileOnExtension(), true); }); - - [ - IssueType.SettingsSearchIssue - ].forEach(type => { - const issueReporterModel = new IssueReporterModel({ - issueType: type, - fileOnExtension: true - }); - - assert.equal(issueReporterModel.fileOnExtension(), false); - }); }); }); diff --git a/src/vs/platform/issue/common/issue.ts b/src/vs/platform/issue/common/issue.ts index d82ba0948dea09..f148c5e4747fea 100644 --- a/src/vs/platform/issue/common/issue.ts +++ b/src/vs/platform/issue/common/issue.ts @@ -17,8 +17,7 @@ export interface WindowData { export const enum IssueType { Bug, PerformanceIssue, - FeatureRequest, - SettingsSearchIssue + FeatureRequest } export interface IssueReporterStyles extends WindowStyles { @@ -66,13 +65,6 @@ export interface ISettingSearchResult { score: number; } -export interface ISettingsSearchIssueReporterData extends IssueReporterData { - issueType: IssueType.SettingsSearchIssue; - actualSearchResults: ISettingSearchResult[]; - query: string; - filterResultCount: number; -} - export interface IssueReporterFeatures { } From 59dcc5c9124ad82d15adc888013b2a861405d794 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 11 Sep 2020 10:57:39 -0700 Subject: [PATCH 44/55] notebook document data loss. --- .../api/browser/mainThreadNotebook.ts | 4 +- .../api/common/extHostNotebookDocument.ts | 1 + .../browser/diff/notebookTextDiffEditor.ts | 72 ++++++++++--------- .../common/model/notebookCellTextModel.ts | 2 +- 4 files changed, 44 insertions(+), 35 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadNotebook.ts b/src/vs/workbench/api/browser/mainThreadNotebook.ts index f79ca934154c72..056142137803d8 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebook.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebook.ts @@ -271,7 +271,7 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo const notebookDocumentAddedHandler = (textModel: NotebookTextModel) => { - if (!this._editorEventListenersMapping.has(textModel.uri.toString())) { + if (!this._documentEventListenersMapping.has(textModel.uri)) { const disposableStore = new DisposableStore(); disposableStore.add(textModel!.onDidChangeContent(event => { const dto = event.rawEvents.map(e => { @@ -316,7 +316,7 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo this._proxy.$acceptDocumentPropertiesChanged(textModel.uri, { metadata: textModel.metadata }); } })); - this._editorEventListenersMapping.set(textModel!.uri.toString(), disposableStore); + this._documentEventListenersMapping.set(textModel!.uri, disposableStore); } }; diff --git a/src/vs/workbench/api/common/extHostNotebookDocument.ts b/src/vs/workbench/api/common/extHostNotebookDocument.ts index 3ba7bfd2b08875..7726eaf4d67b4a 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocument.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocument.ts @@ -348,6 +348,7 @@ export class ExtHostNotebookDocument extends Disposable { } acceptModelChanged(event: NotebookCellsChangedEventDto, isDirty: boolean): void { + console.log(event); this._versionId = event.versionId; this._isDirty = isDirty; event.rawEvents.forEach(e => { diff --git a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts index e973897c2ee1fd..f90c8172c403d0 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts @@ -35,6 +35,8 @@ import { FileService } from 'vs/platform/files/common/fileService'; import { IFileService } from 'vs/platform/files/common/files'; import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; +import { IDiffChange } from 'vs/base/common/diff/diff'; +import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel'; export const IN_NOTEBOOK_TEXT_DIFF_EDITOR = new RawContextKey('isInNotebookTextDiffEditor', false); @@ -246,38 +248,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD } } - // modified cells - const modifiedLen = Math.min(change.originalLength, change.modifiedLength); - - for (let j = 0; j < modifiedLen; j++) { - cellDiffViewModels.push(new CellDiffViewModel( - originalModel.cells[change.originalStart + j], - modifiedModel.cells[change.modifiedStart + j], - 'modified', - this._eventDispatcher! - )); - } - - for (let j = modifiedLen; j < change.originalLength; j++) { - // deletion - cellDiffViewModels.push(new CellDiffViewModel( - originalModel.cells[change.originalStart + j], - undefined, - 'delete', - this._eventDispatcher! - )); - } - - for (let j = modifiedLen; j < change.modifiedLength; j++) { - // insertion - cellDiffViewModels.push(new CellDiffViewModel( - undefined, - modifiedModel.cells[change.modifiedStart + j], - 'insert', - this._eventDispatcher! - )); - } - + cellDiffViewModels.push(...this._computeModifiedLCS(change, originalModel, modifiedModel)); originalCellIndex = change.originalStart + change.originalLength; modifiedCellIndex = change.modifiedStart + change.modifiedLength; } @@ -294,6 +265,43 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD this._list.splice(0, this._list.length, cellDiffViewModels); } + private _computeModifiedLCS(change: IDiffChange, originalModel: NotebookTextModel, modifiedModel: NotebookTextModel) { + const result: CellDiffViewModel[] = []; + // modified cells + const modifiedLen = Math.min(change.originalLength, change.modifiedLength); + + for (let j = 0; j < modifiedLen; j++) { + result.push(new CellDiffViewModel( + originalModel.cells[change.originalStart + j], + modifiedModel.cells[change.modifiedStart + j], + 'modified', + this._eventDispatcher! + )); + } + + for (let j = modifiedLen; j < change.originalLength; j++) { + // deletion + result.push(new CellDiffViewModel( + originalModel.cells[change.originalStart + j], + undefined, + 'delete', + this._eventDispatcher! + )); + } + + for (let j = modifiedLen; j < change.modifiedLength; j++) { + // insertion + result.push(new CellDiffViewModel( + undefined, + modifiedModel.cells[change.modifiedStart + j], + 'insert', + this._eventDispatcher! + )); + } + + return result; + } + private pendingLayouts = new WeakMap(); diff --git a/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts b/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts index aa822ae32cdd16..d46143ecbbc1a3 100644 --- a/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts +++ b/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts @@ -109,7 +109,7 @@ export class NotebookCellTextModel extends Disposable implements ICell { } // TODO@rebornix, raw outputs - this._hash = hash([hash(this.getValue()), this._getPersisentMetadata, this.transientOptions.transientOutputs ? [] : this._outputs]); + this._hash = hash([hash(this.language), hash(this.getValue()), this._getPersisentMetadata, this.transientOptions.transientOutputs ? [] : this._outputs]); return this._hash; } From c53524a198ca46dd327d2559bcafa9296d6230e6 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 11 Sep 2020 11:59:36 -0700 Subject: [PATCH 45/55] cell language should not be freezed. --- src/vs/workbench/api/common/extHostNotebookDocument.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostNotebookDocument.ts b/src/vs/workbench/api/common/extHostNotebookDocument.ts index 7726eaf4d67b4a..73bff50d706330 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocument.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocument.ts @@ -119,7 +119,7 @@ export class ExtHostCell extends Disposable { uri: that.uri, cellKind: this._cellData.cellKind, document, - language: document.languageId, + get language() { return document.languageId; }, get outputs() { return that._outputs; }, set outputs(value) { that._updateOutputs(value); }, get metadata() { return that._metadata; }, From 352a39025160b234d37af128c48a9b19c4a44ff5 Mon Sep 17 00:00:00 2001 From: Oleg Demchenko Date: Fri, 11 Sep 2020 15:38:03 -0400 Subject: [PATCH 46/55] Add preferred_username to the list of msft token claims (#106511) --- extensions/microsoft-authentication/src/AADHelper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/microsoft-authentication/src/AADHelper.ts b/extensions/microsoft-authentication/src/AADHelper.ts index b3461309567f34..6f437ca401a48a 100644 --- a/extensions/microsoft-authentication/src/AADHelper.ts +++ b/extensions/microsoft-authentication/src/AADHelper.ts @@ -40,6 +40,7 @@ interface ITokenClaims { tid: string; email?: string; unique_name?: string; + preferred_username?: string; oid?: string; altsecid?: string; ipd?: string; @@ -454,7 +455,7 @@ export class AzureActiveDirectoryService { scope, sessionId: existingId || `${claims.tid}/${(claims.oid || (claims.altsecid || '' + claims.ipd || ''))}/${uuid()}`, account: { - label: claims.email || claims.unique_name || 'user@example.com', + label: claims.email || claims.unique_name || claims.preferred_username || 'user@example.com', id: `${claims.tid}/${(claims.oid || (claims.altsecid || '' + claims.ipd || ''))}` } }; From 122fc9a1b8a378c7349d5be091c819be6932be64 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Fri, 11 Sep 2020 12:54:43 -0700 Subject: [PATCH 47/55] debug: update js-debug --- product.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product.json b/product.json index e79fb4baf5e99c..4e8daa88fbe0b8 100644 --- a/product.json +++ b/product.json @@ -91,7 +91,7 @@ }, { "name": "ms-vscode.js-debug", - "version": "1.49.6", + "version": "1.49.7", "repo": "https://github.com/Microsoft/vscode-js-debug", "metadata": { "id": "25629058-ddac-4e17-abba-74678e126c5d", From 402092dd67d55e0c4f326b834cda03dcaa2084ac Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 11 Sep 2020 15:12:57 -0700 Subject: [PATCH 48/55] fix #106430. --- .../api/common/extHostNotebookDocument.ts | 1 - .../browser/diff/notebookTextDiffEditor.ts | 1 + .../common/services/notebookSimpleWorker.ts | 64 ++++++++++++++++--- .../services/notebookWorkerServiceImpl.ts | 50 +++++++++++++-- 4 files changed, 102 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/api/common/extHostNotebookDocument.ts b/src/vs/workbench/api/common/extHostNotebookDocument.ts index 73bff50d706330..c7136fa76d81db 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocument.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocument.ts @@ -348,7 +348,6 @@ export class ExtHostNotebookDocument extends Disposable { } acceptModelChanged(event: NotebookCellsChangedEventDto, isDirty: boolean): void { - console.log(event); this._versionId = event.versionId; this._isDirty = isDirty; event.rawEvents.forEach(e => { diff --git a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts index f90c8172c403d0..4fa9f6575c0b04 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor.ts @@ -217,6 +217,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD const diffResult = await this.notebookEditorWorkerService.computeDiff(this._model.original.resource, this._model.modified.resource); const cellChanges = diffResult.cellsDiff.changes; + console.log(cellChanges); const cellDiffViewModels: CellDiffViewModel[] = []; const originalModel = this._model.original.notebook; diff --git a/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts b/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts index 547f3678545ac1..f0a0fd99461a59 100644 --- a/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts +++ b/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri'; import { IRequestHandler } from 'vs/base/common/worker/simpleWorker'; import * as model from 'vs/editor/common/model'; import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder'; -import { CellKind, ICellDto2, IMainCellDto, INotebookDiffResult, IProcessedOutput, NotebookCellMetadata, NotebookDataDto, NotebookDocumentMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { CellKind, ICellDto2, IMainCellDto, INotebookDiffResult, IProcessedOutput, NotebookCellMetadata, NotebookCellsChangedEventDto, NotebookCellsChangeType, NotebookCellsSplice2, NotebookDataDto, NotebookDocumentMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { Range } from 'vs/editor/common/core/range'; import { EditorWorkerHost } from 'vs/workbench/contrib/notebook/common/services/notebookWorkerServiceImpl'; @@ -43,10 +43,10 @@ class MirrorCell { constructor( readonly handle: number, private _source: string | string[], - readonly language: string, - readonly cellKind: CellKind, - readonly outputs: IProcessedOutput[], - readonly metadata?: NotebookCellMetadata + public language: string, + public cellKind: CellKind, + public outputs: IProcessedOutput[], + public metadata?: NotebookCellMetadata ) { } @@ -87,11 +87,52 @@ class MirrorCell { class MirrorNotebookDocument { constructor( readonly uri: URI, - readonly cells: MirrorCell[], - readonly languages: string[], - readonly metadata: NotebookDocumentMetadata, + public cells: MirrorCell[], + public languages: string[], + public metadata: NotebookDocumentMetadata, ) { } + + acceptModelChanged(event: NotebookCellsChangedEventDto) { + // note that the cell content change is not applied to the MirrorCell + // but it's fine as if a cell content is modified after the first diff, its position will not change any more + // TODO@rebornix, but it might lead to interesting bugs in the future. + event.rawEvents.forEach(e => { + if (e.kind === NotebookCellsChangeType.ModelChange) { + this._spliceNotebookCells(e.changes); + } else if (e.kind === NotebookCellsChangeType.Move) { + const cells = this.cells.splice(e.index, 1); + this.cells.splice(e.newIdx, 0, ...cells); + } else if (e.kind === NotebookCellsChangeType.Output) { + const cell = this.cells[e.index]; + cell.outputs = e.outputs; + } else if (e.kind === NotebookCellsChangeType.ChangeLanguage) { + const cell = this.cells[e.index]; + cell.language = e.language; + } else if (e.kind === NotebookCellsChangeType.ChangeCellMetadata) { + const cell = this.cells[e.index]; + cell.metadata = e.metadata; + } + }); + } + + _spliceNotebookCells(splices: NotebookCellsSplice2[]) { + splices.reverse().forEach(splice => { + const cellDtos = splice[2]; + const newCells = cellDtos.map(cell => { + return new MirrorCell( + (cell as unknown as IMainCellDto).handle, + cell.source, + cell.language, + cell.cellKind, + cell.outputs, + cell.metadata + ); + }); + + this.cells.splice(splice[0], splice[1], ...newCells); + }); + } } export class CellSequence implements ISequence { @@ -137,6 +178,13 @@ export class NotebookEditorSimpleWorker implements IRequestHandler, IDisposable )), data.languages, data.metadata); } + public acceptModelChanged(strURL: string, event: NotebookCellsChangedEventDto) { + const model = this._models[strURL]; + if (model) { + model.acceptModelChanged(event); + } + } + public acceptRemovedModel(strURL: string): void { if (!this._models[strURL]) { return; diff --git a/src/vs/workbench/contrib/notebook/common/services/notebookWorkerServiceImpl.ts b/src/vs/workbench/contrib/notebook/common/services/notebookWorkerServiceImpl.ts index 7693c93ec69647..a93f198dea9e0a 100644 --- a/src/vs/workbench/contrib/notebook/common/services/notebookWorkerServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/common/services/notebookWorkerServiceImpl.ts @@ -7,7 +7,8 @@ import { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from import { URI } from 'vs/base/common/uri'; import { SimpleWorkerClient } from 'vs/base/common/worker/simpleWorker'; import { DefaultWorkerFactory } from 'vs/base/worker/defaultWorkerFactory'; -import { INotebookDiffResult } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { NotebookCellTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookCellTextModel'; +import { IMainCellDto, INotebookDiffResult, NotebookCellsChangeType } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; import { NotebookEditorSimpleWorker } from 'vs/workbench/contrib/notebook/common/services/notebookSimpleWorker'; import { INotebookEditorWorkerService } from 'vs/workbench/contrib/notebook/common/services/notebookWorkerService'; @@ -113,11 +114,50 @@ export class NotebookEditorModelManager extends Disposable { const toDispose = new DisposableStore(); - // TODO@rebornix, accept Model change + const cellToDto = (cell: NotebookCellTextModel): IMainCellDto => { + return { + handle: cell.handle, + uri: cell.uri, + source: cell.textBuffer.getLinesContent(), + eol: cell.textBuffer.getEOL(), + language: cell.language, + cellKind: cell.cellKind, + outputs: cell.outputs, + metadata: cell.metadata + }; + }; + + toDispose.add(model.onDidChangeContent((event) => { + const dto = event.rawEvents.map(e => { + const data = + e.kind === NotebookCellsChangeType.ModelChange || e.kind === NotebookCellsChangeType.Initialize + ? { + kind: e.kind, + versionId: event.versionId, + changes: e.changes.map(diff => [diff[0], diff[1], diff[2].map(cell => cellToDto(cell as NotebookCellTextModel))] as [number, number, IMainCellDto[]]) + } + : ( + e.kind === NotebookCellsChangeType.Move + ? { + kind: e.kind, + index: e.index, + length: e.length, + newIdx: e.newIdx, + versionId: event.versionId, + cells: e.cells.map(cell => cellToDto(cell as NotebookCellTextModel)) + } + : e + ); + + return data; + }); + + this._proxy.acceptModelChanged(modelUrl.toString(), { + rawEvents: dto, + versionId: event.versionId + }); + })); - // toDispose.add(model.onDidChangeContent((e) => { - // this._proxy.acceptModelChanged(modelUrl.toString(), e); - // })); toDispose.add(model.onWillDispose(() => { this._stopModelSync(modelUrl); })); From db01f714bc2f291b5ed09f265a883328d29e0664 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 11 Sep 2020 15:26:39 -0700 Subject: [PATCH 49/55] hide outputs if it is transient. --- .../contrib/notebook/browser/diff/cellComponents.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts b/src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts index cd75e0c8056e53..ee799c9487abd4 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/cellComponents.ts @@ -316,6 +316,13 @@ abstract class AbstractCellRenderer extends Disposable { this._register(this._metadataHeader); this._metadataHeader.buildHeader(); + if (this.notebookEditor.textModel?.transientOptions.transientOutputs) { + this._layoutInfo.outputHeight = 0; + this._layoutInfo.outputStatusHeight = 0; + this.layout({}); + return; + } + this._outputHeaderContainer = DOM.append(this._diffEditorContainer, DOM.$('.output-header-container')); this._outputInfoContainer = DOM.append(this._diffEditorContainer, DOM.$('.output-info-container')); From 2fb42c30242fdfe26676cee0f3e4828cd79c91ba Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 11 Sep 2020 14:25:18 -0700 Subject: [PATCH 50/55] Add optional typing for webview state in WebviewPanelSerializer This makes it easier for extensions to correctly type their state if they wish --- src/vs/vscode.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e17b25cb1e39ce..62b50ae7ed1ccd 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -7109,8 +7109,10 @@ declare module 'vscode' { * VS Code will save off the state from `setState` of all webviews that have a serializer. When the * webview first becomes visible after the restart, this state is passed to `deserializeWebviewPanel`. * The extension can then restore the old `WebviewPanel` from this state. + * + * @param T Type of the webview's state. */ - interface WebviewPanelSerializer { + interface WebviewPanelSerializer { /** * Restore a webview panel from its serialized `state`. * @@ -7122,7 +7124,7 @@ declare module 'vscode' { * * @return Thenable indicating that the webview has been fully restored. */ - deserializeWebviewPanel(webviewPanel: WebviewPanel, state: any): Thenable; + deserializeWebviewPanel(webviewPanel: WebviewPanel, state: T): Thenable; } /** From 3e71592258309914a19a134285999782e6a8a6b6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 11 Sep 2020 14:25:34 -0700 Subject: [PATCH 51/55] Add comment to WebviewViewResolveContext --- src/vs/vscode.proposed.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index b8fb428bdc55d8..eaeb05b5c91f45 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -2171,6 +2171,11 @@ declare module 'vscode' { show(preserveFocus?: boolean): void; } + /** + * Additional information the webview view being resolved. + * + * @param T Type of the webview's state. + */ interface WebviewViewResolveContext { /** * Persisted state from the webview content. From 8a6b38e4ef2f773e336da01edb425dde670943df Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 11 Sep 2020 14:25:47 -0700 Subject: [PATCH 52/55] use optional chaining --- src/vs/base/browser/dom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index fc835c5129f15b..65214d3f6eba7d 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -784,11 +784,11 @@ function getSharedStyleSheet(): HTMLStyleElement { } function getDynamicStyleSheetRules(style: any) { - if (style && style.sheet && style.sheet.rules) { + if (style?.sheet?.rules) { // Chrome, IE return style.sheet.rules; } - if (style && style.sheet && style.sheet.cssRules) { + if (style?.sheet?.cssRules) { // FF return style.sheet.cssRules; } From 02e6fa2ddd33dfd7368e2da6c31bce322c2a2a2c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 11 Sep 2020 14:29:00 -0700 Subject: [PATCH 53/55] Use `Set` instead of array Sets should offer faster checking to see if a property has been seen --- src/vs/base/common/objects.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index 4907ac1e4eae8b..ffb71d9aec7f15 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -179,18 +179,18 @@ export function equals(one: any, other: any): boolean { } /** - * Calls JSON.Stringify with a replacer to break apart any circular references. - * This prevents JSON.stringify from throwing the exception + * Calls `JSON.Stringify` with a replacer to break apart any circular references. + * This prevents `JSON`.stringify` from throwing the exception * "Uncaught TypeError: Converting circular structure to JSON" */ export function safeStringify(obj: any): string { - const seen: any[] = []; + const seen = new Set(); return JSON.stringify(obj, (key, value) => { if (isObject(value) || Array.isArray(value)) { - if (seen.indexOf(value) !== -1) { + if (seen.has(value)) { return '[Circular]'; } else { - seen.push(value); + seen.add(value); } } return value; From cc899f17d32ef960397522af6f464750f4250d40 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 11 Sep 2020 16:59:31 -0700 Subject: [PATCH 54/55] Create webview.web.contribution Fixes #106516 Creates an explicit contribution file for web. This makes sure we only don't register the `IWebviewService` twice. Not 100% sure this fixes the issue since I couldn't repo the original bug with our oss builds --- .../contrib/webview/browser/webview.contribution.ts | 2 -- .../webview/browser/webview.web.contribution.ts | 10 ++++++++++ .../contrib/webview/browser/webviewWorkbenchService.ts | 3 --- src/vs/workbench/workbench.web.main.ts | 3 +-- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts diff --git a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts index 9144fa8eea0ffc..78e54f1a2a3f0a 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts @@ -17,7 +17,6 @@ import { WebviewEditorInputFactory } from 'vs/workbench/contrib/webview/browser/ import { HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand } from '../browser/webviewCommands'; import { WebviewEditor } from './webviewEditor'; import { WebviewInput } from './webviewEditorInput'; -import { WebviewService } from './webviewService'; import { IWebviewWorkbenchService, WebviewEditorService } from './webviewWorkbenchService'; (Registry.as(EditorExtensions.Editors)).registerEditor(EditorDescriptor.create( @@ -30,7 +29,6 @@ Registry.as(EditorInputExtensions.EditorInputFactor WebviewEditorInputFactory.ID, WebviewEditorInputFactory); -registerSingleton(IWebviewService, WebviewService, true); registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true); registerAction2(ShowWebViewEditorFindWidgetAction); diff --git a/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts b/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts new file mode 100644 index 00000000000000..2b1bb41302356c --- /dev/null +++ b/src/vs/workbench/contrib/webview/browser/webview.web.contribution.ts @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview'; +import { WebviewService } from './webviewService'; + +registerSingleton(IWebviewService, WebviewService, true); diff --git a/src/vs/workbench/contrib/webview/browser/webviewWorkbenchService.ts b/src/vs/workbench/contrib/webview/browser/webviewWorkbenchService.ts index df34fcf7f30c2d..3d2d376d5669f4 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewWorkbenchService.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewWorkbenchService.ts @@ -13,7 +13,6 @@ import { Lazy } from 'vs/base/common/lazy'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { isEqual } from 'vs/base/common/resources'; import { EditorActivation } from 'vs/platform/editor/common/editor'; -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { GroupIdentifier } from 'vs/workbench/common/editor'; import { IWebviewService, WebviewContentOptions, WebviewExtensionDescription, WebviewIcons, WebviewOptions, WebviewOverlay } from 'vs/workbench/contrib/webview/browser/webview'; @@ -312,5 +311,3 @@ export class WebviewEditorService implements IWebviewWorkbenchService { }, options, extension); } } - -registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true); diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 099c57315cc3fc..014b8e33684276 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -115,8 +115,7 @@ import 'vs/workbench/contrib/preferences/browser/keyboardLayoutPicker'; import 'vs/workbench/contrib/debug/browser/extensionHostDebugService'; // Webview -import 'vs/workbench/contrib/webview/browser/webviewService'; -import 'vs/workbench/contrib/webview/browser/webviewWorkbenchService'; +import 'vs/workbench/contrib/webview/browser/webview.web.contribution'; // Terminal import 'vs/workbench/contrib/terminal/browser/terminal.web.contribution'; From cca20eba8974b1d6b6a9b71bf4e60a29c8f26648 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Fri, 11 Sep 2020 17:25:12 -0700 Subject: [PATCH 55/55] Revert "API proposal for tree item icon color" This reverts commit 52e557f26b6404d3f811b8dba8c72d882be8485c. --- src/vs/vscode.proposed.d.ts | 5 ----- src/vs/workbench/api/common/extHostTreeViews.ts | 8 +------- src/vs/workbench/common/views.ts | 5 +---- src/vs/workbench/contrib/views/browser/treeView.ts | 3 --- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index eaeb05b5c91f45..a2811eec4183aa 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1025,11 +1025,6 @@ declare module 'vscode' { */ tooltip?: string | MarkdownString | /* for compilation */ any; - /** - * When `iconPath` is a [ThemeColor](#ThemeColor) `iconColor` will be used to set the color of the icon. - */ - iconColor?: ThemeColor; - /** * @param label Label describing this item * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None) diff --git a/src/vs/workbench/api/common/extHostTreeViews.ts b/src/vs/workbench/api/common/extHostTreeViews.ts index 02777446909d7f..8621743e70652d 100644 --- a/src/vs/workbench/api/common/extHostTreeViews.ts +++ b/src/vs/workbench/api/common/extHostTreeViews.ts @@ -13,7 +13,7 @@ import { ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.proto import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions } from 'vs/workbench/common/views'; import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; import { asPromise } from 'vs/base/common/async'; -import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType, ThemeColor } from 'vs/workbench/api/common/extHostTypes'; +import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType } from 'vs/workbench/api/common/extHostTypes'; import { isUndefinedOrNull, isString } from 'vs/base/common/types'; import { equals, coalesce } from 'vs/base/common/arrays'; import { ILogService } from 'vs/platform/log/common/log'; @@ -550,7 +550,6 @@ class ExtHostTreeView extends Disposable { icon, iconDark: this.getDarkIconPath(extensionTreeItem) || icon, themeIcon: extensionTreeItem.iconPath instanceof ThemeIcon ? { id: extensionTreeItem.iconPath.id } : undefined, - iconColor: this.getIconColor(extensionTreeItem), collapsibleState: isUndefinedOrNull(extensionTreeItem.collapsibleState) ? TreeItemCollapsibleState.None : extensionTreeItem.collapsibleState, accessibilityInformation: extensionTreeItem.accessibilityInformation }; @@ -564,11 +563,6 @@ class ExtHostTreeView extends Disposable { }; } - private getIconColor(extensionTreeItem: vscode.TreeItem2): ThemeColor | undefined { - checkProposedApiEnabled(this.extension); - return (extensionTreeItem.iconPath instanceof ThemeIcon) ? extensionTreeItem.iconColor : undefined; - } - private createHandle(element: T, { id, label, resourceUri }: vscode.TreeItem, parent: TreeNode | Root, returnFirst?: boolean): TreeItemHandle { if (id) { return `${ExtHostTreeView.ID_HANDLE_PREFIX}/${id}`; diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 50a97ca01ed073..e50bd99f31395d 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -10,7 +10,7 @@ import { RawContextKey, ContextKeyExpression } from 'vs/platform/contextkey/comm import { localize } from 'vs/nls'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ThemeColor, ThemeIcon } from 'vs/platform/theme/common/themeService'; +import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { getOrSet } from 'vs/base/common/map'; import { Registry } from 'vs/platform/registry/common/platform'; import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -644,8 +644,6 @@ export interface ITreeItem { themeIcon?: ThemeIcon; - iconColor?: ThemeColor; - resourceUri?: UriComponents; tooltip?: string | IMarkdownString; @@ -668,7 +666,6 @@ export class ResolvableTreeItem implements ITreeItem { icon?: UriComponents; iconDark?: UriComponents; themeIcon?: ThemeIcon; - iconColor?: ThemeColor; resourceUri?: UriComponents; tooltip?: string | IMarkdownString; contextValue?: string; diff --git a/src/vs/workbench/contrib/views/browser/treeView.ts b/src/vs/workbench/contrib/views/browser/treeView.ts index 2ea368e7ed00a8..89b629fc0c69ee 100644 --- a/src/vs/workbench/contrib/views/browser/treeView.ts +++ b/src/vs/workbench/contrib/views/browser/treeView.ts @@ -793,9 +793,6 @@ class TreeRenderer extends Disposable implements ITreeRenderer