diff options
author | avasseur <avasseur> | 2005-07-05 11:46:21 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-07-05 11:46:21 +0000 |
commit | d8fa51baa77d426bf5a14ab5e9c0f9f3784981b4 (patch) | |
tree | 2965e1c012f6e2f795d5d3f84b90ad0d5d2a0358 /org.aspectj.ajdt.core | |
parent | 35a7305b31437cc8982de9b71b26eb54a19d2995 (diff) | |
download | aspectj-d8fa51baa77d426bf5a14ab5e9c0f9f3784981b4.tar.gz aspectj-d8fa51baa77d426bf5a14ab5e9c0f9f3784981b4.zip |
add offset in MethodDeclarationAttribute for @AJ in AJDT
Diffstat (limited to 'org.aspectj.ajdt.core')
3 files changed, 15 insertions, 11 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java index 504631c9c..13212dfdd 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java @@ -53,6 +53,6 @@ public class AjConstructorDeclaration extends ConstructorDeclaration { } extraAttributeList.add( - new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine))); + new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine, this.sourceStart()))); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java index ae91da894..21e009f67 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java @@ -69,6 +69,6 @@ public class AjMethodDeclaration extends MethodDeclaration { } extraAttributeList.add( - new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine))); + new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine, this.sourceStart()))); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java index b3fc473b4..8cdaa333b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java @@ -50,18 +50,22 @@ public class EclipseSourceContext implements ISourceContext { return new EclipseSourceLocation(result, position.getStart(), position.getEnd()); } - public ISourceLocation makeSourceLocation(int line) { + public ISourceLocation makeSourceLocation(int line, int offset) { SourceLocation sl = new SourceLocation(getSourceFile(), line); - // compute the offset - //TODO AV - should we do it lazily? - int[] offsets = result.lineSeparatorPositions; - int likelyOffset = 0; - if (line > 0 && line < offsets.length) { - //1st char of given line is next char after previous end of line - likelyOffset = offsets[line-1]; + if (offset > 0) { + sl.setOffset(offset); + } else { + // compute the offset + //TODO AV - should we do it lazily? + int[] offsets = result.lineSeparatorPositions; + int likelyOffset = 0; + if (line > 0 && line < offsets.length) { + //1st char of given line is next char after previous end of line + likelyOffset = offsets[line-1];//FIXME may be need -2 + } + sl.setOffset(likelyOffset); } - sl.setOffset(likelyOffset); return sl; } |