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

Order precise matches over fuzzy ones in application property suggestions #1342

Closed
odrotbohm opened this issue Sep 3, 2024 · 8 comments
Closed
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: property-editing-support type: enhancement

Comments

@odrotbohm
Copy link
Member

When I type spring.task. in an application properties file, I would like to see the properties starting with the full match first. Currently, fuzzy matches are presented first if they sort higher than the full match.

These are the first results I get suggested:
Screenshot 2024-09-03 at 10 17 09

Here are the precise matches further down:
Screenshot 2024-09-03 at 10 17 21

@martinlippert
Copy link
Member

Definitely something we need to improve, totally agree. Aiming at working on this for the 4.26.0 release, which is scheduled for late October or early November.

@martinlippert
Copy link
Member

Looked into this quite a bit, somewhat related to eclipse/lsp4e#842. I added a workaround for this my marking the completion result list as incomplete, which then triggers a new computation of completions - and as a side effect, a new sorting of the results.

Would be interesting to see what you think of this @odrotbohm, once we have a CI build ready for testing.

I am especially interested in your opinion about a "feature" that is implemented here, which removes the spring prefix from the completions as soon as the completion list exclusively contains proposals that start with that prefix. The idea was - back then - to not waste real estate by repeating the prefix in every proposal and therefore also make the proposals slightly shorter when showing up in the completion popup. But it feels questionable to me, I personally would prefer to have the spring prefix being included in the proposals. But take a look (once the new CI build is out) and let us know what you think @odrotbohm.

Will update the issue here once the CI build is around that includes this and testing can start.

@martinlippert
Copy link
Member

@odrotbohm CI builds including this update are now available at https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html

@odrotbohm
Copy link
Member Author

I've added the update site, get updates presented but the install fails with a few of these:

java.lang.NoSuchMethodError: 'java.lang.String org.bouncycastle.util.encoders.Hex.toHexString(byte[])'
	at org.eclipse.equinox.p2.repository.spi.PGPPublicKeyService.toHexFingerprint(PGPPublicKeyService.java:173)
	at org.eclipse.equinox.internal.p2.artifact.processors.pgp.PGPPublicKeyStore.addKey(PGPPublicKeyStore.java:34)
	at org.eclipse.equinox.internal.p2.artifact.processors.pgp.PGPSignatureVerifier.close(PGPSignatureVerifier.java:240)
	at org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep.close(ProcessingStep.java:97)
	at org.eclipse.equinox.internal.p2.artifact.repository.SignatureVerifier.close(SignatureVerifier.java:116)
	at org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep.close(ProcessingStep.java:97)
	at org.eclipse.equinox.internal.p2.artifact.processors.checksum.MessageDigestProcessingStep.close(MessageDigestProcessingStep.java:58)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.reportStatus(SimpleArtifactRepository.java:1317)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:647)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:846)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.getArtifact(MirrorRequest.java:357)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transferSingle(MirrorRequest.java:327)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transfer(MirrorRequest.java:248)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:164)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:828)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.DownloadJob.run(DownloadJob.java:62)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

and a few follow up errors complaining about downloads having failed.

@martinlippert
Copy link
Member

@odrotbohm Can you try again? Probably a network glitch or a problem of updating the repository while downloading from it...

martinlippert added a commit that referenced this issue Oct 14, 2024
…ture, will bring that back behind a preference
@martinlippert
Copy link
Member

Two things are done here now:

  • proposals are re-computed on every keystroke to get improved sorting of proposals
  • disabled the auto-removal of common prefixes in proposals and added a preference to enable this again (if someone prefers that behavior)

With that, I think we can close this item. Changes will ship as part of the upcoming release.

@odrotbohm
Copy link
Member Author

This looks much better now, thanks! 🙇

@martinlippert
Copy link
Member

This looks much better now, thanks! 🙇

Great to hear and thanks a lot for giving it a try.

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: property-editing-support type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants