atom / snippets

Atom snippets package
MIT License
205 stars 101 forks source link

Documentation: description of finding snippet scope does not work #274

Closed FrancisVila closed 5 years ago

FrancisVila commented 6 years ago

Prerequisites

Description

I'd like to build my own snippets file for different environments (javascript, css, etc)

On page https://flight-manual.atom.io/using-atom/sections/snippets/

For example, if we wanted to add a snippet that would work for Java files, we would look up the language-java package in our Settings view and we can see the Scope is source.java. Then the top level snippet key would be that prepended by a period (like a CSS class selector would do). (the image shows a screenshot with Scope: source.java )

Steps to Reproduce

  1. I go to Settings > Packages in Atom
  2. type Language Java in Search
  3. I see the package language-java , but nowhere Scope: source.java (see screenshot)
  4. I see a button marked View on Atom.io. Click on the button, it takes you to [https://atom.io/packages/language-html]
  5. no Scope: source.java in sight on that page either

image image

FrancisVila commented 6 years ago

The most useful source of info I found was this: https://github.com/psmitt/metalanguage/blob/master/examples/ScopeList.ScopeList

FrancisVila commented 6 years ago

Added to this I opened a file in the delivery called language-package-name.cson . There's a comment in that file saying:

If you want some example snippets, check out: https://github.com/atom/language-javascript/blob/master/snippets/javascript.cson

Went to the address, got a 404 error

savetheclocktower commented 6 years ago

Below the part you screenshotted, do you not see a section in the language-java settings describing the Java grammar?

screen shot 2018-09-25 at 9 41 50 am
savetheclocktower commented 6 years ago

Also, you say language-package-name.cson was “in the delivery” — can you be more specific? I can’t find the file you’re talking about.

FrancisVila commented 6 years ago

So it is! I visually discarded the part below because I thought it belonged to the next package. It has rather a big space between the top part and the rest.