redhat-developer / redhat-developer/vscode-java

Add support for @CheckReturnValue

Open
#2,238 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code analysis diagnostics enhancement
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

IntelliJ has a "clever" way to inform the users that the result of a method must be used.
It detects that the method is annotated with a @CheckReturnValue annotation regardless of its package. So, frameworks can provide their own (like SmallRye Commons Annotations).

Basically, if you have an API with:

@CheckReturnValue
public Uni<String> doSomethingCool();

a user using that method like in the following snippet would get a warning:

doSomethingCool();

The warning indicates that the return value must be used, like in:

doSomethingCool().subscribe().with(r -> ...);

This is particularly interesting for reactive APIs, stream APIs, and builders APIs.

It would be great if VS Code Java could provide the same kind of feature.

CC @maxandersen

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

No source files or tests are named. Start by locating the VS Code Java diagnostic or analysis entry point and review how method annotations are handled; the work is done when package-independent @CheckReturnValue annotations produce a warning for ignored results, with coverage for reactive, stream, or builder-style calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.