Skip to content

Comments

Add offset to BugInfo.#466

Merged
denuno merged 1 commit intodevfrom
feature-offset
Sep 13, 2017
Merged

Add offset to BugInfo.#466
denuno merged 1 commit intodevfrom
feature-offset

Conversation

@denuno
Copy link
Collaborator

@denuno denuno commented Sep 13, 2017

It turns out it's really useful to have the offset (position in the document if it were a stream of chars) of a bug. Required, in fact, for some applications to figure out where in a document something is.

We can figure this out via line/col by having things keep tables of line/offset positions, but generally they'd need the source input to build this table, and thus another hit on the file system and whatnot (which is rough with lots of files).

The parser already has this info, so we should expose it and save any tools that use offsets versus line+column the trouble of converting the location info. This also adds a length attribute, which is a little hokey but seems to work fine (used to visually highlight the code causing the issue).

@denuno denuno self-assigned this Sep 13, 2017
@denuno
Copy link
Collaborator Author

denuno commented Sep 13, 2017

As the unit tests passed, I'm going to go ahead and merge this. Couple things to note:

  • uses cfml.parsing 2.5.6-SNAPSHOT (first to expose offsets)
  • added clearBugList to BugList, and changed the config call around a bit so the same linter can be used repeatedly
  • tweaks missing semi handling a little, we might want to change this back (now it uses the token before the token it was showing, theoretically the one actually causing the issue, but while visually nicer, technically, maybe not as nice?).

@denuno denuno merged commit d5e2bdc into dev Sep 13, 2017
@denuno denuno deleted the feature-offset branch September 13, 2017 06:05
@ryaneberly
Copy link
Contributor

ryaneberly commented Sep 13, 2017 via email

@KamasamaK KamasamaK mentioned this pull request Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants