Skip to content

Quick Fix for unknown properties broken #442

Closed

Description

@habuma

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.

Activity

  1. added this to the 4.6.1.RELEASE milestone on Apr 6, 2020
  2. kdvolder commented on Apr 6, 2020

    @kdvolder
    Member

    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.

  3. kdvolder commented on Apr 7, 2020

    @kdvolder
    Member

    Trying to verify the fix today in CI build but something is still not working. I'll have to take another look.

  4. sjwl commented on Sep 23, 2020

    @sjwl

    Is there a quick fix for vscode? I'm getting the same error in vscode but with no quick fix available.

  5. kdvolder commented on Sep 23, 2020

    @kdvolder
    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions