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
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.
Jean-Noël Rouvignac
@JnRouvignac
See CommentsRefactoring
Luis Cruz
@luiscruz
changing the topic, why does getAncestor throws an exception instead of returning null?
Jean-Noël Rouvignac
@JnRouvignac
Because when using this API, it is expected to find the required type
I never had a problem with it
Is it causing you grief ?
Luis Cruz
@luiscruz
:sweat_smile: it’s just that in my code sometimes there are cases in which I’m not expecting it to find the ancestor
so a simple `ìf/else``turns into nested try/catch statements
Jean-Noël Rouvignac
@JnRouvignac
Ah this is ugly
Maybe can we add getAncestorOrNull?
Luis Cruz
@luiscruz
yea
shall I do it?
Jean-Noël Rouvignac
@JnRouvignac
Yes
Please
Fabrice TIERCELIN
@Fabrice-TIERCELIN
OK. I'm in.