Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » MarkerUpdater doesn't react on refactoring operation
MarkerUpdater doesn't react on refactoring operation [message #243631] Thu, 10 May 2007 15:52 Go to next message
Eclipse UserFriend
Originally posted by: schmidts.iese.fraunhofer.de

Hi everybody.

I got a little problem with the position of my resource markers. I defined a
new IMarker that is subtype of Textmarker and Problemmarker. When one of
these markers is attached to a IFile it is shown properly in the editor an
the problems view. I only set the position attribute CHAR_START and
CHAR_END, LINE_NUMBER is not in use.

When ich change the sourcecode in the editor, every marker is moved around
correctly. But when changing the code programatically, i.e. by a refactoring
like renaming the type, the marker start and end positions stay in there old
place.

I tried to use the ExtensionPoint MarkerUpdater and used the
standard-implementation BasicMarkerUpdater for my marker type, but that
class is only called, when the compilationUnit is saved in the editor. A
refactoring doesn't trigger the updater to move the markers.

Can anyone give me a hint, what I am doing wrong here, please?

Best regards, Seb
Rename-Refactoring behaves strange, new incident of the same problem. [message #243708 is a reply to message #243631] Mon, 14 May 2007 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schmidts.iese.fraunhofer.de

Hi

The problem from my last post is still unresolved, but I found some new
details about it.
I see the source of the misbehaveour in the Rename-Refactoring:

When there is a marker that underlines a method-name and some characters or
even newlines are inserted above its position in the editor it is moved
correctly. On saving the file, the MarkerUpdater persists the new position.

If anonther method, that is located above the marked one, is renamed using
the refactoring, then the marker is moved correctly and the file is saved
automatically, but the MarkerUpdater is not called to change the position
attributes of the marker at the resource.

If now the classname is changed with the refactoring routine, the marker is
placed at the last position that was persisted by the MarkerUpdater, not
regarding the changed length of the class name, and even not regarding the
changed length of the other method.

For example:

public class MyClass{
void method_one(){}
void method_two(){}
^--marker-^
}
CHAR_START = 56.

Refactoring[Rename] of "method_one" to "method_1" leads to

public class MyClass{
void method_1(){}
void method_two(){}
^--marker-^
}
CHAR_START = 54.

Refactoring[Rename] of "MyClass" to "MyRenamedClass" leads to

public class MyRenamedClass{
void method_1(){}
void method_two(){}
^--marker-^
}
CHAR_START = 56.

I see the main problem in saving the file at the end of refactoring, but not
calling the MarkerUpdater. I didn't find a bug about this case.
Should I open one? And against which PlugIn?

Thanks, Seb
Re: Rename-Refactoring behaves strange, new incident of the same problem. [message #243713 is a reply to message #243708] Mon, 14 May 2007 13:27 Go to previous message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Sebastian Schmidt a écrit :
> Should I open one? And against which PlugIn?
Yes, you should. JDT/UI.
--
Olivier
Previous Topic:Java Editor Code folds things out
Next Topic:maintaining project .settings files
Goto Forum:
  


Current Time: Thu Apr 25 15:42:07 GMT 2024

Powered by FUDForum. Page generated in 0.03033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top