Closed Yokozuna59 closed 4 months ago
@Yokozuna59 This seems to work well for me:
Looking at your error, you might need to ensure that you actually create an instance of LangiumCoreServices
, as LangiumServices
contains the LSP related services.
Anyway, a reproducible example/link would be appreciated to see what's wrong.
@msujew Oh, sorry about that.
I noticed that the service uses the LangiumServices
interface, but it didn't throw an error, so I didn't assume there is a LangiumCoreServices
.
Thank you.
Langium version: 3.0.0 Package name:
langium
Steps To Reproduce
langium
v3.0.0. (Or use an existing one)inject
function parameter to usecreateDefaultCoreModule
instead ofcreateDefaultModule
.https://github.com/eclipse-langium/langium/blob/be0407ef03397fe04bf2dfbab387e13034d92279/examples/arithmetics/src/language-server/arithmetics-module.ts#L65-L69
Link to code example: You could use the existing examples in the repo.
Just modify those lines of code to this:
The current behavior
Errors are thrown.
The errors
``` error TS2345: Argument of type 'ModuleThe expected behavior
No errors were thrown, and everything worked perfectly.