Skip to content
This repository was archived by the owner on Jun 13, 2022. It is now read-only.
This repository was archived by the owner on Jun 13, 2022. It is now read-only.

It's not obvious which grammar names to use #105

Description

@juschu

show, hide, enable and disable need the names of the grammar. But the README.md doesn't show any information which names those are.
I tried to add a JavaScript button. show: "js" didn't work. Then I tried show: ".source.js" and show: "source.js" because this is what you have to use in snippets and you can find it in the language package next to "Scope". But it didn't work.
Then I tried to find out the grammar name with atom.workspace.getActiveTextEditor().getGrammar().name and this gave me the correct grammar name for any language I needed.

At least I solved my problem but others still could run in the same problem. Perhaps you could include a toolbar.coffe instead of a toolbar.cson by default which already has a "get grammar" button like this.

module.exports = [
	{
		type: "function"
		icon: "language"
		iconset: "fa"
		callback: (target) ->
			alert atom.workspace.getActiveTextEditor().getGrammar().name
		tooltip: "get grammar"
	}
]

That would be much better that just trying out different names until you find the right one.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions