Skip to content

Content assist for keys that exist in YAML and properties files #427

Closed

Description

@humphreygao

Take the YAML below as example, if I trigger the content-assist command Alt+/ when the cursor is between the curly braces of ${}, it would be better to provide proposals like server.port, spring.application.name, spring.cloud.consul.host and spring.cloud.consul.port.

server:
  port: 8006

spring:
  application:
    name: dadada
  cloud:
    consul:
      host: localhost
      port: 8500
      discovery:
        service-name: ${spring.application.name}

By the way, I notice that STS4 doesn't have the Quick Fix proposals like Add @Autowired to field variable while STS3 has. Was it possible to integrate this feature into STS4?

Activity

  1. kdvolder commented on Mar 23, 2020

    @kdvolder
    Member

    This is a good idea. Thanks for the suggestion.

    By the way, I notice that STS4 doesn't have the Quick Fix proposals like Add @Autowired to field variable while STS3 has. Was it possible to integrate this feature into STS4?

    I think it is probably possible. But please raise a separate issue to ask for that. (Also when you ask getting some of the quickfixes back, do try to be specific and list the ones that you actually miss. We may not be able to bring all of them back, but if you are specific there's a better chance of bringing some of them back as requested).

  2. spring-projects-issues commented on Apr 6, 2020

    @spring-projects-issues

    (comment in Pivotal Tracker added by Kris De Volder:)

    I'm putting this on hold for a bit to return to it again at a later time.

    I already created a test case but it isn't passing yet (since still trying to figure out a good way to implement this).

    The test case is in branch called GH_427.

  3. added a commit that references this issue on Apr 23, 2020
  4. 8 remaining items

  5. added a commit that references this issue on May 5, 2020
  6. humphreygao commented on May 7, 2020

    @humphreygao
    Author

    I downloaded the Version: 4.6.2.CI-B2249, it works well.
    I think there are some improvements:

    1. mark the occurrence(definition) of the key when the cursor is between the ${}
    2. the existing keys should have higher priority than other suggestions in popup dialog
    3. auto complete while typing
  7. kdvolder commented on May 7, 2020

    @kdvolder
    Member

    I downloaded the Version: 4.6.2.CI-B2249, it works well.

    Thanks!

    I think there are some improvements:

    These are all good ideas for improvement. However, I would prefer if these were considered as separate enhancement requests.

    I'm not sure about number 2. Don't get me wrong, I think it is a good idea from the user perspective, but unfortunately controlling the order of the completions in LSP is somewhat out of our control (the lsp client implementation controls this and it varies a bit between clients, but generally it is based on how well what you typed matches the proposals, rather than any other considerations). For eclipse, we may be able to do something however as I think there's a way to bypass the client logic and force the completions to have a specific ordering.

    That being said, this is not totally trivial to implement. So, I'd like to treat these things as separate tickets that we can schedule to work on individually in the future.

    Number 1... seems doable, using existing lsp protocol, though we'd have to look into it and figure out how exactly to implement it. So... also prefer a separate ticket for this.

    Number 3.... It seems to already to that for me. I.e. if I have this:

    spring:
      application:
        name: ${
    

    And then I start to type some letters, then the completions automatically appear.

    Anyhow, it would be nice if you:

    • clarified what you mean with number 3
    • raised separate tickets for the other 2 requests.

    Or if you prefer, I can also create the extra tickets myself to save you the trouble.

  8. humphreygao commented on May 7, 2020

    @humphreygao
    Author

    For 3, I mean pop up completions(especially the existing keys) without type any letter.
    My English is pretty limited, so it would be better if you raised the tickets.

  9. kdvolder commented on May 7, 2020

    @kdvolder
    Member

    For 3, I mean pop up completions(especially the existing keys) without type any letter.

    Okay so, basically... the completion popup appears just after I typed the '{' ?

    I think we can do this probably, by including '{' as a 'trigger character'. But I would be a little worried about it triggering inadvertently when I just typed a '{' without a '$' in front.

    That said, since its somewhat easy to do / try. I'll make the change. We can always come back and undo it later.

  10. added a commit that references this issue on May 7, 2020
  11. spring-projects-issues commented on May 8, 2020

    @spring-projects-issues

    (comment in Pivotal Tracker added by Martin Lippert:)

    Works nicely, Great work.

  12. added this to the 4.6.2.RELEASE milestone on May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions