Bug 569016 - [content assist] should be able to correct spelling mistakes
Summary: [content assist] should be able to correct spelling mistakes
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.18   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2020-11-21 06:30 EST by Wim Jongman CLA
Modified: 2021-01-11 15:28 EST (History)
2 users (show)

See Also:


Attachments
Example (198.30 KB, video/mp4)
2020-11-21 06:30 EST, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2020-11-21 06:30:26 EST
Created attachment 284833 [details]
Example

A misspelled parameter cannot be fixed with content assist.
Comment 1 Roland Grunberg CLA 2020-12-09 14:14:42 EST
Version: 2020-12 (4.18)
Build id: I20201130-1800

I'm actually not able to reproduce this. In my case, JDT proposes quick fixes like 'Change to Object' or 'Change to object', depennding on whether I have misspelled a Type or identifier.

I've even tried misspelling parameter names but the suggestions come up as expected.

Relevant code would appear to be in UnresolvedElementsSubProcessor#addSimilar{Type,Variable}Proposals(..) . For variables, it gets all within scope and compares similarity to the unresolved variable.

Are you able to reproduce in a fresh workspace with a recent Eclipse ?
Comment 2 Mickael Istria CLA 2021-01-11 15:28:56 EST
(In reply to Wim Jongman from comment #0)
> A misspelled parameter cannot be fixed with content assist.

This specific case might be doable by hacking the existing Java content assist processor so it can provide good proposals in case none properly match prefix but some "main" proposals are not too far in distance to the prefix.

I like the idea of trying to generally hook quick-fixes into content-assist (basically merging Ctrl+1 into Ctrl+Space). That could basically apply to all editors. However the tricky part is about what to give priority and show first? I guess while user is actively typing, content-assist proposals are to be preferred over quickfixes, and when "pausing" quick-fixes may be more interesting. But how can we really know the difference between both case reliably?
In any case, if this is what you have in mind, please open a separate ticket as this one is a specific instance; which can have alternative solutions.