eclipse-xtext / eclipse-xtext/xtext

[Content Assist] does not work properly without org.eclipse.xtext.common.Terminals

Open
#2,587 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Given is the following xtext grammar:

grammar org.xtext.example.mydsl.MyDsl

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

PolygonBasedShape:
    shape = PolygonBasedNodeShape;

enum PolygonBasedNodeShape:
    octagon | oval |
    parallelogram | pentagon | plain | plaintext | point | polygon | primersite | promoter | proteasesite | proteinstab |
    rarrow | record | rect | rectangle | restrictionsite | ribosite | rnastab | rpromoter;

Use Case1 (Content Assistant works properly):

  1. Create an empty test.mydsl file based on the grammar above and open it with the generated editor.
  2. Press Ctrl+Space to invoke the Content Assistant.
  3. Type the letter 'p' and 'r'.
    The Content Assistant suggests correct proposals beginning with the prefix 'pr'.
    content_assistant_ok

Use Case2 (Content Assistant does not work properly):

  1. Create an empty test.mydsl file based on the grammar above and open it with the generated editor.
  2. Type the letter 'p' and 'r'.
  3. Press Ctrl+Space to invoke the Content Assistant.
    The Content Assistant suggests incorrect proposals beginning with the prefix 'r'.
    content_assistant_not_ok

HINT: When modifying the grammar to use the "org.eclipse.xtext.common.Terminals", the content assistant works for both of the use cases properly.

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.

Research direction

Reproduce the two content-assistant use cases with the MyDsl grammar shown, first without and then with org.eclipse.xtext.common.Terminals. Compare the proposals after typing “pr” before invoking Ctrl+Space versus invoking it afterward; done means both flows suggest entries matching the full prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.