| Summary: | quickfix marker appears when there are no fixes available | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Henrik Lindberg <henrik.lindberg> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | carl.wannheden, moritz.eysholdt, sebastian.zarnekow |
| Version: | 1.0.1 | Flags: | moritz.eysholdt:
kepler+
|
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Henrik Lindberg
The JavaDoc of IQuickAssistProcessor.canFix(Annotation) says the answer should be fast and optimistic: "It is ok return true even if there are no quickfixes available". That's what we do in DefaultQuickfixProvider.hasResolutionFor(String). I doubt that we can come up with a solution that is bulletproof and fast. Thus I'd like to close this one as won't fix. Do you have any concrete suggestions that would improve the situation? Please note that clients are always free to customize #hasResolutionFor. Please consider the following Java example.
import java.util.Arrays;
public class A {
public static void foo() {
<lightbulb here> new Arrays.ArrayList<String>();
}
}
If you click the lightbulb in the gutter, you'll get a message "No suggestions available". Is this what you had in mind for Xtext based languages?
(In reply to comment #2) > Please consider the following Java example. > > import java.util.Arrays; > > public class A { > > public static void foo() { > <lightbulb here> new Arrays.ArrayList<String>(); > } > > } > > If you click the lightbulb in the gutter, you'll get a message "No suggestions > available". Is this what you had in mind for Xtext based languages? That is much better than nothing at all happening when there is a "quick fix marker". That nothing happens if there is no quick fix marker and user presses CTRL+1 for quick fix is also ok. In my case, what was confusing was that there was both an error marker AND a quick fix marker at the same time - the error marker almost completely covered the quick fix marker. The behavior is a bit odd - in a b3 editor if one types: unit foo is Integer; There is an error because a unit foo can not be an Integer. Change Integer to Integers, and there are now two errors, then backspace the extra "s", then type "s" again. As this goes back and forth, the error and quick fix markers trade z position. (Have not checked what the JDT does in the same situation). When seeing the quick fix (for what appeared to be the same "error state"), and then nothing happening made me wonder - why did it tell me there was a quick fix all of a sudden when there were none... A "No suggestions available" is a good enough solution. has been fixed in the meantime. Requested via bug 522520. -M. Requested via bug 522520. -M. |