-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid hard-coding extension ID except in package.json
#786
Comments
We can also move the telemetry key to the package.json file and access it with typescript magic |
The
We'll have to bump our minimum version of VS Code from 1.52.0 to 1.55.0 in order to use this property instead of |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Problem Statement
Currently we have the extension ID hard-coded in a number of places:
vscode-terraform/src/extension.ts
Line 15 in d79aeca
vscode-terraform/src/test/helper.ts
Line 26 in d79aeca
vscode-terraform/src/test/workspaces.test.ts
Line 6 in d79aeca
Additionally in some places we relatedly use the global
vscode.extensions
API which we shouldn't need to use given that this is mainly designed for accessing APIs of other extensions and our code should be testable without relying on such high-level API.This prevents us from re-publishing the extension easily under a different name or a publisher and also makes it difficult to run tests in such circumstances. Lastly it forces us to effectively write E2E tests for code that can otherwise be just unit-tested in isolation.
This is a pre-requisite for #774
Expected Maintainer Experience
name
orpublisher
values inpackage.json
package.json
to enable publishing of a different build or testing in a "sandbox" publisherProposal
vscode.ExtensionContext
as part of theactivate()
call, which itself already provides access to the extension itself. We can use this to pull out the extension ID + version dynamically frompackage.json
where necessary (e.g. for telemetry reporting)The text was updated successfully, but these errors were encountered: