<commit_before>#!/bin/bash

set -e
source $DOTFILES_ROOT/util/common.sh

# Ensure code exists, or exit otherwise
command -v code >/dev/null 2>&1 || exit

if [ "$(uname -s)" == "Darwin" ]; then
  CODE_USER_DIR="$HOME/Library/Application Support/Code/User"
elif [ "$(uname -s)" == "Linux" ]; then
  CODE_USER_DIR="$HOME/.config/Code/User"
fi

# Symlink the settings file
mkdir -p "$CODE_USER_DIR"
ln -sfv "$DOTFILES_ROOT/vscode/settings.json" "$CODE_USER_DIR/settings.json"

VSCODE_PACKAGES=(
  haaaad.ansible
  ms-vscode.cpptools
  faustinoaq.crystal-lang
  stevejpurves.cucumber
  msjsdiag.debugger-for-chrome
  EditorConfig.EditorConfig
  emberjs.emberjs
  codezombiech.gitignore
  eamodio.gitlens
  tberman.json-schema-validator
  PKief.material-icon-theme
  zhuangtongfa.Material-theme
  felixfbecker.php-pack
  ricard.PostCSS
  mohsen1.prettify-json
  esbenp.prettier-vscode
  rebornix.Ruby
  rust-lang.rust
  shardulm94.trailing-spaces
  eg2.tslint
  whatwedo.twig
  mjmcloug.vscode-elixir
  dbaeumer.vscode-eslint
  DSKWRK.vscode-generate-getter-setter
  Equinusocio.vsc-material-theme
)

REMOVE_VSCODE_PACKAGES=(
  g3ortega.crystal
  kofno.crystal-ide
  sbrink.elm
)

INSTALLED_PACKAGES=( $(code --list-extensions) )

for package in "${REMOVE_VSCODE_PACKAGES[@]}"; do
  if [[ ! " ${INSTALLED_PACKAGES[@]} " =~ " ${package} " ]]; then
    step "Uninstalling vscode extension: '$package'"
    code --uninstall-extension $package
  fi
done

for package in "${VSCODE_PACKAGES[@]}"; do
  step "Installing vscode extension: '$package'"
  if [[ ! " ${INSTALLED_PACKAGES[@]} " =~ " ${package} " ]]; then
    code --install-extension $package
  else
    echo "Already installed $package"
  fi
done<commit_msg>Remove removed packages from vscode removals<commit_after>#!/bin/bash

set -e
source $DOTFILES_ROOT/util/common.sh

# Ensure code exists, or exit otherwise
command -v code >/dev/null 2>&1 || exit

if [ "$(uname -s)" == "Darwin" ]; then
  CODE_USER_DIR="$HOME/Library/Application Support/Code/User"
elif [ "$(uname -s)" == "Linux" ]; then
  CODE_USER_DIR="$HOME/.config/Code/User"
fi

# Symlink the settings file
mkdir -p "$CODE_USER_DIR"
ln -sfv "$DOTFILES_ROOT/vscode/settings.json" "$CODE_USER_DIR/settings.json"

VSCODE_PACKAGES=(
  haaaad.ansible
  ms-vscode.cpptools
  faustinoaq.crystal-lang
  stevejpurves.cucumber
  msjsdiag.debugger-for-chrome
  EditorConfig.EditorConfig
  emberjs.emberjs
  codezombiech.gitignore
  eamodio.gitlens
  tberman.json-schema-validator
  PKief.material-icon-theme
  zhuangtongfa.Material-theme
  felixfbecker.php-pack
  ricard.PostCSS
  mohsen1.prettify-json
  esbenp.prettier-vscode
  rebornix.Ruby
  rust-lang.rust
  shardulm94.trailing-spaces
  eg2.tslint
  whatwedo.twig
  mjmcloug.vscode-elixir
  dbaeumer.vscode-eslint
  DSKWRK.vscode-generate-getter-setter
  Equinusocio.vsc-material-theme
)

REMOVE_VSCODE_PACKAGES=(
)

INSTALLED_PACKAGES=( $(code --list-extensions) )

for package in "${REMOVE_VSCODE_PACKAGES[@]}"; do
  if [[ ! " ${INSTALLED_PACKAGES[@]} " =~ " ${package} " ]]; then
    step "Uninstalling vscode extension: '$package'"
    code --uninstall-extension $package
  fi
done

for package in "${VSCODE_PACKAGES[@]}"; do
  step "Installing vscode extension: '$package'"
  if [[ ! " ${INSTALLED_PACKAGES[@]} " =~ " ${package} " ]]; then
    code --install-extension $package
  else
    echo "Already installed $package"
  fi
done
{'fraction_non_alphanumeric': 0.13380489242558208, 'fraction_numerical': 0.0038314176245210726, 'mean_word_length': 4.2457496136012365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3347190', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1306, 'n_words': 237}