tis-vscode-config

0.2.2-6
Configure Visual Studio Code
124 downloads
Download
View on luti logo
tis-vscode-config icon

  Description 

  • package : tis-vscode-config
  • version : 0.2.2-6
  • architecture : all
  • categories : Development
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Configure Visual Studio Code
  • locale : all
  • target_os : all
  • min_wapt_version : 2.0
  • sources : https://code.visualstudio.com/Download
  • installed_size :
  • impacted_process :
  • description_fr : Configuration de Visual Studio Code
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2022-03-25T10:43:45.631243
  • Depends :
  • Conflicts :

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
import json

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

Configuration procedure: https://supunkavinda.blog/vscode-editing-settings-json

File -> Preferences -> Settings -> Extensions -> Scroll down and find "Edit in settings.json"

Or in these paths in your OS :
Windows : %APPDATA%\Code\User\settings.json
macOS   : $HOME/Library/Application Support/Code/User/settings.json
Linux   : $HOME/.config/Code/User/settings.json

https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    pass


def session_setup():
    print("Applying: VSCode configuration")

    # Initializing variables
    if get_os_name() == "Windows":
        user_conf_dir = makepath(user_appdata, "Code", "User")
    elif get_os_name() == "Linux":
        user_conf_dir = makepath(user_home_directory(), ".config", "Code", "User")
    elif get_os_name() == "Darwin":
        user_conf_dir = makepath(user_home_directory(), "Library", "Application Support", "Code", "User")

    user_conf_file = makepath(user_conf_dir, "settings.json")
    user_conf_content = r"""{
    "extensions.ignoreRecommendations": true,
    "editor.wordWrap": "on",
    "editor.minimap.enabled": false,
    "workbench.activityBar.visible": true,
    "workbench.startupEditor": "none",

    "restructuredtext.preview.scrollEditorWithPreview": false,
    "restructuredtext.preview.scrollPreviewWithEditor": false,
    "markdown.preview.scrollEditorWithPreview": false,
    "markdown.preview.scrollPreviewWithEditor": false,

    "python.formatting.provider": "black",
    "python.formatting.blackArgs": [
        "--line-length",
        "150"
    ],
    "npm.fetchOnlinePackageInfo": false,
    "json.schemaDownload.enable": false

}"""

    user_conf_data = json.loads(user_conf_content)
    if not isdir(user_conf_dir):
        mkdirs(user_conf_dir)
    if not isfile(user_conf_file):
        print("Creating: %s" % user_conf_file)
        json_write_file(user_conf_file, user_conf_data)
    else:
        new_user_conf_data = json_load_file(user_conf_file)
        new_user_conf_data.update(user_conf_data)
        print("Updating: %s" % user_conf_file)
        json_write_file(user_conf_file, new_user_conf_data)

										

  Changelog 



No changelog.txt.
									
  manifest.sha256