-
Notifications
You must be signed in to change notification settings - Fork 98
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
Cant use asciidoctor in my own extension as soon as i active asciidoctor-vscode extension #881
Comments
Hey! Please ask questions on https://chat.asciidoctor.org/ |
Hi @ggrossetie npx --package yo --package generator-code -- yo code And added asciidoctor: yarn add asciidoctor require asciidoctor in extension.ts like import * as vscode from 'vscode'
const asciidoctor = require('asciidoctor')()
export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "helloworld-sample" is now active!');
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
const disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
// The code you place here will be executed every time your command is executed
// Display a message box to the user
vscode.window.showInformationMessage(`Hello World!`);
});
context.subscriptions.push(disposable);
} and the "Hello World" example command will fail as soon as your extension is activated and it works if its not. |
Hello @ggrossetie, please reopen this issue again and have a second look into it. |
Hi @ggrossetie, did you have some time to look into this bug again? |
No but my guess is that the Asciidoctor VSCode is using Since Opal "mutates" the whole runtime you cannot have a library compiled with Opal version X and another one compiled with Opal version Y. |
Hi, thanks @ggrossetie for the response. Would it be sufficient if you update asciidoctor/core to 3.x in this extension? |
The rule is that every extension that relies on Opal should use the exact same version. I guess it should work if we are both using the same version of Asciidoctor.js (and thus the same version of Opal). |
Hello there,
im the maintainer of a another extension based on asciidoc (https://github.com/flobilosaurus/vscode-asciidoc-slides).
As soon as i active this extension in my vscode, im unable to import asciidoctor in my extension code.
I just started a fresh extension from scratch and this does not work:
It works if your extension is uninstalled but i doesnt if its activated.
The error message i get is the following:
2024-05-25 23:35:24.054 [error] TypeError: Opal.queue is not a function
I dont know much about Opal the following things seem to happen:
Opal.queue seems to be undefined as soon as you extension is used. But this function seems to be required by asciidoctor.
Would be great if you could help me.
The text was updated successfully, but these errors were encountered: