Skip to content
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

Support the VSCode extension on the web #1487

Open
Yokozuna59 opened this issue May 6, 2024 · 6 comments
Open

Support the VSCode extension on the web #1487

Yokozuna59 opened this issue May 6, 2024 · 6 comments
Labels
extension VS Code extension related issue help wanted Extra attention is needed yeoman Yeoman generator related issue

Comments

@Yokozuna59
Copy link
Contributor

The current Langium VSCode extension doesn't work on the web (https://vscode.dev):

IMG_0104

I think it would be nice to have the extension runnable on the web.

I think this could be applied to both langium and langium-generator.


I used langium-sql as a reference to make my extension runnable on both.

@msujew
Copy link
Contributor

msujew commented May 6, 2024

I've also thought about this, but didn't have the time yet to look into this. The main issue is that the grammar language features imports which are a bit difficult to deal with in a web extension.

Any contribution for this is appreciated though.

@msujew msujew added help wanted Extra attention is needed extension VS Code extension related issue labels May 6, 2024
@Yokozuna59
Copy link
Contributor Author

@msujew I think another issue would be the conflict in the generator-langium package between the web and VSCode extension templates. Both of them have common files but are stored in different directories.

Could you share some guidance pointing me in the correct direction so I may be able to work on this?

@msujew
Copy link
Contributor

msujew commented May 7, 2024

I don't think that these files should be in conflict. The VSCode web extension only needs 4 things:

  1. A browser entry point in the package.json of the extension
  2. A corresponding JavaScript bundle that is generated from a extension-browser.ts file.
  3. A main-browser.ts file that represents the browser based language server.
  4. A corresponding entry in the bundler script (esbuild.mjs) for the extension-browser.ts and main-browser.ts file.

There is no overlap between these 4 points and the web template AFAIK.

@Yokozuna59
Copy link
Contributor Author

The web template also uses an identical main-browser.ts file. And since the extension template has a separate extension folder, there will be two main-browser.ts, unless we store both of them in src/language.

@msujew
Copy link
Contributor

msujew commented May 7, 2024

Ah, right. We can probably solve that using some logic in the generator. We use that to merge the package.json in the end for example. Alternatively, this would be a good reason to start generating a npm workspace from the yeoman generator. But that would be a larger refactoring that might be out of scope for this change.

@msujew msujew added the yeoman Yeoman generator related issue label May 14, 2024
@msujew
Copy link
Contributor

msujew commented May 14, 2024

I've created #1495 to track the yeoman generator refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension VS Code extension related issue help wanted Extra attention is needed yeoman Yeoman generator related issue
Projects
None yet
Development

No branches or pull requests

2 participants