Open scottkurz opened 1 year ago
Just noting here that if this is implemented, we would want the same message presented in IntelliJ IDEA and Visual Studio Code.
Originally we'd titled this as "warn user that a save is needed" (in order to cause a .libertyls refresh, assuming LMP 3.7.1), when adding a new feature.
However, if we broaden our view a bit... a very similar scenario arises when dev mode has been run earlier, and an XSD has already been generated, and now dev mode is stopped. If a user at this point updates the feature set, they are similarly going to be stuck with a stale XSD.
Perhaps the thing to detect is that the <featureManager>
content has a newer delta than the generated XSD file timestamp on disk?
Though this might present a challenge.... what if the XML LS was started after the new feature was added? Either it was added outside of the IDE or perhaps a new instance of the XML LS has started since the edit took place.
Just noting here that if this is implemented, we would want the same message presented in IntelliJ IDEA and Visual Studio Code.
This issue really belongs in the LCLS, doesn't it... I'm going to transfer it there. Also going to queue it up for a design issues call since this is non-trivial.
However, if we broaden our view a bit... a very similar scenario arises when dev mode has been run earlier, and an XSD has already been generated, and now dev mode is stopped. If a user at this point updates the feature set, they are similarly going to be stuck with a stale XSD.
The Liberty Maven/Gradle plugin deletes the .libertyls
directory and all of its contents when feature(s) get installed in order to force the regeneration of the schema and feature list xml. The next time the project is opened in Liberty Tools and the user edits the server.xml, LCLS will detect that it needs to generate the schema and feature list xml.
But I think the initial issue remains, when they modify the features in the server.xml and have not saved the file (while running dev mode), or they saved the file but have not rebuilt the project by starting dev mode.
See https://github.com/OpenLiberty/liberty-language-server/issues/139#issuecomment-1329382199.
Not sure how this would be done in Liberty Tools Eclipse.