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

Atom commands for specific language #27

Closed
Glavin001 opened this issue Jun 14, 2014 · 10 comments
Closed

Atom commands for specific language #27

Glavin001 opened this issue Jun 14, 2014 · 10 comments

Comments

@Glavin001
Copy link
Owner

See https://github.com/taronfoxworth/atom-beautifier/blob/master/lib/beautifier.coffee#L99-L102

  atom.workspaceView.command "beautifier", -> convert()
  atom.workspaceView.command "beautifier:js", -> convertJs()
  atom.workspaceView.command "beautifier:html", -> convertHTML()
  atom.workspaceView.command "beautifier:css", -> convertCSS()

Use case: highlight a specific area of code that is a different language than the overall file's grammar type. Now apply the desired, correct, beautification.

@ilanbiala
Copy link

@Glavin001 you shouldn't use atom.workspaceView when you implement this.

@Glavin001
Copy link
Owner Author

Wow Atom's API has changed.. https://atom.io/docs/api/v0.165.0/CommandRegistry

Thanks for the heads up @ilanbiala

@ilanbiala
Copy link

@Glavin001 can this be closed?

@Glavin001
Copy link
Owner Author

Nope, not yet implemented.

@Glavin001
Copy link
Owner Author

@Glavin001 Glavin001 modified the milestones: v0.26.0, v0.25.0, v0.27.0 May 3, 2015
@Glavin001 Glavin001 modified the milestones: v0.29.0, v0.28.0 Jun 6, 2015
@Glavin001 Glavin001 modified the milestones: v0.30.0, v0.29.0 Mar 30, 2016
@l3ender
Copy link

l3ender commented Sep 5, 2016

This would be fantastic 👍

@Glavin001
Copy link
Owner Author

It's working!

Example beautifying JavaScript within HTML

Step 1) Select the appropriate code.

image

Step 2) Open command palette and search for Atom Beautify: Beautify Language Javascript.

image

Step 3) Run command and see selected code has been beautified with the specific beautifier for JavaScript.

image

@Glavin001
Copy link
Owner Author

Published to v0.29.24

@Glavin001
Copy link
Owner Author

atom-beautify-language-commands-2

@Glavin001
Copy link
Owner Author

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

3 participants