Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(vscode-plugin): read manifest instead of importing

Matthew Espino745efe515a93
diff --git a/packages/vscode-plugin/src/extension.ts b/packages/vscode-plugin/src/extension.ts
index 8a780dbce..63951e9d5 100644
--- a/packages/vscode-plugin/src/extension.ts
+++ b/packages/vscode-plugin/src/extension.ts
@@ -41,11 +41,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
try {
const manifest: { contributes: { configuration: { properties: { [key: string]: object } } } } =
- (
- await import(Uri.joinPath(context.extensionUri, 'package.json').fsPath, {
- with: { type: 'json' }
- })
- ).default;
+ JSON.parse(
+ (await workspace.fs.readFile(Uri.joinPath(context.extensionUri, 'package.json'))).toString()
+ );
const configs = Object.keys(manifest.contributes.configuration.properties);
context.subscriptions.push(
workspace.onDidChangeConfiguration(async (event) => {
@@ -56,7 +54,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
})
);
} catch (error) {
- showError('Failed to import manifest file', error);
+ showError('Failed to read manifest file', error);
}
context.subscriptions.push(