From 2cedcc5a58ab8cf5658a04abf2b351c6e58cd99f Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Thu, 22 May 2025 23:18:08 +0000 Subject: [PATCH] Add vscode CSS properties to the script get-vscode-usages.sh (#3752) The script will report which vscode CSS vars are being used in the webview, as well the uses of the vscode SDK. --- scripts/get-vscode-usages.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/get-vscode-usages.sh b/scripts/get-vscode-usages.sh index 02c2d1205..79b40cb66 100755 --- a/scripts/get-vscode-usages.sh +++ b/scripts/get-vscode-usages.sh @@ -3,7 +3,8 @@ set -eu DIR=${1:-src/} DEST_DIR=dist-standalone -DEST=dist-standalone/vscode-uses.txt +SDK_DEST=$DEST_DIR/vscode-sdk-uses.txt +CSS_DEST=$DEST_DIR/vscode-css-uses.txt mkdir -p $DEST_DIR { @@ -11,8 +12,16 @@ git grep -h 'vscode\.' $DIR | grep -Ev '//.*vscode' | # remove commented out code sed 's|.*vscode\.|vscode.|'| # remove everything before vscode. sed 's/[^a-zA-Z0-9_.].*$//' | # remove everything after last identifier -sort | uniq > $DEST +sort | uniq > $SDK_DEST } +echo Wrote uses of the vscode SDK to $(realpath $SDK_DEST) -echo Done, wrote uses of the vscode SDK to $(realpath $DEST) +{ +grep -rh -- --vscode- webview-ui/build/ | +sed 's/--vscode/\n--vscode/g' | # One var per line +grep -- --vscode | # Remove lines that don't have vars. +sed 's/[),"\\].*$//' | # remove from the end of the var name to the end of the line. +sort | uniq > $CSS_DEST +} +echo Wrote vscode vars used to $(realpath $CSS_DEST)