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

Update README.md for snippet installation #26

Closed
wants to merge 2 commits into from

Conversation

ckib16
Copy link

@ckib16 ckib16 commented Oct 25, 2016

Help for newcomers on how to enable SiB snippets in Atom editor

This wasn't immediately obvious to me after watching the video and reading the docs.

Great work!

Help for newcomers on how to enable SiB snippets in Atom editor
@JoshCheek
Copy link
Owner

Hi, thx thx ^_^

I mention some in the readme currently, can you see if those work? eg this one is s_arb Perhaps the language wasn't set to Ruby? Maybe I should just make them global since the probability of a namespace collision is negligible?

snippets

@ckib16
Copy link
Author

ckib16 commented Oct 26, 2016

Hey @JoshCheek

Hmm. Just to be clear...

I did see you mention the snippets in current README

But...

  • I initially thought the snippets came "pre-installed" when you installed the SiB atom package
  • I tried to use them and it didn't work for me. Atom did not show them as available snippets.
  • Then I realized maybe I have to manually add them (copy & paste snippet code in per my changes to README)
  • After manually adding the snippets, they worked as advertised

So my PR changes were geared around installing the snippets to get them to work.
In other words, getting noobs to the point where they could type s_arb and atom would auto-expand the snippet code.

Does that make sense?

Did your snippets automatically work for you after installing SiB atom package & gem with no other work required?

@ckib16
Copy link
Author

ckib16 commented Oct 26, 2016

Ohhh...are you trying to show in the gif that AFTER you set the file type to .rb then Atom recognized s_arb as a snippet and allowed expansion?

That is something I did not try out. And you may be right.

I just know the snippets didn't expand for me and so I brute forced it by manually copy / pasting in as new snippet.

Let me check....

@JoshCheek
Copy link
Owner

Hmm, it's strange, I haven't experienced this issue before. The most likely thing I can think of is that the language wasn't set to Ruby, so it didn't match the snippets' scope. I'll see if I can find someone willing to try reproducing the issue.

@ckib16
Copy link
Author

ckib16 commented Oct 26, 2016

Nope - you're right @JoshCheek

  • I commented out the manual copy/paste code in my snippets.cson
  • Started a blank file
  • typed s_arb with file type set as plain text -> no results
  • typed s_arb with file type set as Ruby = successful snippet expansion :)

So maybe I'll just change PR to emphasize ensuring file type is set to .rb to ensure snippets work?

Changed to make sure people know to have new/blank files set as `Ruby`
This allows Atom to recognize the snippets and expand them
@ckib16
Copy link
Author

ckib16 commented Oct 26, 2016

I updated README with results of our conversation above.
Let me know what you think.

@JoshCheek
Copy link
Owner

Lets just remove the Ruby scope. It clearly trips people up, I've hit it before, too, if we scope it at something higher, then it removes that hurdle. I don't think we need to worry about collision due to their names being pretty unique. I'd also prefer to avoid encouraging users to save the file, I almost never have that use case, so it seems like it would be polluting their file system just to set the language (note that you can set the scope with Control-Shift-L or by clicking the current language in the lower right).

Would you be willing to do that? I don't know what the scope should be, I'd prob figure it out by looking for a snippet that is language agnostic and seeing what they used there, if I couldn't find one, probably just try .editor since it just seems probable, in that case, use Command-Option-I to pull up dev tools and inspect the DOM to make sure it's a reasonable guess. Might also say in the docs, eg in the snippets or keybindings sections.

@JoshCheek
Copy link
Owner

@ckib16
Copy link
Author

ckib16 commented Oct 27, 2016

Ah I gotcha.

Honestly - that stuff is above my level. I understand conceptually what you are saying, but you would be a much better judge.

My take - asking people to set file extension to .rb is no big deal at all. I'd say lean that way, but I understand if you want to solve something bigger.

Feel free to toss this PR, and thanks again for making this! Spreading the word to my co-workers.

@JoshCheek
Copy link
Owner

I can do it if you like, just didn't want to take the opportunity from you :) It should be a change to this line, which is scoping the snippets so that they are only available inside of ruby code. If we change it to something else, like .source.python (I assume), they would only be available within python code. So it's a question of what's the right thing to replace it with.

@JoshCheek JoshCheek closed this in 6dc6feb Oct 28, 2016
@JoshCheek
Copy link
Owner

I went ahead and updated the scope.

Thanks for bringing this to my attention, I've had a number of UX issues over the years, but I do think it is incredibly important, so it's good that we're finding and fixing things like this ^_^

@ckib16
Copy link
Author

ckib16 commented Oct 29, 2016

Ah sorry @JoshCheek - got caught up in work yesterday :)

Yes - your change makes more sense when you pointed the line out. That should work well.

Thanks for the help!

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.

None yet

2 participants