IdeContentProposalAcceptor class does not calculate priorities the same as the ConfigurableCompletionProposal class

Open Beginner friendly
#3,727 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java

Research direction

Start in org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalAcceptor.java at the priority comparison near line 70, then compare it with ConfigurableCompletionProposal. Verify how lower priority values are ordered in Eclipse and IDE/LSP proposals, and check whether existing content-assist tests cover this difference. Done means the ordering is consistent or the intended distinction is explicitly preserved with regression coverage.

Written by the indexing model from the issue text.

Description

I am currently building a language server for my DSLs and while working on content assist, I noticed that my LSP proposals are sorted the other way around then my Eclipse proposals.

It seems that in Eclipse lower priority means further up in the list, while in IDE/LSP lower priority means further down in the list.

I subclassed IdeContentProposalAcceptor and switched the following statement around:

https://github.com/eclipse-xtext/xtext/blob/fe3f5f7f60719e041d371dc1b3ab1271ef039d46/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalAcceptor.java#L70

I changed int prioResult = p2.getKey().compareTo(p1.getKey()); to int prioResult = p1.getKey().compareTo(p2.getKey());.

Is this difference in behaviour intended or can that be changed?

Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-xtext/xtext

All issues in eclipse-xtext/xtext

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.