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

Add file completion from classpath for @ContextConfiguration #1318

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

ksankaranara-vmw
Copy link
Collaborator

Added content-assist feature to auto complete xml files from the classpath for @ContextConfiguration annotations
Issue: #650

@martinlippert
Copy link
Member

Tried this out in more detail, looks great in general. Great work.

What I noticed (assuming that there is a file root-config.xml):

@ContextConfiguration(locations ="root<*>")

produces the correct proposals, whereas:

@ContextConfiguration(locations ="/root<*>")

does not produce any proposals. Same happens if there is a longer patch to the resource. It seems like the / at the beginning is breaking the logic.

In addition to that I also noticed that the short summary of the proposal doesn't really work well if there is a longer patch for the proposals. In those cases, most of the stuff that the proposal shows in the popup is a long patch, but the real name of the file is hidden (because the proposal label is too long for the popup). And the short version that shows up at the end of the selected proposal inside of the popup seems to repeat the label, so doesn't help either.

But this seems to be a general problem with path-based proposals, the classpath: proposals for @Value annotations have the same problem. There is probably some fine tuning necessary, but we should address that in a separate issue once this PR is merged.

But would be great to get the first part here (missing proposals if the prefix starts wit /) addressed before we merge.

@ksankaranara-vmw
Copy link
Collaborator Author

@martinlippert thanks for the review! I'll work on the changes.

@BoykoAlex BoykoAlex merged commit 992a7c7 into spring-projects:main Aug 15, 2024
1 check passed
@martinlippert
Copy link
Member

@ksankaranara-vmw Looks like @BoykoAlex did already merge this PR, so would be great if you could submit an additional PR for the issue around missing proposals if the prefix starts with /... :-)

@martinlippert martinlippert added this to the 4.25.0.RELEASE milestone Aug 15, 2024
@ksankaranara-vmw
Copy link
Collaborator Author

@martinlippert sure :-)

@martinlippert martinlippert added for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: xml-support labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: xml-support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants