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

No content-assist in editor #166

Open
soerendomroes opened this issue Jun 4, 2024 · 5 comments
Open

No content-assist in editor #166

soerendomroes opened this issue Jun 4, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@soerendomroes
Copy link
Collaborator

The editor in VS Code has no content-assist, while Epoch still has it.

I expect ctrl+space to display me more than the strings that it currently does. These strings are not calculated on the server but on the client.

I think that some Xtext configuration for the language server may be missing for this. Maybe it was never registered fo the language server but only for the general case.

Screencast.from.04.06.2024.12.27.18.webm
Screencast.from.04.06.2024.12.28.21.webm
@lhstrh
Copy link
Member

lhstrh commented Jun 4, 2024

Any hint as to what to change to fix this?

@soerendomroes
Copy link
Collaborator Author

soerendomroes commented Jun 6, 2024

There should be something named *RuntimeModule that binds a lot of things for the Eclipse case. A similar class that may be called *IdeModule or Abstract*IdeModule should do the same for the language server case. This should be added to the injector in your IdeSetup. If this is not the case, the features generated by Xtext will not be available in the language server.

@soerendomroes
Copy link
Collaborator Author

Another problem might be that your LFIdeSetup does not regenerate the injector if it was previously generated without the IdeModule as it may be the case if one just does the normal setup first.

We fixed this here in SCCharts.

@soerendomroes soerendomroes added the bug Something isn't working label Jul 8, 2024
@soerendomroes
Copy link
Collaborator Author

soerendomroes commented Jul 8, 2024

Maybe this fixes it but I should test this first.

https://github.com/soerendomroes/lingua-franca/tree/sdo/overrideSingletonInjectorIfNecessary

This did not fix it.

@soerendomroes
Copy link
Collaborator Author

soerendomroes commented Oct 23, 2024

I will not have time in the next year I guess to have a look at this. The problem is somehow complex for me since I am not familiar with the way the LF language server registers everything and probably complex for others since injectors are unfamiliar to them.

For someone who wants to tackle this:
The issue persists since somewhere a LFRuntimeModule is added to an injector before the LFIdeModule can add their important modules such as content-assist. Since the injector is a singleton and the registration of the IdeModule randomly or not randomly happens later, we need to make sure that once the IdeModule tries to add its contents, it overrides whatever the RuntimeModule registered. Which means it should override the injector the RuntimeModule registered with its own injector.

If there are specific questions, I am happy to help out, but I sadly do not have time to fix it myself. Seeing people write LF programs without content assist and using Cody or Co-pilot for "content-assist" is kind of sad, so I hope that someone finds time for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants