Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use decorations API #147

Merged
merged 5 commits into from
Aug 4, 2014
Merged

Use decorations API #147

merged 5 commits into from
Aug 4, 2014

Conversation

dmnd
Copy link

@dmnd dmnd commented Aug 1, 2014

I'm converting the gutter and highlights view to use the new decorations API.

This is good because it lets us delete a lot of functionality that's now provided by core Atom.

  • Convert GutterView
  • Convert HighlightsView
  • Use a consolidated collection of markers
  • Update specs

This new API is designed exactly for our use case. One benefit is that
`GutterView.render` is now no longer called hundreds of times a second (!)

I copied most of the implementation from the git-diff package.

Test plan:

Opened a new editor and verified that gutter markers appear and disappear when
lint errors are caused and resolved. Also added a logging statement to
`GutterView.render` to verify that it's now only called when the file is
linted.
@dmnd dmnd changed the title Use decorations API to display gutter markers Use decorations API Aug 1, 2014
dmnd added 2 commits August 1, 2014 01:27
Again the implementation is inspired by the git-diff package.

Test Plan:
Opened a new editor and verified that highlights show up. I had to tweak the
indexing for columns after noticing that errors on the final line didn't show
up after this change.
Since `GutterView` and `HighlightsView` were basically the same thing, I
extracted out the shared code to `LinterView` and deleted them.

Test Plan:
Opened a file with lint errors. In another Atom window, went to settings and
turned gutter and highlights on and off and made sure that these settings still
updated in the other window.
# errors on line 1
if (rowStart == -1)
rowStart = rowEnd = 0
decrementParse = (x) ->
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a lot of places we need to decrement a base-1 index into a base-0 index. This function does that, as well as parses as an integer and makes sure we don't end up with -1.

@dmnd
Copy link
Author

dmnd commented Aug 2, 2014

I'm finished with this now, can someone review and consider merging?

Conflicts:
	lib/linter-view.coffee
@dmnd
Copy link
Author

dmnd commented Aug 2, 2014

FYI this conflicts with #137. If you pull one of them I can fix up the other one.

hd-deman added a commit that referenced this pull request Aug 4, 2014
@hd-deman hd-deman merged commit b53b1c3 into steelbrain:master Aug 4, 2014
@hd-deman
Copy link
Contributor

hd-deman commented Aug 4, 2014

ok. please fix #137

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