Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.0RC1
-
Fix Version/s: 2.0.1Release
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Copied from GRECLIPSE-493:
—
When editing a line to add a string, such as changing
assert exec.input, USAGE
to
assert exec.input, "No input specified" + USAGE
Adding the first quote results in one quote inserted. Typing the close-quote inserts two quotes (leaving the cursor between them). As long is I remember to hit DEL (and not) BS after typing the close, I can almost ignore this behavior.
In case it needs to be mentioned, when I type the first quote after the comma, the statement becomes invalid since there is no '+' operator.
—
Definitely releated to GRECLIPSE-493, but probably a slightly different cause.
Looked into this a little bit. The problem is with the BracketInserter class, which is a private inner class in CompilationUnitEditor. This class does not add a second closing " if the previous token is an identifier (ie- a second quote is only added after a paren, comma, semi-colon, etc). So, the following will work as expected:
assert(<quote_here>)but the following will not:
assert <quote_here>I think the rules for closing quotes in Java and groovy are significantly different that I should copy this code from CompilationUnitEditor and modify it in GroovyEditor. I will look at this post 2.0.