generate_download_plugins_cfg.py 3.26 KB
Newer Older
1 2 3 4 5 6 7
import configparser
import requests
import hashlib

urls = []

for plugin_and_version in '''\
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    vscode/bat/latest
    vscode/clojure/latest
    vscode/coffeescript/latest
    vscode/configuration-editing/latest
    vscode/cpp/latest
    vscode/csharp/latest
    vscode/css/latest
    vscode/css-language-features/latest
    vscode/debug-auto-launch/latest
    vscode/docker/latest
    vscode/emmet/latest
    vscode/fsharp/latest
    vscode/go/latest
    vscode/groovy/latest
    vscode/grunt/latest
    vscode/gulp/latest
    vscode/handlebars/latest
    vscode/hlsl/latest
    vscode/html/latest
    vscode/html-language-features/latest
    vscode/ini/latest
    vscode/jake/latest
    vscode/java/latest
    vscode/javascript/latest
    ms-vscode/js-debug/latest
    vscode/json/latest
# latest json-language-features does offer completions with .theia/settings.json
    vscode/json-language-features/1.45.1
    vscode/less/latest
    vscode/log/latest
    vscode/lua/latest
    vscode/make/latest
    vscode/markdown/latest
# https://github.com/eclipse-theia/theia/issues/7780
42
    vscode/markdown-language-features/1.39.1
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
    vscode/merge-conflict/latest
    vscode/npm/latest
    ms-vscode/node-debug/latest
    ms-vscode/node-debug2/latest
    vscode/objective-c/latest
    vscode/perl/latest
    vscode/powershell/latest
    vscode/pug/latest
    vscode/python/latest
    vscode/r/latest
    vscode/razor/latest
    vscode/ruby/latest
    vscode/rust/latest
    vscode/scss/latest
    vscode/shaderlab/latest
    vscode/shellscript/latest
    vscode/sql/latest
    vscode/swift/latest
    vscode/theme-abyss/latest
    vscode/theme-defaults/latest
    vscode/theme-kimbie-dark/latest
    vscode/theme-monokai/latest
    vscode/theme-monokai-dimmed/latest
    vscode/theme-quietlight/latest
    vscode/theme-red/latest
    vscode/theme-solarized-dark/latest
    vscode/theme-tomorrow-night-blue/latest
    vscode/typescript/latest
    vscode/typescript-language-features/latest
    vscode/vb/latest
    vscode/vscode-theme-seti/latest
    vscode/xml/latest
    vscode/yaml/latest
    EditorConfig/EditorConfig/latest
    dbaeumer/vscode-eslint/latest
    ms-vscode/references-view/latest
79 80 81 82 83
    golang/Go/0.16.2
    vscjava/vscode-java-debug/0.29.0
    redhat/java/0.61.0
    vscjava/vscode-java-test/0.26.0
    ms-python/python/2020.9.112786
84
    perrinjerome/vscode-zc-buildout/latest
85
    jebbs/plantuml/2.13.12
86 87 88
    rafaelmaiolla/diff/latest
    perrinjerome/git-commit-syntax/latest
    perrinjerome/git-rebase-syntax/latest
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
'''.splitlines():
  plugin_and_version = plugin_and_version.strip()
  if not plugin_and_version or plugin_and_version.startswith('#'):
    continue
  publisher, extension_name, version = plugin_and_version.split('/')

  api_url = f'https://open-vsx.org/api/{publisher}/{extension_name}/{version}'
  download_url = requests.get(api_url).json()['files']['download']
  md5sum = hashlib.md5(requests.get(download_url).content).hexdigest()
  urls.append(f'{publisher}-{extension_name} {download_url} {md5sum}')

cfg = configparser.ConfigParser()
cfg.add_section('theia-download-plugins')
cfg.set('theia-download-plugins', 'urls', '\n'.join(urls))

with open('download-plugins.cfg', 'w') as f:
  f.write(f"""\
# This file is automatically generated from {__file__}
# Do not edit directly.
""")
  cfg.write(f)