Open Yokozuna59 opened 6 months ago
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 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?
I don't think that these files should be in conflict. The VSCode web extension only needs 4 things:
browser
entry point in the package.json
of the extensionextension-browser.ts
file.main-browser.ts
file that represents the browser based language server.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.
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
.
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.
I've created https://github.com/eclipse-langium/langium/issues/1495 to track the yeoman generator refactoring.
The current Langium VSCode extension doesn't work on the web (https://vscode.dev):
I think it would be nice to have the extension runnable on the web.
I think this could be applied to both
langium
andlangium-generator
.I used
langium-sql
as a reference to make my extension runnable on both.