jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • GRECLIPSE
  • GRECLIPSE-631

[formatting] Quirk with quotes in editor

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.0Release
  • Fix Version/s: 2.0.2Release
  • Component/s: Editor
  • Labels:
    None
  • Environment:
    Groovy-Eclipse: 2.0.1.20100126-0800-e35
    Java 1.6, Eclipse Galileo SR1, Groovy 1.7, Windows XP
  • Patch Submitted:
    Yes

Description

When I press enter after a string, Groovy-Eclipse inserts an indention in the new line.

def foo = 1[ENTER]
def bar = "baz"[ENTER]
<TAB><CURSOR>

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Java Source File
    FindIndentsTests.java
    25/May/10 2:18 PM
    3 kB
    Kris De Volder
  2. Java Source File
    FormatterPreferencesOnStore.java
    25/May/10 2:06 PM
    5 kB
    Kris De Volder
  3. Text File
    GRE_631_749_seminal_groovy_autoindent_strategy.patch
    25/May/10 1:59 PM
    85 kB
    Kris De Volder

Issue Links

is depended upon by

Bug - A problem which impairs or prevents the functions of the product. GRECLIPSE-746 Autoindentation after hitting return is flaky

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.
is related to

Sub-task - The sub-task of the issue GRECLIPSE-203 [formatting] Editor adds spaces instead of tabs for indenting when hitting enter to get to a new line while defining a List

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Sub-task - The sub-task of the issue GRECLIPSE-744 Indentation after typing return is incorrect

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Benjamin Gudehus added a comment - 27/Jan/10 3:35 AM - edited

Another quirk.

def foo = [""][ENTER]
...........

. = space character

Show
Benjamin Gudehus added a comment - 27/Jan/10 3:35 AM - edited Another quirk.
def foo = [""][ENTER]
...........
. = space character
Hide
Permalink
Benjamin Gudehus added a comment - 27/Jan/10 3:56 AM
return []
........
Show
Benjamin Gudehus added a comment - 27/Jan/10 3:56 AM
return []
........
Hide
Permalink
Kris De Volder added a comment - 19/May/10 5:08 PM

Thanks for the examples Benjamin. I can reproduce these quirks easily on my local copy of GREclipse, so I'll look into fixing these.

Show
Kris De Volder added a comment - 19/May/10 5:08 PM Thanks for the examples Benjamin. I can reproduce these quirks easily on my local copy of GREclipse, so I'll look into fixing these.
Hide
Permalink
Kris De Volder added a comment - 22/May/10 2:59 PM

Linking related issues: all these issues are related to the auto indent strategy that gets invoked after hitting enter.

Show
Kris De Volder added a comment - 22/May/10 2:59 PM Linking related issues: all these issues are related to the auto indent strategy that gets invoked after hitting enter.
Hide
Permalink
Kris De Volder added a comment - 22/May/10 6:50 PM

This patch provides an initial implementation for a Groovy AutoEdit strategy that gets invoked
when user presses newline in the editor.

It's present implementation is very naive and only looks to the line immediate before the newline to decide how to indent the next line. Though it won't handle many things one might expect it will
handle many common "one line cases" ok, including the ones reported in this issue.

When there is more time to work on "autoindentation after newline" and more Jira issues raised with specific problems, we can work on a more intelligent strategy.

This patch also contains some fixes related to GRE-740 and GRE-720:
a correct(er) implementation of FormatterPreferences that takes both project specific
and java core preferences into account to decide on tabs/spaces.

Show
Kris De Volder added a comment - 22/May/10 6:50 PM This patch provides an initial implementation for a Groovy AutoEdit strategy that gets invoked when user presses newline in the editor. It's present implementation is very naive and only looks to the line immediate before the newline to decide how to indent the next line. Though it won't handle many things one might expect it will handle many common "one line cases" ok, including the ones reported in this issue. When there is more time to work on "autoindentation after newline" and more Jira issues raised with specific problems, we can work on a more intelligent strategy. This patch also contains some fixes related to GRE-740 and GRE-720: a correct(er) implementation of FormatterPreferences that takes both project specific and java core preferences into account to decide on tabs/spaces.
Hide
Permalink
Kris De Volder added a comment - 22/May/10 7:11 PM

Deleted and replaced the previous patch file. A few cleanups (duplicated code hoisted to superclass).

Show
Kris De Volder added a comment - 22/May/10 7:11 PM Deleted and replaced the previous patch file. A few cleanups (duplicated code hoisted to superclass).
Hide
Permalink
Kris De Volder added a comment - 22/May/10 7:24 PM

Hold of on applying this patch for a little longer.

Something strange happens:

  • when I run all my new tests separately they all pass
  • when I add them to the test suite, my tests that opne and test the groovy editor
    fail to run with an exception "No active workbench page"

I've moved the editor related tests elsewhere now (with UI tests) hoping that this will fix that issue.
Running all tests now. When the test run is clean I'll replace the patch again.

Show
Kris De Volder added a comment - 22/May/10 7:24 PM Hold of on applying this patch for a little longer. Something strange happens:
  • when I run all my new tests separately they all pass
  • when I add them to the test suite, my tests that opne and test the groovy editor fail to run with an exception "No active workbench page"
I've moved the editor related tests elsewhere now (with UI tests) hoping that this will fix that issue. Running all tests now. When the test run is clean I'll replace the patch again.
Hide
Permalink
Kris De Volder added a comment - 22/May/10 7:56 PM

OK, test run is clean now. At least on my machine.

However, I have not fixed the tab/space preferences issue mentioned in
GRECLIPSE-670

I only replaced the "incorrect" instantiation of FormatterPreferences with an equivalent instantiation. This doesn't break the refactoring tests, but is essentially incorrect.

Show
Kris De Volder added a comment - 22/May/10 7:56 PM OK, test run is clean now. At least on my machine. However, I have not fixed the tab/space preferences issue mentioned in GRECLIPSE-670 I only replaced the "incorrect" instantiation of FormatterPreferences with an equivalent instantiation. This doesn't break the refactoring tests, but is essentially incorrect.
Hide
Permalink
Kris De Volder added a comment - 24/May/10 5:16 PM

This combines changes for patch 631 from before and the fix for GRE 749.

Show
Kris De Volder added a comment - 24/May/10 5:16 PM This combines changes for patch 631 from before and the fix for GRE 749.
Hide
Permalink
Kris De Volder added a comment - 25/May/10 1:59 PM

Reattaching a freshly created patch for these changes. Hope this one works.

Show
Kris De Volder added a comment - 25/May/10 1:59 PM Reattaching a freshly created patch for these changes. Hope this one works.
Hide
Permalink
Kris De Volder added a comment - 25/May/10 2:06 PM

Attaching this file separately. SVN patch creation confused?

Show
Kris De Volder added a comment - 25/May/10 2:06 PM Attaching this file separately. SVN patch creation confused?
Hide
Permalink
Andrew Eisenberg added a comment - 25/May/10 2:29 PM

Patch is applied...committing now so that you can recreate the patch for GRECLIPSE-748.

Show
Andrew Eisenberg added a comment - 25/May/10 2:29 PM Patch is applied...committing now so that you can recreate the patch for GRECLIPSE-748.
Hide
Permalink
Kris De Volder added a comment - 25/May/10 3:11 PM

I'm having issues with pulling in the changes from SVN. It appears like some of the files that you moved manually don't
have the changes that I made on my end.

I'm pulling in the changes here one file at a time now and I'll make a patch of the missed changes.
After making sure the tests pass on my end, I'll attach this as a patch here.

Show
Kris De Volder added a comment - 25/May/10 3:11 PM I'm having issues with pulling in the changes from SVN. It appears like some of the files that you moved manually don't have the changes that I made on my end. I'm pulling in the changes here one file at a time now and I'll make a patch of the missed changes. After making sure the tests pass on my end, I'll attach this as a patch here.
Hide
Permalink
Kris De Volder added a comment - 25/May/10 3:57 PM

Actually, it seems everything is fine now. I must have been trying to pull in changes while the commit was still in progress. My local copy and the one in SVN are now identical.

The patch is in and the build succeeded on the build server:

http://bamboo.ci.codehaus.org/browse/GRECLIPSE-V2E34-485/

So, a new snapshot should be available now from the update site.

Resolving this issue. Please reopen if you still experience problems with this.

Show
Kris De Volder added a comment - 25/May/10 3:57 PM Actually, it seems everything is fine now. I must have been trying to pull in changes while the commit was still in progress. My local copy and the one in SVN are now identical. The patch is in and the build succeeded on the build server: http://bamboo.ci.codehaus.org/browse/GRECLIPSE-V2E34-485/ So, a new snapshot should be available now from the update site. Resolving this issue. Please reopen if you still experience problems with this.

People

  • Assignee:
    Kris De Volder
    Reporter:
    Benjamin Gudehus
Vote (0)
Watch (0)

Dates

  • Created:
    27/Jan/10 1:34 AM
    Updated:
    25/May/10 3:57 PM
    Resolved:
    25/May/10 3:57 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.