snippets
snippets copied to clipboard
Configurable Quotes
I like to use single quotes in my JavaScript. Whenever I use a snippet that uses double quotes by default, I have to get rid of the linting errors.
I noticed snippets handle tabs vs spaces correctly for the selected grammar. So maybe atom-core and individual grammars would have to add a new setting whether to use single quotes?
Any thoughts on this? If I give this a shot and make a PR, will it be merged?
:+1:
I came here to request the same thing :+1:
I like me some double quotes but all these snippets use single quotes which causes my linter to moan!
How does snippets handle tabs vs spaces?
How does snippets handle tabs vs spaces?
Tabs are specified using \t so I assume Atom just replaces that with either soft or hard tabs depending on your tab preference. Quotes however are hardcoded as ' or " depending on each snippet.
If you prefer to use single quotes (same like myself) wrap your snippet around triple quotation mark. Have a look at the documentation.
https://atom.io/docs/v1.3.2/using-atom-snippets#multi-line-snippet-body
+1
In coffeescript I always use double quotes, because #{string interpolation} doesn't work with single, so hardcoded single quotes it's a mistake! :(
+1 I only use double quotes in ruby when interpolation is necessary
The default double quotes for things like describe breaks default Rubocop style guide! This should be an easy fix. Would anybody mind if I open a PR for that bit?
@lacostenycoder, you're talking about changing an existing snippet from double quotes to single quotes? If so, you'd want to make that change within the package that defines it.
I don't know which package provides a describe snippet for Ruby — I don't see it in the language-ruby source, nor in language-ruby-on-rails. You can see on a package's settings page which snippets it provides, if any.