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

Issues with Ruby inheritance #29

Closed
spearl opened this issue Dec 8, 2015 · 2 comments
Closed

Issues with Ruby inheritance #29

spearl opened this issue Dec 8, 2015 · 2 comments

Comments

@spearl
Copy link

spearl commented Dec 8, 2015

Say I have a rails model

class User < ActiveRecord::Base
end

And I want to look up the dash doc for the rails base model. The atom ruby scoping rules that are being used to look up the search term say that the string in the current scope is " < ActiveRecord::Base" which is fine for syntax highlighting but fails when used to lookup in Dash which means a lot of meaningful Rails documentation is harder to get to.

I'm curious, why was syntax lookup chosen? Does this provide anything extra? Shouldn't the word under the cursor be enough? I saw that issue #2 was the impetus behind this change but this issue could have been solved by simply removing the dash - character from the nonWordCharacters setting of the language-css package. (the same is true for ?, ! and : with ruby but that's a separate issue)

I'm genuinely curious what syntax lookups afford, if anything, beyond a route around the uninformed default non-word character sets for atom's various language packages.

Changing the grammar in language-ruby could fix this (and change highlighting and possibly other things as a side effect), but there could be other scopes that we haven't stumbled on yet that don't match up well with good dash search terms either. I think it makes more sense to go back to word lookups and make sure the nonWordCharacters sets are accurate for the language you're working in.

@blakeembrey
Copy link
Owner

Sounds reasonable to me. In my initial tests (not with Ruby, but a few other languages) I found abusing the syntax highlighting was much more consistent to what I would actually want to look up. As you've found, this isn't perfect. I actually wasn't aware of nonWordCharacters until now, so thanks for pointing that out. My logic, at the time, was this works better and if it needs fine tuning you can just cmd + d (which does the word selection) and then ctrl + h. I'm happy to make this change though, looks like it'll be more consistent, especially with the Atom bugs I've run into recently around broken lookups when tabs are used, etc.

I'll release a new version with this tweak and we'll see if it causes issues for people. If a lot of people complain, I'll likely revert it, but let's see how people are using it.

@blakeembrey
Copy link
Owner

Released with https://github.com/blakeembrey/atom-dash/releases/tag/v1.5.0 👍 Please let me know if it solves your issues.

Anyone else landing on this issue, if the change breaks your workflow please create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants