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

Quick Fix for unknown properties broken #442

Closed
habuma opened this issue Apr 6, 2020 · 4 comments
Closed

Quick Fix for unknown properties broken #442

habuma opened this issue Apr 6, 2020 · 4 comments
Assignees
Milestone

Comments

@habuma
Copy link
Member

habuma commented Apr 6, 2020

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.

@martinlippert martinlippert transferred this issue from spring-attic/spring-ide Apr 6, 2020
@martinlippert martinlippert added this to the 4.6.1.RELEASE milestone Apr 6, 2020
@kdvolder
Copy link
Member

kdvolder commented 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.

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.

Anyhow...I'm really glad you finally reported it.

@kdvolder
Copy link
Member

kdvolder commented 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
Copy link

sjwl commented 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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants