Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [LSP]: How to support project configuration files
[LSP]: How to support project configuration files [message #1870557] Tue, 03 September 2024 10:30 Go to next message
Sebastian Waldhauser is currently offline Sebastian WaldhauserFriend
Messages: 24
Registered: March 2022
Junior Member
Hello,

I'm currently trying to find out how to best implement a project configuration file (e.g. similar to .project/.classpath of JDT Projects).

For example, this configuration contains values relevant to the initialization of the project (e.g. something similar to the classpath in java) in the LSP and the validator.
Changes to the project configuration therefore affect all resources of a project and should be picked up automatically after a change to the file.

I looked into org.eclipse.xtext.workspace.IProjectConfig, however, I found no way of refreshing the config once it was created.
Also, I looked into modeling the configuration file as a language, however, that seems heavyweight.

How would you implement this feature?

Best regards,
Sebastian
Re: [LSP]: How to support project configuration files [message #1870560 is a reply to message #1870557] Tue, 03 September 2024 10:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
Can you check didworkspaceconfigurationchanged implementation

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [LSP]: How to support project configuration files [message #1870563 is a reply to message #1870560] Tue, 03 September 2024 11:02 Go to previous messageGo to next message
Sebastian Waldhauser is currently offline Sebastian WaldhauserFriend
Messages: 24
Registered: March 2022
Junior Member
This request is sent from the Client, so I would have to implement that logic in every client. Also, by default the whole workspace is refreshed, which results in unecessary work if there are multiple projects in the workspace.
Re: [LSP]: How to support project configuration files [message #1870569 is a reply to message #1870563] Tue, 03 September 2024 11:08 Go to previous messageGo to next message
Sebastian Waldhauser is currently offline Sebastian WaldhauserFriend
Messages: 24
Registered: March 2022
Junior Member
Maybe I reparse the config during incremental building and update the IProjectConfig of the ResourceSet. Would that be a valid approach?
Re: [LSP]: How to support project configuration files [message #1870572 is a reply to message #1870569] Tue, 03 September 2024 11:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
There is also the did configuration. Change in lsp

Don't you have any control in the client ?
Maybe you can also use
Difdchangewatchedfiiles or however it is exactly called


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: [LSP]: How to support project configuration files [message #1870578 is a reply to message #1870572] Tue, 03 September 2024 13:53 Go to previous messageGo to next message
Sebastian Waldhauser is currently offline Sebastian WaldhauserFriend
Messages: 24
Registered: March 2022
Junior Member
The documentation of org.eclipse.xtext.ide.server.LanguageServerImpl#didChangeConfiguration says, that the notification is sent from the client;
A notification sent from the client to the server to signal the change of configuration settings.

I have control over one specific client (VSCode) but I don't know what other editors are going to be used.

I don't want to watch the files, because then I have to trigger the builder myself.
Re: [LSP]: How to support project configuration files [message #1870656 is a reply to message #1870578] Wed, 04 September 2024 14:44 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
As I indicated there is no ootb solution

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Previous Topic:Code Action Resource access
Next Topic:Create object of dsl ecore classes programatically from generator (xtend)
Goto Forum:
  


Current Time: Wed Jan 15 11:38:19 GMT 2025

Powered by FUDForum. Page generated in 0.03374 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top