-
Notifications
You must be signed in to change notification settings - Fork 210
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 XML config content assist not working #542
Comments
Here is the Spring Boot Language Server log from Eclipse start up to when I invoke code assist. Here is the Eclipse log in the same fragment: Please note there's 2 hours offset between these logs because of a timezone problem with the version of Eclipse I'm using (Flatpak - flathub/org.eclipse.Java#17). |
What is the layout of your projects? As far as i can see you have 3 projects:
Where are the XML files? Are they all in post-commons? It is odd indeed that CA invocation is not recorded in the server log... It would usually be logged like this: Also it is odd that non of the XML files were scanned for spring symbols... which makes me wonder where they are in your projects... Usually java files are indexed for symbols and XML files as well since you've enabled XML support... Thus you should be having something like this in the log:
I see you have java files indexed but no XML files indexed it seems... Therefore, I'm curious about your projects layout |
Also what is the header for your Spring XML files? I have:
What is yours? |
Hi Alex, sorry for the delay.
XML files are in post-core, under The header for one of those XML files is: <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-jpa="http://www.springframework.org/schema/integration/jpa"
xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jpa https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd
http://www.springframework.org/schema/integration/sftp https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"> |
It just looks like Spring XML support is completely off. At the same time your Boot LS log states that indexer configuration has been updated a few times since I'm seeing lines (in other words I'd expect the log to have something about scanning XML files):
Try perhaps changing the Scan XML in Folders for Symbols - it should be an editable text field... change it to Also, it'd be interesting if you could simplify one of the XML (or create a new XML file) files to one bean only only... Perhaps there is something in the XML file Boot LS silently didn't like. There is a sample test project we have in STS4 repo: I've tried your XML header and moved my XML file to match the location of your XML files but it didn't trigger any issues... |
Hi Alex, really, the whole page Language Server | Spring Language Servers | Spring Boot Language Server | Spring XML Config is read-only: I can neither change the "Scan XML in Folders for Symbols" text field, nor clear the two other flags. Probably here lies the common source of my problems. Do you have any clue on why I see this? |
Those settings are editable only after enabling the overall "Enable Spring XML config files support", which should appear above the other checkboxes that you mentioned on the same preference page. |
Oh, well, I really feel ashamed... for some unknown reason my brain was not seeing the first row of that page "Enable Spring XML Config File Support".... Aided by the fact that I'm using a dark theme and a non-excellent monitor, I didn't see that was an unchecked checkbox rather than a configuration page title, so I now checked that option and some XML-related log entries started to appear in the log. I realised this as soon as I opened Eclipse on another workspace where code assist in XML files works. I'm really sorry for your time wasting... On the interesting note, I had to restart Eclipse, even after enabling that option, to make code assist work, otherwise I was just having some "UI freeze" errors in the Eclipse log and "No Spring XML Content Assist", but I can't reproduce again this behaviour right now. Thanks for your help, as always, and sorry again. |
@mauromol No worries, glad to hear that it is working now... :-) |
I am using Spring Mvc 6.1.2 .. I am using xml Configuration in this project but it is not working.. import org.springframework.stereotype.Controller; @controller
|
If your app isn't working, i.e. not picking up your xml config (is this correct?) then you'd better of raising this as a question on SO: https://stackoverflow.com/questions/tagged/spring. |
And if some specific content-assist is not working (you mentioned this in the title of the issue), it would be good if you could share a sample project and describe on more detail where exactly the content-assist is not working and what you would expect from it. Also, keep in mind that the support for Spring XML config files in Spring Tools 4 is not enabled by default. You have to enable the overall support as well as the content-assist in the preferences. But that preference refers to the tooling features (like content-assist) only, it is completely unrelated to running the Spring application and what happens at runtime. |
I'm here to struggle again to make XML support in STS4 working...
Now I'm working on another project and I can't get XML support to work.
I'm using Eclipse 2020-09 (4.17.0) with STS 4.8.0 (Spring XML Namespace Support 3.9.14.202009150957-RELEASE).
Under Window | Preferences | Language Servers I disabled WWD XML Language Server (due to #415), while Spring XML Config File language server is enabled.
Under Window | Preferences | Language Servers | Spring Language Servers, Spring Boot option is checked.
Under Window | Preferences | Language Servers | Spring Language Servers | Spring XML Config, Content Assist in editor is checked.
Yet, when I try to invoke content assist like in
<bean class="Str|">
, I don't get any suggestion at all.When I invoke content assist there, no output is produced at all either in the Spring Boot Language Server Console or in the Eclipse log.
If I look at the contents of the Spring Boot Language Server log from the beginning, no mention to my XML files is present, suggesting they weren't detected at all. However, the cool thing is that if I uncheck the Spring XML Config File language server in Window | Preferences | Language Servers, this gets printed in the Spring Boot Language Server log:
So, they were detected in some way instead.
Now, if I enable again Spring XML Config File language server in Window | Preferences | Language Servers, no new output is produced and content assist doesn't work yet.
Please tell me what I can do to help you diagnose what is going on.
The text was updated successfully, but these errors were encountered: