"Code Completion" works fine in `application.properties` file, but does not work for `application.yml` file.
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):
When i type in application.yml file, spring-boot.ls.logfile is displayed as shown in the below image:
and the vscode-sping-boot-debug-log shows an below:
However, the Information Hovers feature is working fine.
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.
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
Still cannot reproduce... as you can see below completion proposals are showing up for the project in the yaml file:
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:
Spring Boot LS Java Home:
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?
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.
Okay is the issue that once you type in the
application.propertiesfile that completion proposals just show up as you type the wordport? Looks like you expect the same in theapplication.ymlfile... In other words you do not invoke completion proposals withCtrl-Space(Cmd-Spaceon 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. OtherwiseCtrl-SpaceorCmd-Spaceis 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?
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.
I'm having the same problem, yaml and yml suffix endings won't prompt, system is windows 10, vscode version is 1.92.0
I also have the same problem. It worked fine the first time, but when I input other attributes with the same prefix the second time, it doesn't prompt
@661913 and @wangqing1001 Can you provide more details here, maybe sample snippets of your application.yml files and steps how to reproduce the issue? That would be awesome.
@661913 , @wangqing1001 Any news on this? Any snippets or samples you can share?
No additional feedback so far, so closing this one for now. If you have additional details, feel free to add them and we can re-open anytime.