TerminalFi / LSP-copilot

GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim.
625 stars 25 forks source link

Do we want to maintain `PACKAGE_VERSION` constant manually? #36

Closed jfcherng closed 1 year ago

jfcherng commented 1 year ago

We send plugin version in https://github.com/TheSecEng/LSP-copilot/blob/1703e6a1351874e23b216a0a664a85182d10476d/plugin/plugin.py#L88-L91

If we don't want to maintain that constant manually, we can parse package-metadata.json from a installed package and get plugin version from it. As for those who are not installed via Package Control, we may just send "unknown".

What do you think?

Example of a package-metadata.json

{
    "dependencies": [],
    "platforms": [
        "*"
    ],
    "sublime_text": ">=3000",
    "version": "0.1.3", // <--------------------------------------------------------------------------
    "url": "https://github.com/alepez/LiveReload-sublimetext3",
    "description": "LiveReload plugin for SublimeText"
}