Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ydaveluy authored and msujew committed Dec 4, 2024
1 parent 3170af9 commit 2fb30c2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/langium/test/lsp/completion-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,35 @@ describe('Completion within alternatives', () => {
expectedItems: ['c', 'd']
});
});
test('Should show correct keywords in completion of group', async () => {

const grammar = `
grammar g
entry Main: ('a' a+=ID | 'b' b+=ID | 'c' c+=ID)*;
hidden terminal WS: /\\s+/;
terminal ID: /\\w+/;
`;

const services = await createServicesForGrammar({ grammar });
const completion = expectCompletion(services);
const text = '<|>a id1 <|>b id2 <|>c id3';

await completion({
text,
index: 0,
expectedItems: ['a', 'b', 'c']
});
await completion({
text,
index: 1,
expectedItems: ['a', 'b', 'c']
});
await completion({
text,
index: 2,
expectedItems: ['a', 'b', 'c']
});
});
test('Should show correct cross reference and keyword in completion', async () => {

const grammar = `
Expand Down

0 comments on commit 2fb30c2

Please sign in to comment.