Bug 29178 - address AST client needs re: leading and trailing comments
Summary: address AST client needs re: leading and trailing comments
Status: RESOLVED DUPLICATE of bug 53445
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M8   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 28268 29392
  Show dependency tree
 
Reported: 2003-01-08 17:10 EST by Jim des Rivieres CLA
Modified: 2006-04-19 10:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2003-01-08 17:10:19 EST
AST clients need a way to get at leading and trailing comments for statements 
(and other node types) so that they can do reasonable things like 
selecting/deleting/moving entire language construct. 

Part of the difficulty will be deciding on the rules for deciding which 
comments should be associated with which constructs. E.g.:

      // comment 1
      statement1(); // comment 2
      // comment 4
      // comment 5
      statement2(); // comment 6
                    // comment 7
      // comment 8
      statement3();

See bug 28268 for a discussion of the kinds of issues that arise in 
refactoring.

One possible approach to consider is adding new scanner-based utility so that 
a client can expand the source range of a node after-the-fact to include the 
leading and/or trailing comments and whitespace that naturally belong to a 
construct.
Comment 1 Philipe Mulet CLA 2003-01-15 17:37:03 EST
Post 2.1

Support should not suppose anything about attaching comments. There should be a 
pluggable mechanism for associated comments to nodes, and we would provide a 
reasonable default one.
Comment 2 Frederic Fusier CLA 2006-04-19 10:29:25 EDT
Reopen to set as duplicate
Comment 3 Frederic Fusier CLA 2006-04-19 10:38:59 EDT

*** This bug has been marked as a duplicate of 53445 ***