[JBoss JIRA] (ROASTER-89) Add API to get the line number and absolute position
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-89?page=com.atlassian.jira.plugin... ]
George Gastaldi updated ROASTER-89:
-----------------------------------
Summary: Add API to get the line number and absolute position (was: Roaster - Add api to get the line number and absolute position)
> Add API to get the line number and absolute position
> ----------------------------------------------------
>
> Key: ROASTER-89
> URL: https://issues.jboss.org/browse/ROASTER-89
> Project: Roaster
> Issue Type: Feature Request
> Affects Versions: 2.17.4.Final
> Reporter: Claus Ibsen
>
> When using Roaster to parse java source code, you have the various types, such as fields
> FieldSource<JavaClassSource> field
> MethodSource<JavaClassSource> method
> and so on
> The backing JDT AST has the position of where those types are in the source code.
> It would be good to have an api that can provide
> - the absolute position (absolute char position)
> - the line number
> - the relative position in the line
> You can derive the latter two values from the absolute position.
> The AST has the absolute start position in code alike:
> org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode#getStartPosition
> The need for this is to be able to provide better feedback to the end users, where in the source code the node is, such as if you use it to parse and validate, or if you want to build a custom search function etc.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ROASTER-89) Roaster - Add api to get the line number and absolute position
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-89?page=com.atlassian.jira.plugin... ]
George Gastaldi moved FORGE-2571 to ROASTER-89:
-----------------------------------------------
Project: Roaster (was: Forge)
Key: ROASTER-89 (was: FORGE-2571)
Affects Version/s: 2.17.4.Final
(was: 3.0.0.Beta1)
> Roaster - Add api to get the line number and absolute position
> --------------------------------------------------------------
>
> Key: ROASTER-89
> URL: https://issues.jboss.org/browse/ROASTER-89
> Project: Roaster
> Issue Type: Feature Request
> Affects Versions: 2.17.4.Final
> Reporter: Claus Ibsen
>
> When using Roaster to parse java source code, you have the various types, such as fields
> FieldSource<JavaClassSource> field
> MethodSource<JavaClassSource> method
> and so on
> The backing JDT AST has the position of where those types are in the source code.
> It would be good to have an api that can provide
> - the absolute position (absolute char position)
> - the line number
> - the relative position in the line
> You can derive the latter two values from the absolute position.
> The AST has the absolute start position in code alike:
> org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode#getStartPosition
> The need for this is to be able to provide better feedback to the end users, where in the source code the node is, such as if you use it to parse and validate, or if you want to build a custom search function etc.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (FORGE-2571) Roaster - Add api to get the line number and absolute position
by Claus Ibsen (JIRA)
Claus Ibsen created FORGE-2571:
----------------------------------
Summary: Roaster - Add api to get the line number and absolute position
Key: FORGE-2571
URL: https://issues.jboss.org/browse/FORGE-2571
Project: Forge
Issue Type: Feature Request
Affects Versions: 3.0.0.Beta1
Reporter: Claus Ibsen
When using Roaster to parse java source code, you have the various types, such as fields
FieldSource<JavaClassSource> field
MethodSource<JavaClassSource> method
and so on
The backing JDT AST has the position of where those types are in the source code.
It would be good to have an api that can provide
- the absolute position (absolute char position)
- the line number
- the relative position in the line
You can derive the latter two values from the absolute position.
The AST has the absolute start position in code alike:
org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode#getStartPosition
The need for this is to be able to provide better feedback to the end users, where in the source code the node is, such as if you use it to parse and validate, or if you want to build a custom search function etc.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (FORGE-2571) Roaster - Add api to get the line number and absolute position
by Claus Ibsen (JIRA)
[ https://issues.jboss.org/browse/FORGE-2571?page=com.atlassian.jira.plugin... ]
Claus Ibsen commented on FORGE-2571:
------------------------------------
See also
https://github.com/fabric8io/fabric8/issues/5524
> Roaster - Add api to get the line number and absolute position
> --------------------------------------------------------------
>
> Key: FORGE-2571
> URL: https://issues.jboss.org/browse/FORGE-2571
> Project: Forge
> Issue Type: Feature Request
> Affects Versions: 3.0.0.Beta1
> Reporter: Claus Ibsen
>
> When using Roaster to parse java source code, you have the various types, such as fields
> FieldSource<JavaClassSource> field
> MethodSource<JavaClassSource> method
> and so on
> The backing JDT AST has the position of where those types are in the source code.
> It would be good to have an api that can provide
> - the absolute position (absolute char position)
> - the line number
> - the relative position in the line
> You can derive the latter two values from the absolute position.
> The AST has the absolute start position in code alike:
> org.jboss.forge.roaster._shade.org.eclipse.jdt.core.dom.ASTNode#getStartPosition
> The need for this is to be able to provide better feedback to the end users, where in the source code the node is, such as if you use it to parse and validate, or if you want to build a custom search function etc.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months