-
Notifications
You must be signed in to change notification settings - Fork 206
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
Spring Boot properties files code completions is not working #59
Comments
I have not seen this problem. It looks like an error coming from within vscode's implementation. But its possible this still our (STS language server's) fault somehow. I think the first thing we need to do is get more details about the versions of 'stuff' that you are using. I.e. are you on the latest versions of vscode and our extensions? If not, please try to upgrade. You can check your version of vscode by running
You can check the version of spring-boot and other extensions from within vscode ui in the same view where you installed them. I can give detailed instructions if you can not figure it out. Let me know. |
C:\Users\rush>code -v java version "1.8.0_172" I found this warn always output log file |
The error log has nothing worrysome. We know what those warnings mean and they are harmlessly ignored. Version you have is same as mine. It seems to be working for me. Do you have the redhat Java support installed alongside the vscode-spring-boot extension? We just released an update of the vscode-spring-boot last friday. (Version is 0.3.0). If that is the version you are using, it seems to be working for me. That being said, we are getting the classpath from Java redhat support. And there are some potential hickups around that. If the redhat language support has problems getting classpath our extension will too, and without classpath data, there will be no completions or validations in our editor. This may be what's happening. Another possibility is that the java language server isn't started yet. Try to make sure that it is working properly by opening a .java file and check if Java gives content assist when you type in there (i.e. check if the java support is able find types like for example 'SpringApplication' and others like that. |
I aways keep extensions with the latest version. All functionality is ok except when i opening .properties and .yml, the content assist is not working. I found an error in log file: [STS4 Thread-1] ERROR org.springframework.ide.vscode.commons.util.Log - Error |
@lwl19 two more questions... :-) Are you getting the exception mentioned above ( And can you maybe share an example project that reproduces this behavior and the new exception that you posted a moment ago? That would be awesome. |
See: #59 (comment) Signed-off-by: Kris De Volder <[email protected]>
I pushed a small change that should avoid the NPE. I don't think it will fix the real problem though. We don't really know what it is yet. I'm still thinking it's something about the project somehow interfering with obtain properties metadata. @lwl19 Does the project build fine when you run a maven build from the commandline? I.e. something like 'mvn clean package'. Secondly, do you see activity in the log like this:
I'm trying determine if spring-boot extension is obtaining proper classpath data from the java language server. |
@martinlippert My project based on Spring Initializr to generate a simple quickstart. |
This is harmless. Vscode is sending redundant change events sometimes (e.g. when a file is saved for example). Our language server ignores the events and logs a warning, but it shouldn't cause any problems.
It could be, but since the metadata is embedded inside of the project dependencies (in the jar files) there would be other signs of trouble. (E.g. I'd expect you have problems with the general Java file editing completions etc. if the java tooling cannot download the jar dependencies from maven). |
stsjdt.log I found "/redhat.java/jdt_ws/jdt.ls-java-project/src" and "/redhat.java/jdt_ws/jdt.ls-java-project/bin" is empty folder,that would be signs of trouble. |
The logs don't show anything unexpected. So still a mystery what might be the problem. From the file paths I see in the logs, I gather you are on Windows. In theory it shouldn't matter, but we are all on Mac / Linux ourselves so we don't test as much on Windows. It is possible that we have a bug of some kind that makes things not work on Windows. I'm putting a ticket in our internal tracker to remind us to do some windows testing soon. |
Hi, vscode-spring-boot.log: |
This is indeed strange. Can you attach the sample project? Just curious to double check the exact same project here to see if this is related to the environment or to something else. |
It's just a default generated project from https://start.spring.io/, didn't change a bit. |
I think both @Unichron and @lwl19 are on Windows. So I will do some Window's testing today. I'll have to set things up on a VM. It seems the most likely explanation is some type of bug that breaks things on Windows. |
I'm trying it right now on Windows 10 VM and I can confirm that it is also not working for me. Steps I did to reproduce this:
At first glance, from the output in server log it seems like the language server is receiving classpath data. I will have to setup a debug environment to see what it actually does with the data and try to determine where/if/why it might be going wrong reading metadata from the classpath jars. |
Problem appears to be caused by a discrepeancy between the case (upper vs lower) of the drive-letter for uris of projects and documents. These uris come to us from different sources (one from vscode client and the other from jdt language server). It seems that the uris end up being different. One ends up being like this: This makes it so that when a completion request comes in for a given document uri, when we go looking for the corresponding project, we don't find it (because of the mismatched drive-letters). |
Tested with latest snapshot build. Is working now for me. There will be new release on vscode marketplace in a couple of days (tomorrow, if all goes according to plan :-). If you want to test it now rather than wait, you can install the snapshot which you can download here: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html Instructions on installing a .vsix file here (near bottom of the page): https://github.com/spring-projects/sts4/blob/master/vscode-extensions/vscode-spring-boot/README.md |
Yes it's also working for me with the latest nightly build. Thanks! |
[2018-06-08 12:31:12.451] [renderer3] [error] Cannot read property 'selection' of undefined: TypeError: Cannot read property 'selection' of undefined
at CursorExploder.explode (C:\Users\wenlong.vscode\extensions\hoovercj.vscode-power-mode-2.2.0\out\src\cursor-exploder\cursor-exploder.js:145:66)
at CursorExploder.onDidChangeTextDocument (C:\Users\wenlong.vscode\extensions\hoovercj.vscode-power-mode-2.2.0\out\src\cursor-exploder\cursor-exploder.js:41:18)
at plugins.forEach.plugin (C:\Users\wenlong.vscode\extensions\hoovercj.vscode-power-mode-2.2.0\out\src\extension.js:119:38)
at Array.forEach (native)
at onDidChangeTextDocument (C:\Users\wenlong.vscode\extensions\hoovercj.vscode-power-mode-2.2.0\out\src\extension.js:119:13)
at e.fire (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:764)
at e.$acceptModelChanged (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:686:189)
at e._doInvokeHandler (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:636:832)
at e._invokeHandler (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:636:550)
at e._receiveRequest (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:631)
at e._receiveOneMessage (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:400)
at e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:634:315
at e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:637:395
at e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:95:432
at e.fire (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:764)
at Socket. (e:\ide\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:338)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20)
The text was updated successfully, but these errors were encountered: