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

Provide DS type-aware diagnostics + code actions for server.xml refs #258

Open
scottkurz opened this issue Dec 8, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@scottkurz
Copy link
Member

scottkurz commented Dec 8, 2023

When we have an 'xyzRef' attribute like jobStoreRef in:

<batchPersistence jobStoreRef="xyz"/>

we only do validation and code-assist in the XSD space. This doesn't capture the level of type-awareness we could provide if we built a model of the DS types of the elements configured within the server.xml.

(Here I'll stop and acknowledge I'm probably not using the correct terminology. Apologies for that).

On the other hand, WDT/LDT does build such a model and so it is able to offer a code action of specific values of elements of the right (DS) type .
So here I get a code action completion suggestion of the databaseStore-typed elements that are actually configured in this server.xml

image

and a diagnostic if the value doesn't match an actually-configured element of the right type:

image

The XSD validation is a much-simpler validation, just ensuring there are no spaces or commas.

Not sure if the WDT/LDT validation happens after all server config files (dropins/includes) are merged or not. (A bit of a separate issue though).

One more point

I could nitpick a bit with the WDT/LDT validation design with the above example. It seems to complain about a server.xml with just this:

 <batchPersistence jobStoreRef="defaultDatabaseStore"/>
 <dataSource id="DefaultDataSource">

saying An element of type 'databaseStore' with ID 'defaultDatabaseStore' could not be found.

Well, defaultDatabaseStore may not explicitly be listed in server.xml, but it's still active as a default instance defined at another level, in this case.

Perhaps since it's only a warning we are close enough. But something to think about before we add new code, libraries, etc. to the mix here.

@scottkurz scottkurz added the enhancement New feature or request label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant