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

"Code Completion" works fine in application.properties file, but does not work for application.yml file. #1242

Open
qinlinwang opened this issue Apr 27, 2024 · 7 comments
Assignees
Labels

Comments

@qinlinwang
Copy link

qinlinwang commented Apr 27, 2024

Describe the bug
my environment:
os: macos 12.4
vscode: 1.88.0 (Universal)
jdk:jdk-11.0.16.1.jdk
vscode extensions:
Language Support for Java(TM) by Red Hat: v1.30.0
Spring Boot Tools: v1.53.0

"Code Completion" works fine in application.properties file, but does not work for application.yml file.
When i type in application.properties file, spring-boot.ls.logfile is displayed as shown in the below image(in the vscode terminal window):
image

When i type in application.yml file, spring-boot.ls.logfile is displayed as shown in the below image:
image

and the vscode-sping-boot-debug-log shows an below:
image

However, the Information Hovers feature is working fine.
image

@BoykoAlex
Copy link
Contributor

Hmm... I cannot reproduce this unfortunately...
When you have properties in yaml and see hovers showing up does the content assist work then?

I've tried petclinic and consume rest guide project - yaml completions show up fine.

Not really sure what to suggest... Could you attach your project with both properties and yaml file for us to try. Also the spring boot ls log file might be useful.

@qinlinwang
Copy link
Author

Hmm... I cannot reproduce this unfortunately... When you have properties in yaml and see hovers showing up does the content assist work then?

I've tried petclinic and consume rest guide project - yaml completions show up fine.

Not really sure what to suggest... Could you attach your project with both properties and yaml file for us to try. Also the spring boot ls log file might be useful.

On my machine, none of the projects are good. For example, the simplest Spring Boot project I newly created below.
spring-boot-demo.zip

@BoykoAlex
Copy link
Contributor

Still cannot reproduce... as you can see below completion proposals are showing up for the project in the yaml file:
Screenshot 2024-04-30 at 16 21 02

I'll give this a try on an older mac maybe it has something to do with the OS. One thing to try would be JDK 17 for the Java LS and Spring Boot LS. I see you have JDK 11 listed. I thought both of these extensions require JDK 17 (although if that was off i think boot ls log would have been full of various errors)

Java LS Java Home:

Screenshot 2024-04-30 at 16 25 59

Spring Boot LS Java Home:

Screenshot 2024-04-30 at 16 26 08

@qinlinwang
Copy link
Author

qinlinwang commented May 1, 2024

I specify the path for the jdk17 in the settings.json, but it still does't work.

    "java.jdt.ls.java.home": "/Library/Java/JavaVirtualMachines/jdk-17.0.11.jdk/Contents/Home",
    "spring-boot.ls.java.home": "/Library/Java/JavaVirtualMachines/jdk-17.0.11.jdk/Contents/Home"

If it's because of the JDK, then the properties file should have the same issue, right? Is there anything else I can provide?

@BoykoAlex
Copy link
Contributor

BoykoAlex commented May 1, 2024

Okay is the issue that once you type in the application.properties file that completion proposals just show up as you type the word port? Looks like you expect the same in the application.yml file... In other words you do not invoke completion proposals with Ctrl-Space (Cmd-Space on mac) but expect completion proposals to show up as you type? Is this the issue?

. is the trigger character in yaml... if you type . then completion proposals would show up. Otherwise Ctrl-Space or Cmd-Space is the universal way to invoke completion proposals in any IDE everything else is just tiny perks here and there.

@qinlinwang
Copy link
Author

Okay is the issue that once you type in the application.properties file that completion proposals just show up as you type the word port? Looks like you expect the same in the application.yml file... In other words you do not invoke completion proposals with Ctrl-Space (Cmd-Space on mac) but expect completion proposals to show up as you type? Is this the issue?

. is the trigger character in yaml... if you type . then completion proposals would show up. Otherwise Ctrl-Space or Cmd-Space is the universal way to invoke completion proposals in any IDE everything else is just tiny perks here and there.

Thanks a lot, . did work in yaml。 Why isn't the behavior designed to be the same in both file types?

@BoykoAlex
Copy link
Contributor

It is designed to be roughly the same however for some reason only a few trigger chars are working in VSCode for YAML. Something must be consuming the rest of the trigger chars... It is a rather low priority issue but requires quite a bit of preparation work to demonstrate the problem to vscode team.

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

No branches or pull requests

3 participants