Skip to content

Add interface and trait for classes with a lineNumber #1207

Closed
@JakeQZ

Description

@JakeQZ

Some things to decide first:

  • Should this also include column number (which may not be used in all cases)?
  • What should the interface be called (Positionable?)?

And some changes that could be made in the course of this:

  • Rename getLineNo() to getLineNumber() as follows:
    • Add both methods to the interface, with getLineNo marked as deprecated from 9.0, to be removed in 10.0;
    • The trait can handle forwarding getLineNo to getLineNumber (or simply access the property), so that no changes to implementing classes are required, provided they can use the trait;
  • Use null to indicate 'no line number' instead of 0:
    • Again, the trait should be able to take care of the details, avoiding changes to implementing classes.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions