Property expression validation#21
Conversation
4d64288 to
5148fc9
Compare
| return n.getNodeType() == NodeType.PROPERTY; | ||
| }).map(prop -> { | ||
| return ((Property)prop).getPropertyNameWithProfile(); | ||
| }).collect(Collectors.toList())); |
There was a problem hiding this comment.
I think its best if we don't do this here. If we are in an application.properties file that has no property expressions, then it seems that we didn't need to compute this in the first place.
Maybe we can:
Check in validatePropertyValueExpressions() if the property is a project property by checking MicroProfilePropertiesUtils.getProperty(propertyName, projectInfo) == null
like here:
https://github.com/eclipse/lsp4mp/blob/82c4798ac142efeb06499ece053407ef01009d46/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/services/MicroProfileValidator.java#L90-L91
and if MicroProfilePropertiesUtils.getProperty(propertyName, projectInfo) == null, then we can check if it matches a property in the properties file.
What do you think?
There was a problem hiding this comment.
I think this is a good idea. I'll work on getting this implemented.
There was a problem hiding this comment.
I switched to using lazy loading for creating the list (only create the list right before its needed, then reuse it for future tasks). The implementation is kind of messy; I am open to suggestions on how to improve it.
de8657a to
70fc752
Compare
|
@datho7561 please make sure new file headers follow this format:
|
70fc752 to
467b838
Compare
467b838 to
a9ac3fc
Compare
You can now set the severity of diagnostics related to references to unknown properties using `microprofile.tools.validation.expression.severity`. Requires the server-side changes in eclipse-lsp4mp/lsp4mp#21 Signed-off-by: David Thompson <davthomp@redhat.com>
You can now set the severity of diagnostics related to references to unknown properties using `microprofile.tools.validation.expression.severity`. Requires the server-side changes in eclipse-lsp4mp/lsp4mp#21 Signed-off-by: David Thompson <davthomp@redhat.com>
Two things are validated: * If there is a closing brace * If the referenced property exists (if it is defined in a Java file or assigned a value in the properties file) Closes redhat-developer/quarkus-ls#334 Signed-off-by: David Thompson <davthomp@redhat.com>
a9ac3fc to
f923014
Compare
You can now set the severity of diagnostics related to references to unknown properties using `microprofile.tools.validation.expression.severity`. Requires the server-side changes in eclipse-lsp4mp/lsp4mp#21 Signed-off-by: David Thompson <davthomp@redhat.com>

Two things are validated:
Closes redhat-developer/quarkus-ls#334
Signed-off-by: David Thompson davthomp@redhat.com