-
Notifications
You must be signed in to change notification settings - Fork 27
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
Properties files with property expressions are flagged as wrong #392
Comments
The expression validation is very basic,it checks that content of expression reference a property that you define in the properties file (ex : DBUSER:sa=XXXX). But in your case, it doesn't make sense. The expression validation should be improved again. To remove this error, you can disable the expression validation like this:
or if you want to ignore validation only for quarkus.datasource.username, you can define in your settings:
I noticed that @AlexXuChen please review it. |
@angelozerr property expressions with a default value should not raise an error:
See https://quarkus.io/guides/config-reference#property-expressions |
please create an issue. The original issue was about that expression property was not found. |
I disagree. Missing default property expression support is the root cause of this issue, that's why it's flagged as an error. |
@fbricon I agree with you, default value should be supported, but even if we support it, we will have an error on I mean if you write just an expression without default value:
you have the same problem. |
@jamesfalkner could you explain me where you declare the property |
It's set in the environment and consumed at runtime to replace the value of ${DBUSER} with the value from the process's environment. (but it is very likely not defined in the IDE's environment - it's just assumed it'll be defined at runtime in production - hence the default value is provided as well). |
I suppose we could expand Should we emit a diagnostic when we encounter a variable with no default value, where we can't detect a value at build time ? The warning could mention that they should ensure it is at least defined at runtime. |
What is your configuration from https://quarkus.io/guides/config-reference#configuration-sources (System properties, Environment variables or .env)? |
Fixed with eclipse/lsp4mp#201 |
For example, in my
application.properties
I have:%prod.quarkus.datasource.username = ${DBUSER:sa}
In vscode, I get red squigglies:
And the hover tooltip says:
Yet the app works as expected!
The text was updated successfully, but these errors were encountered: