You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the past several versions of the STS (the Eclipse version) the "Quick Fix" for an unknown property isn't working as it used to work and is, in fact, not very useful.
Suppose that I have the following YAML:
myapp:
orders:
pageSize: 10
In order versions of STS (I'm not sure when this quit working), the Quick Fix would offer an option for creating metadata for myapp.orders.pageSize. But in more recent versions it offers the option of creating metadata for myapp. Not only is this inconsistent with how it used to work, it isn't useful at all. I would never need metadata for myapp...but I would need it for the entire myapp.orders.pageSize.
Was able to easily reproduce this easily. Thanks for reporting this. We weren't aware it was broken and also I have no idea when / how it got broken. It certainly wasn't an intentional change.
For the past several versions of the STS ...
In future I hope you will report these kinds of things as soon as you notice them.
I know, I know, we always think someone else will notice the bug too and report it, so we don't bother. I'm guilty of this myself on occasion as well.
Yes, it works I just tried in both application.properties and application.yml file. Works in both cases.
Some little oddities I found that might be a little confusing:
you must place the text cursor/caret inside the warning marker (just hovering the error isn't enough). Once cursor is in the right spot a litle 'lightbulb' icon appears. Click on that to get the quickfix
when you apply the quickfix it creates metadata file (if needed) and adds some metadata to the file to declare the property as a 'known' property. However... it does not automatically save the file (the changes are made in editor buffer only). So you have to make sure to change the file for the change to actually take effect.
Activity
kdvolder commentedon Apr 6, 2020
Was able to easily reproduce this easily. Thanks for reporting this. We weren't aware it was broken and also I have no idea when / how it got broken. It certainly wasn't an intentional change.
In future I hope you will report these kinds of things as soon as you notice them.
I know, I know, we always think someone else will notice the bug too and report it, so we don't bother. I'm guilty of this myself on occasion as well.
Anyhow...I'm really glad you finally reported it.
Quick Fix for unknown properties in application.yml
kdvolder commentedon Apr 7, 2020
Trying to verify the fix today in CI build but something is still not working. I'll have to take another look.
sjwl commentedon Sep 23, 2020
Is there a quick fix for vscode? I'm getting the same error in vscode but with no quick fix available.
kdvolder commentedon Sep 23, 2020
Yes, it works I just tried in both application.properties and application.yml file. Works in both cases.
Some little oddities I found that might be a little confusing:
you must place the text cursor/caret inside the warning marker (just hovering the error isn't enough). Once cursor is in the right spot a litle 'lightbulb' icon appears. Click on that to get the quickfix
when you apply the quickfix it creates metadata file (if needed) and adds some metadata to the file to declare the property as a 'known' property. However... it does not automatically save the file (the changes are made in editor buffer only). So you have to make sure to change the file for the change to actually take effect.