Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 29 04:35

    Fabrice-TIERCELIN on master

    Separate analyze and refactoring (compare)

  • Jun 27 18:43
    cal101 commented #492
  • Jun 27 18:34
    Fabrice-TIERCELIN closed #492
  • Jun 27 18:34

    Fabrice-TIERCELIN on master

    Closes #492; Only use methods i… (compare)

  • Jun 27 18:27
    Fabrice-TIERCELIN labeled #492
  • Jun 27 18:26
    Fabrice-TIERCELIN assigned #492
  • Jun 27 17:42
    cal101 opened #492
  • Jun 26 11:19
    JnRouvignac closed #93
  • Jun 26 11:19
    JnRouvignac commented #93
  • Jun 26 11:19
    JnRouvignac commented #93
  • Jun 26 04:20

    Fabrice-TIERCELIN on master

    Standard tests New CleanUp: Replaces some chec… (compare)

  • Jun 25 15:49
    cal101 commented #391
  • Jun 25 15:47
    cal101 commented #93
  • Jun 25 15:43
    cal101 added as member
  • Jun 25 07:02
    JnRouvignac commented #391
  • Jun 25 03:45
    Fabrice-TIERCELIN commented #391
  • Jun 24 21:12
    JnRouvignac commented #391
  • Jun 24 20:47
    JnRouvignac commented #93
  • Jun 24 20:45
    JnRouvignac commented #11
  • Jun 24 20:31
    JnRouvignac closed #393
Jean-Noël Rouvignac
@JnRouvignac
it was ok when you copied
but copy always means you lose the comments
you should use move() by default
Luis Cruz
@luiscruz
I am copying the inflater.inflate expression
and in the end I remove the original statement
so even if I “move” I wouldn’t get the comments, since it is only a subtree
Jean-Noël Rouvignac
@JnRouvignac
I see no comments here?
so no comments to lose?
Luis Cruz
@luiscruz
I’ll do it again
            //this should not be refactored
            rootView = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
            //this should not be refactored
            if (convertView == null) {
                convertView = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
            }
Jean-Noël Rouvignac
@JnRouvignac
so you are losing this comment?
Luis Cruz
@luiscruz
yes!
Jean-Noël Rouvignac
@JnRouvignac
by default comments are attached to the nodes following them
this is a property of the ASTParser
Luis Cruz
@luiscruz
ok, so if I want to keep them I have to make sure I copy it before removing the node
is that right?
Jean-Noël Rouvignac
@JnRouvignac
I do not think that will work
I recall something and I think it was more complicated than this
Luis Cruz
@luiscruz
:\
Jean-Noël Rouvignac
@JnRouvignac
comments are somewhat attached to an ASTNode, but they are not directly part of the AST
or directly attached to an ASTNode
hence why I say there are there, but not there
Luis Cruz
@luiscruz
ya, I get it now
Jean-Noël Rouvignac
@JnRouvignac
sorry it was a bit mystical, but very hard to explain without a concrete example :)
Actually I think it is a property of the ASTRewrite:
See setTargetSourceRangeComputer()
eclipse internal API has a NoCommentSourceRangeComputer
Luis Cruz
@luiscruz
What do you think of checking getAlternateRoot() in every Comment
Jean-Noël Rouvignac
@JnRouvignac
what do you want to do with it?
Luis Cruz
@luiscruz
I would get the comment for the node I want to remove and then reassign a different node using setAlternateRoor()
not sure if I understood these Comment methods
Jean-Noël Rouvignac
@JnRouvignac
I would be surprised if that work: that would work very differently from the rest of the JDT APIs
the best advice i can give you is to give it a shot
or else duck and ignore this problem (as I cowardly did)
Luis Cruz
@luiscruz
I will create a comment and assign it using setAlternateRoot
Jean-Noël Rouvignac
@JnRouvignac
actually not totally I went as far as understanding using the move() method is important :)
ok, try and see if that helps
Luis Cruz
@luiscruz
I dont believe it willl work as well, but it shouldn’t take too much time
:)
does’t work
Jean-Noël Rouvignac
@JnRouvignac
:-|
Luis Cruz
@luiscruz
anyway, I’ll go over this after lunch
thanks ;)
Jean-Noël Rouvignac
@JnRouvignac
np sorry I could not give you the ultimate answer
Luis Cruz
@luiscruz
no worries ;)
Luis Cruz
@luiscruz
do you know how can I get text from a comment?
Luis Cruz
@luiscruz
well, never mind. I give up for now. It’s not a priority for now.