Avoid inserting unnecessary parentheses after functions

This commit is contained in:
Josh Gross
2022-12-15 10:48:28 -05:00
parent b493fa3bdb
commit 9130ef0c65
2 changed files with 34 additions and 7 deletions
@@ -706,4 +706,20 @@ jobs:
expect(github!.kind).toBe(CompletionItemKind.Variable);
expect(github!.insertText).toBeUndefined();
});
it("function parentheses are not inserted when parentheses already exist", async () => {
const input = `
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo \${{ toJS|(github.event) }}
`;
const result = await complete(...getPositionFromCursor(input), undefined, contextProviderConfig);
expect(result.find(x => x.label === "toJson")!.insertText).toBe("toJson");
});
});