eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
665 stars 61 forks source link

Enable grammar imports from `node_modules` #1376

Open msujew opened 4 months ago

msujew commented 4 months ago

Right now, Langium only allows to import other grammars from a relative perspective. We might want to enable a behavior similar to JS/TS in which a non-relative import automatically leads to an import from node_modules. I.e.:

// current
import '../../node_modules/package/src/grammar';
// goal
import 'package/src/grammar';
// maybe even just (and add a way to discover grammars in the package.json)
import 'package';