Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Consideration for quick fixes with multiple parameters to ensure they fully resolve errors #516

Open
anusreelakshmi934 opened this issue Feb 9, 2024 · 0 comments
Labels

Comments

@anusreelakshmi934
Copy link

anusreelakshmi934 commented Feb 9, 2024

Currently, there's an issue in our codebase regarding the handling of quick fixes, particularly when a method contains multiple parameters. The existing quick fix functionality does not adequately resolve the diagnostic in such cases. Unlike many other quick fixes which fully address a diagnostic, this inconsistency needs attention.

This ticket is to Determine the anticipated outcome of quick fixes when there are multiple issues detected by diagnostics, such that one quick fix may not resolve all of them or could potentially introduce new ones.

Providing an example. Attaching some screenshots below (in lsp4ij component for intellij) for reference:
image
In the above file eventhough the quickfix - Remove the '@Disposes' modifier from parameter 'name1' is applied still the diagnostic present in not resolved.
image

Similarly, In Managed Bean class when applying the below quick fix - Replace current scope with @Dependent, it replaces the @RequestScoped annotation. But the error in line 7 still persists with diagnostic - The @Dependent annotation must be the only scope defined by a managed bean with a non-static public field
image
image

In PostConstructAnnotation class in jakartasample/src/main/java/io/openliberty/sample/jakarta/annotations/PostConstructAnnotation.java, when applying the quickfix - A method with the @PostConstruct annotation must be void., a new diagnostic is created.
After changing the return type to void a diagnostic emerges stating, "Cannot return a value from a method with a void result type."
image

Similarly in PreDestroyAnnotation class, applying the quickfix A method with the @PreDestroy annotation must not have any parameters. results in a new diagnostic - Cannot resolve symbol 'type'
image

@anusreelakshmi934 anusreelakshmi934 changed the title Design Consideration for Quick Fixes Handling Methods with Multiple Parameters Design Consideration for quick fixes with multiple parameters to ensure they fully resolve errors Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants