redhat-developer / redhat-developer/lsp4ij

Completions that are effectively code-generated overrides aren't inserted properly

Open
#685 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug completion
Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

Some LSP-provided completions are intended to behave as code generation, e.g., implementing/overriding a method from an interface/base class. When I accepted such a completion, it resulted in invalid code, e.g., HTMLElement.click() in JavaScript/TypeScript which results in:

click(): void {
    $0
\}()

Here's a demonstration of the issue:

Image

It looks like it's just a current limited handling of templatized completion results.

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

Start by reproducing the JavaScript/TypeScript completion example and trace how LSP templatized completion results are inserted. Done means accepting code-generated override or implementation completions produces valid code rather than leaving an invalid trailing call syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.