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

Suggesting to install babel syntax highlighting for Sublime #347

Closed
vjeux opened this issue Aug 3, 2016 · 6 comments
Closed

Suggesting to install babel syntax highlighting for Sublime #347

vjeux opened this issue Aug 3, 2016 · 6 comments

Comments

@vjeux
Copy link
Contributor

vjeux commented Aug 3, 2016

I have a brand new laptop and the syntax highlighting in Sublime is all crappy for JSX. Would be nice to detect if Sublime is opened and if people are using the standard JavaScript one and recommend installing the babel syntax highlighter.

One project that does something similar is Fuse where there's a wizard that lets you automatically install their Sublime extension by pressing next.

screen shot 2016-08-03 at 10 00 37 am

@vjeux
Copy link
Contributor Author

vjeux commented Aug 3, 2016

Looks like it's going to be a bit of a pain to do install it automatically via code and the instructions are also quite painful :(

  1. Install PackageControl
  • View > Show Console
  • Copy & Paste the python script
  1. Install Babel Package
  • Cmd Shift P
  • Type Package Control: Install Package
  • Type Babel and press Enter
  1. Set Babel to be the default syntax highlighting for JavaScript
  • Open a JavaScript file
  • View > Syntax > Open all with current extension as... > Babel -> JavaScript (Babel)

@gaearon
Copy link
Contributor

gaearon commented Aug 3, 2016

Can we ask Sublime to ship Babel syntax as JavaScript?

@vjeux
Copy link
Contributor Author

vjeux commented Aug 3, 2016

@thejameskyle tried but was unsuccessful.

I see this as the first step. I want to have a one click installation for setting up your editor with syntax highlighting, eslint, flow... This is a big part of the developer experience and something that every tool I know of punted on so far.

@battaile
Copy link

battaile commented Aug 3, 2016

Sublime 2 specific but from looking at similar issues I think it works the same in Sublime 3:
mrmartineau/SublimeTextSetupWiki#3 (comment)

To install Package Control, http://sublime.wbond.net/Package%20Control.sublime-package needs to be placed inside of the Installed Packages/ folder. The next time Sublime starts, it will install the package.

To batch install other packages, a Package Control.sublime-settings file needs to be placed into the Packages/User/ folder. Inside of the settings file should be a JSON object with the key "installed_packages" that references a list of package names. When Package Control starts, if any of those packages are not present, the will be automatically downloaded and installed. Here is an example: http://pastebin.com/NLEavL1K.

So just copy the sublime-package file and then create/append babel to the sublime-settings file? Actually making the filetype association can be expressed as one of their json macros but I'm not sure how to invoke that programatically.

@stephenkingsley
Copy link

@gaearon @vjeux may I ask the react team's member is not use atom?

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

While this is a cool idea, it’s unlikely either of us will get to it, and it’s also somewhat fragile. With the influx of competing editors (Atom, VSCode) it doesn’t seem like special-casing Sublime is a good idea. Sublime also recently updated to ship Package Control by default.

I think this could better be addressed as a doc entry. I filed an issue for that: #804.

@gaearon gaearon closed this as completed Sep 30, 2016
nickserv pushed a commit to nickserv/create-react-app that referenced this issue Aug 5, 2018
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants