Coder Social home page Coder Social logo

sublime-better-coffeescript's Introduction

Overview

This package is for Sublime Text 3+. An old version for Sublime Text 2 is accessible via the st2 branch.

We are looking for a maintainer! See #244 for details.

Description

CoffeeScript plug-in was originally created by @Xavura. As I, @aponxi, began writing a lot of code in CoffeeScript, I felt the need for side-by-side view for compiled CoffeeScript. Since Xavura's repository have been inactive I decided to branch out my own version. The biggest change in my branch is the Watch Mode which updates the compiled JavaScript view whenever you modify the CoffeeScript thus enabling you to view your progress side-by-side.

Contributing

  • Please use the issues page to make requests or report bugs.
  • Please make pull requests to the master branch only. ST2 is not supported anymore.

Installation

via Package Control

This is the recommended installation method.

If you have Package Control, you know what to do. If not, well: it's a package manager for Sublime Text 3. Installation guide can be found here. After installing the package manager:

  • Open the Command Pallete (ctrl+shift+P or cmd+shift+P).
  • Type "Install Package" and hit return.
  • Type "Better CoffeeScript" and hit return.

via Source Control

If you plan to contribute, then you should install via this method. Otherwise it is recommended that you install the package via Package Control, see above.

Sublime stores packages in the following locations:

Nix: ~/.config/sublime-text-3/packages
Mac: ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
Win: %APPDATA%\Sublime Text 3\Packages

When using Sublime Text 4 or higher, the directory without the "3" (and the preceding separator character) will be preferred.

As a repository within the packages directory

Open a Terminal/Console and run the following commands, replacing PACKAGE_PATH with the path corresponding to your OS above.

cd PACKAGE_PATH
git clone https://github.com/SublimeText/BetterCoffeeScript.git "Better CoffeeScript"

As a repository outside of the packages directory

If you use Github for Mac/Windows which store repositories in a specific location, or if you just don't want a repository in your packages directory, then instead you can use a link.

If you don't yet have the repository, then grab it via your GUI program or via the command line:

cd WHEREVER_YOU_WANT
git clone https://github.com/SublimeText/BetterCoffeeScript.git

Once that is done, we will create the link:

Windows:

cd PACKAGE_PATH
mklink /D "Better CoffeeScript" ABSOLUTE_PATH_TO_REPOSITORY

Nix/Mac:

cd PACKAGE_PATH
ln -s ABSOLUTE_PATH_TO_REPOSITORY "Better CoffeeScript"

Commands/Shortcuts

You can access the commands either using the command palette (ctrl+shift+P or cmd+shift+P) or via shortcuts.

alt+shift+t - Run a Cake task
alt+shift+r - Run some CoffeeScript (prints output to a panel on the bottom)
alt+shift+s - Run a syntax check
alt+shift+c - Compile a file
alt+shift+d - Display compiled JavaScript
alt+shift+l - Display lexer tokens
alt+shift+n - Display parser nodes
alt+shift+w - Toggle watch mode
alt+shift+p - Toggle output panel

Context menu has Compile Output that compiles the current CoffeeScript and outputs the javascript code that is run, in a panel.

Note: Some of the commands use the Status Bar for output, so you'll probably want to enable it (View » Show Status Bar).

Snippets

  • Use TAB to run a snippet after typing the trigger.
  • Use TAB and shift+TAB to cycle forward/backward through fields.
  • Use ESC to exit snippet mode.

Snippet Triggers

Comprehension

Array:  forin
Object: forof
Range:  fori (inclusive)
Range:  forx (exclusive)

Statements

If:        if
Else:      el
If Else:   ifel
Else If:   elif
Switch:    swi
Ternary:   ter
Try Catch: try
Unless:    unl

Classes

Class - cla
Class extends SuperClass - clx

Other

Function:      -
Function:      = (bound)
Interpolation: #

Building

When using the build system, it is assumed that your .sublime-project file lives in your project's base directory (due to limitations with the build system).

Hitting F7 (Tools » Build) will run the Cake task 'sbuild'.

If you're not quite sure what the point of this is then read on.

Let's say before distributing your project that you would like to combine all of your .js files into one and then minify them them using UglifyJS or something.

That's what this is for! You would create a Cakefile and inside it you would write a task:

task 'sbuild', 'Prepare project for distribution.', ->
	# ...

Settings

Go to Preferences > Package Settings > Better CoffeeScript > Settings - User to change settings.

{
	/*
		The directories you would like to include in $PATH environment variable.
		Use this if your node installation is at a separate location and getting errors such as `cannot find node executable`

		example:
		"envPATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

	*/
	"envPATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
	/*
		The directory containing your coffee binary. Usually
		/usr/local/bin.
	*/
	"binDir": "/usr/local/bin"

	/*
		Compile without the top-level function wrapper (coffee -b).
	*/

,	"noWrapper": true

	/*
		Enable or disable refresh the compiled Output on Save.
		Only available for watch mode.
	*/
,	"watchOnSave": true
	/*
		Enable refreshing compiled JS when CoffeeScript is modified.

		Put false to disable
		Put a number of seconds to delay the refresh
	*/
,	"watchOnModified": 0.5
	/*
		Enable Compiling on save. It will compile into the same folder.
	*/
,	"compileOnSave": true
	/*
		## Enable outputting the results of the compiled coffeescript in a panel
	*/
,	"showOutputOnSave": false
	/*
		## Enable compiling to a specific directory.
		#### Description

		if it is a string like 'some/directory' then `-o some/directory` will be added to `coffee` compiler.
		if it is false or not string then it will compile your `script.coffee` to the directory it is in.

		#### Example:
		Directory is relative to the file you are editing if specified such as
			compileDir": "out"
		Directory is absolute if specified such as
			compileDir": "/home/logan/Desktop/out"

	*/
,	"compileDir": false
	/*
		## Enable compiling to a specific relative directories.

		#### Example:
		Set absolute path for compile dir:
			"compileDir": "/home/user/projects/js"
		And specified folders
			"relativeDir": "/home/user/projects/coffee"
			"compilePaths":
			{
				"/home/user/projects/coffee": "/home/user/projects/first/js",
				"/home/user/projects/second/coffee": "../js",
			}

		So
			"/home/user/projects/coffee/app.coffee" will compile to "/home/user/projects/first/js/app.js"
			"/home/user/projects/coffee/models/prod.coffee" will compile to "/home/user/projects/first/js/models/prod.js"
			"/home/user/projects/coffee/second/coffee/app2.coffee" will compile to "/home/user/projects/second/js/app2.js"
			"/home/user/projects/main.coffee" will compile to "/home/user/projects/js/main.js"

	*/
,	"compilePaths": false



}

Project settings

Go to Project > Edit Project to change project settings.

{
	"folders":
	[
		...
	],
	"settings":
	{
		"CoffeeScript":
		{
			"noWrapper": true,
			"compileOnSave": true,
			"compileDir": "out"
		}
	}
}

FAQ

Most of the linux terminal commands written here can be run via cygwin - aka Linux Terminal in Windows.

  • Most of the problems are related to configurations. Remember to configure binDir after you install!

  • Do I have coffee-script installed?

Try finding coffee-script in your global npm list with npm ls -g | grep coffee which will output something like:

npm ls -g | grep coffee

# will output:
#├── [email protected]
#├─┬ [email protected]
#│ ├── [email protected]
#├── UNMET DEPENDENCY generator-coffee *
#│ │ ├── [email protected]
  • Where can I find out the path to coffee binary?

In Linux which command will tell you where a command originates from. In terminal type:

which coffee
# /usr/bin/coffee

This path will go into the binDir setting.

  • I'm getting the error message 'coffee' is not recognized as an internal or external command, when saving.

The coffee-script binary probably is not installed. Either install coffee-script or set checkSyntaxOnSave and compileOnSave to false in Preferences > Package Settings > Better CoffeeScript > Settings - User.

Latest Changelog

v0.7.0 01/June/2013

  • merged st3 with master branch
  • now the sublime text 2 support is in st2 branch
  • fixed the @ highlight in language definitions
  • fixed an error you would get when it was looking for project settings when it wasn't a project we were editing

Special Thanks

Thanks to everyone who has contributed to this project. You guys rock!

sublime-better-coffeescript's People

Contributors

alexdowad avatar aponxi avatar arjansingh avatar ashtuchkin avatar btmills avatar cdloh avatar cryrivers avatar danielkcz avatar daquirm avatar donovanhide avatar ehuss avatar exromany avatar fichtefoll avatar johnogle222 avatar lavrton avatar mattschofield avatar mfkp avatar mitranim avatar philippotto avatar ppvg avatar radcool avatar spencermountain avatar stared avatar sunln avatar szhu avatar turtlepie avatar vgel avatar wbond avatar whoaa512 avatar xavura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-better-coffeescript's Issues

Setting the 'compileDir'

Okay, so I've organized my project as follows:

/projectroot/coffee
/projectroot/js

I want the coffee-script in 'coffee' to compile into 'js'. I set my compileDir to '../js/' since that should be the relative path from my coffee-script directory. However, whenever I try to compile, it doesn't save to 'js'. If I just set compileDir to 'true' it'll compile in 'coffee' just fine.

I hope I'm being stupid and just forgetting something. Any thoughts?

Add output panel

Have the results shown too, by a command.

Tip: take --print arg off the coffee command

General Future Features

  • Generate User settings if doesn't exist
  • Make error display on somewhere else when using watchmode

"Indentation: Reindent lines" command never deindent lines

I don't know if I am doing something wrong but I can't get the indentation to work correctly.

When I use the reindent command it never deindent any lines and when I tries to create a list of objects the autoindent always adds a new indentation level.

Does the indentation works for anyone else or am I doing something wrong?

class Demo
    constructor: ->
        alert("Foo")

    example: (data) ->
        alert("Bar")
        for row in array
            alert("Baz")

    @settings = [{test: 'a'},{
        test: 'b'
        }, {
            test: 'c'
            }, {
                test: 'd'
                }]

after Ctrl+Shift+P, "Reindent lines" it looks like this


class Demo
    constructor: ->
        alert("Foo")

        example: (data) ->
            alert("Bar")
            for row in array
                alert("Baz")

                @settings = [{test: 'a'},{
                    test: 'b'
                    }, {
                        test: 'c'
                        }, {
                            test: 'd'
                            }]

I am running a new Linux Mint 14 Nadia and my Sublime Text is version version 2.0.1, build 2217. I installed the package using the Package Control tool.

The installed coffeescript version is 1.6.1

Feature request: better lint support

What do you think about add better lint support?
Tools:

  • coffee -l
  • coffeelint

Also I think it is possible to add jshint support (with back to coffee report).

Unicode Decode Error

Add utf-8 encode/decode to prevent unicode decode errors. these occur when you have a symbol in the coffeescript and try to compile it.

Set input/output directory

It whould be very handy to allow users setting the --output and --compiler options of the coffee-script compiler.

Currently, the compiled js file is generated in the coffee file parent folder.
Having a src/ folder for coffee script and a lib/ folder for compiled js is a common project layout.

Thanks a lot !

Add approximate line number tracking

When working with a large Coffee Script, when you make changes on the bottom of the document, most likely you would want to view that portion of the compiled JS on the output.

Change relativeDir settings

Hi. Would you like to change current model of relativeDir setting to next scheme:

"compileDir": false,                    // if compiled file's path not exist in compilePaths then use this rule
"compilePaths": {
    "/app1/coffee": "/app1/js",         // compile from /app1/coffee to /app1/js
    "/app2/coffee": "../js",            // compile form /app2/coffee to /app2/js
    "/app3/coffee": "/app1/js/app3-js"  // compile from /app/3/coffee to /app1/js/app3-js
}

Selection and auto refresh

by default it compiles either the whole coffee file or the selection. However when you select somestring and hit { to put brackets around it or something; as it puts brackets around it and then selects {somestring}, it compiles that and outputs it.

Maybe disable selection compiling completely? We could use the "compile" command to compile a selection... To do this we must first close #3 so that "compile" command uses the same output view as the watch mode.

empty config

After installing the plugin there is this error at ST2 startup.

Error trying to parse settings: No data in ~/.config/sublime-text-2/Packages/User/CoffeeScript.sublime-settings:1:1

can be solved by puttin [] in CoffeeScript.sublime-settings.

Check the .sublime-project file

Is there any way to create custom preferences inside the .sublime-project settings object?
I would like something like that:

{
    "folders":
    [
        {
            "path": "/Users/etc...",
            "folder_exclude_patterns": [ "node_modules" ]
        }
    ],
    "settings":
    {
        "sublime-better-coffeescript":
        {
            "compileOnSave": false
        }
    }
}

not installing

I am trying to install with package controll but it didn't work. it says it was successful, but it was not

`@` is not highlighted

Attributes and methods of a class are different,
I think it's better to highlight the @ to make it striking.

sublime 3.0 support

Would be nice with support for sublime text 3.0 for the context menus and keyboard shortcuts.

A little lag when writing comments and on save

I experience a little lag when writing comments like # something something

Maybe increase the delay to a second?

Also saving when refreshing or after a refresh (couldn't tell) sent a message that said the plugin may be unresponsive. Check out saving delays (i forgot how I wrote the method), if there isn't one put one.

Output should show the compile errors

ReferenceError: marked is not defined
at Object. (.:4:3)
at Object. (.:78:4)
at Module._compile (module.js:449:26)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:83:25)
at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:177:29)
at Socket.compileStdio (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:215:14)
at Socket.EventEmitter.emit (events.js:93:17)
at Pipe.onread (net.js:417:51)

I wanna see that.

'coffee' is not recognized as an internal or external command,

I know this is not something directly related with this package but anyway I'm new to Sublime Text so any help will be great. Looks like the app can't locate to the correct dir to run the command and it probably should be fixed through the Environment Variables. I just don't know what location should I point to?
Looking for coffee.bat or .exe and can't find one.

Windows 7
Sublime Text 2

env: node: No such file or directory

I am running OSX 10.8.2, Sublime Text 2.0.1, sublime-better-coffeescript v2013.01.26.20.45.16, which I installed with Package Control. I tried the following in a file named script.coffee:

-> "Hello World"

and I obtained:

env: node: No such file or directory

My coffee executable is located at /usr/local/share/npm/bin, the global location for npm when node is installed with brew, so I set "binDir": "/usr/local/share/npm/bin" in the settings.

My node executable is located in /usr/local/bin, but I can't set that, and I think /usr/local/bin is already in my Sublime Text 2 path.

Pressing Option+Shift+C yields Compilation failed in the status bar.

If I run the file with Command+Shift+B, I obtain:

[Errno 2] No such file or directory
[cmd:  [u'coffee', u'/Users/alex/Media/GitHub/sc6-telemetry-code/tel/script.coffee']]
[dir:  /Users/alex/Media/GitHub/sc6-telemetry-code/tel]
[path: /usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

And of course Command+B yields:

[Errno 2] No such file or directory
[cmd:  [u'cake', u'sbuild']]
[dir:  /Users/alex/Media/GitHub/sc6-telemetry-code/tel]
[path: /usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

I don't want to make a Cakefile. I should be able to compile a single source.coffee file into something like source.js.

Simple preview support?

Essentially, I have a build tool (Grunt) that does all my CoffeeScript compilation, so I don't actually need to have Better CoffeeScript doing the file compilation for me, however I would like to be able to "preview" the output in a window for inspection (much like CoffeeCompile does).

Is this kind of workflow available with Better CoffeeScript?

Auto-indent after `else\n`

When pressing enter after while, for and if, the new line is indented one extra step automatically. However, that's not the case with else. I would like the same behavior there! (But not when else is followed by something on the same line, just like it works for if condition then doThat()).

watchOnSave option

Investigate if that is really necessary. I know at some point I have added that for future expansion purposes... I don't think it is useful at all to have it lying there.

Readme enhancements

  • create a to-do list
  • Define the st3 and st2 versions in a better manner so that people know there are two versions
  • Provide links to each other to make it easier to find how to install ST2
  • Add st2 to the package manager list (it should be possible by changing the zip file in package.json)
  • Edit st2 readme
  • close this issue

Test ride

We have just moved to the Sublime Text 3 by default (master) branch. Test things out a bit.

Thank you. :trollface:

@ (this) doesn't get highlighted

You might know that @ (at) is a shorthand for this in CoffeeScript. It doesn't get highlighted in Sublime Text 2.0.2, SBC 0.7.0.

Also, you might want to make sure that @ can be highlighted without anything after it (i.e. highlight both @ and @foo).

ReWrite Wiki/Readme

The wiki pages are a mess, not to mention the outdated Readme... Fix those.

how to support TypeScript

First, thanks for all your hard work on this - both a timesaver and also learning tool.

Second, how hard would it be to port it over to TypeScript? Would you be able to give me some pointers on how to get started?

compileOnSave

I have added ability to automatically compile all .coffee files on save. It would be nice if you could add this. I dont speak python, so I have no idea if this code is right - although it works and helps me a lot!

In package settings:

{ "compileOnSave": true }

In code, prepend to beggining of on_post_save:

def on_post_save ( self, view):
    compileOnSave = settings.get('compileOnSave', False)
    import os.path
    ext = os.path.splitext(view.file_name())[1]
    if compileOnSave and ext=='.coffee':
        args = ['-c', view.file_name()]
        no_wrapper = settings.get('noWrapper', True)
        if no_wrapper:
            args = ['-b'] + args
        result = run("coffee", args=args)
        if result['okay'] is True:
            status = 'Coffee Succeeded '+view.file_name()
        else:
            status = 'Coffee FAILED: '+result['err'].splitlines()[0]
        later = lambda: sublime.status_message(status); print status
        sublime.set_timeout(later, 300)
    # ..rest of the code..

Btw, you may also want to add " +result['err'].splitlines()[0] " to status message after compilation in CompileCommand fails, so that people can instantly see what's wrong.

Automatically 'watching' CoffeeScript files and generating JS files.. when mode is toggled off

Love the plugin! But on one of my machines, I can't seem to get the toggle watch mode to turn off. It keep generating JS files, which end up taking precedence in my rails asset pipeline :/

Here is the log output.

startup, version: 2217 osx x64 channel: stable
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
working dir: /
packages path: /Users/kempair3/Library/Application Support/Sublime Text 2/Packages
settings path: /Users/kempair3/Library/Application Support/Sublime Text 2/Settings
PackageSetup not required
catalogue loaded
found 7 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 4 files for base name Main.sublime-menu
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/BracketHighlighter.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/Elements.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bracket_plugin.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/copy_path.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/delete_word.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/detect_indentation.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/duplicate_line.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/echo.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/exec.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/fold.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/font.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/goto_line.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/indentation.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/kill_ring.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/mark.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/new_templates.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/open_file_settings.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/open_in_browser.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/paragraph.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/save_on_focus_lost.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/scroll.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/side_bar.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/sort.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/swap_line.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/switch_file.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/transform.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/transpose.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Diff/diff.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/HTML/encode_html_entities.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/HTML/html_completions.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/JS2Coffee/JS2Coffee.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/Package Control/Package Control.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/SCSS/scss_completions.py
Reloading plugin /Users/kempair3/Library/Application Support/Sublime Text 2/Packages/sublime-better-coffeescript/CoffeeScript.py
plugin init time: 0.137
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
pre session restore time: 0.273326
using gamma: 1 (err: 0)
wrote startup cache, added files: 7 orphaned files: 0 total files: 106 cache hits: 99
startup time: 0.409295 (package setup was not run)
loaded 1112 snippets
Package Control: No updated packages
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Compiling on save...
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_template_scoped_add_to_collection.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_profile_shared.haml with encoding UTF-8
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_template_scoped_add_to_collection.haml with encoding UTF-8
Compiling on save...
Writing file /Users/kempair3/GitHub/HumanCloud/app/views/dashboard/templates/angular/_hiiro_template_scoped_add_to_collection.haml with encoding UTF-8
Compiling on save...
Writing file /Users/kempair3/GitHub/HumanCloud/app/assets/javascripts/angular/directives/scoped_add_to_collection.js.coffee with encoding UTF-8
Compiling on save...

Also, a quick image of my other plugins, in case there is some conflict.
scoped_add_to_collection js js HumanCloud

At first, I thought I was leaving the 'watch mode' on. But when I go to 'toggle it', it actually turns it on. Also, and deleted the JS files and then closed sublime and re-opened it, and upon opening the coffee files, the JS files appear again.

I have also confirmed that it's this plugin, because the issue immediately disappears upon uninstallation.

Hope that helps! Keep up the great work.

st3 display javascript

Display javascript in the st3 branch gives you this error in console, dont know what to do about it :/

Thanks for making this project!

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "/Users/andreas/Library/Application Support/Sublime Text 3/Packages/Better CoffeeScript/CoffeeScript.py", line 133, in run
    res = brew(args, Text.get(self.view))
  File "/Users/andreas/Library/Application Support/Sublime Text 3/Packages/Better CoffeeScript/CoffeeScript.py", line 42, in brew
    return run("coffee", args=args, source=source.encode('utf-8'))
  File "/Users/andreas/Library/Application Support/Sublime Text 3/Packages/Better CoffeeScript/CoffeeScript.py", line 31, in run
    proc = Popen(command, env=env, cwd=cwd, stdout=PIPE, stderr=PIPE)
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1344, in _execute_child
  File "X/subprocess.py", line 1344, in <listcomp>
  File "X/os.py", line 800, in fsencode
TypeError: expect bytes or str, not NoneType

Change filenames

Finally branch out from CoffeeScript.

Name files as Better_CoffeeScript

'it' is colored

it-sublime
As on screenshot (itemdblclick), 'it' in the beginning of words is colored differently.

Refreshed onSave after closing tab that shows the compiled javascript

Maybe this is linked to issue #23

After closing the tab that shows the watched, compiled js; we still get "Refreshed" message in the console when we change something then save it.

IIRC this is for refreshing the output if there was a change done. Either we are cluttering the console with false "Refreshed" output, OR we are actually compiling but not displaying anything, thus cluttering the memory.

save js file in current dir with default setting on compile command

Hi. It seems that plugin is not working as it should with default setting. It must generate js file on compile in current dir. Have solution:

replace CoffeeScript.py line 84:

args = ['-c', self.view.file_name()]

with

args = ['-c', os.path.split(self.view.file_name())[1]]

windows 7 x86, [email protected], sublime text 2.01.2217, sublime-better-coffeescript version 0.6.31 (2013-01-26)

Need a way of telling if output is open or closed

The option for compile_output_on_save works for now, but I want it to be smarter. I want it to update the panel when the panel is seen, if it's hidden it shouldn't spend any precious cpu to update it.

C/C++ Goto Symbol broken by this package

This package nearly completely breaks goto symbol for C/C++. It causes sublime to use the entire function definition, rather than just the function name. This issue occurs in both Sublime text 2 & 3, and I have verified that it goes away as soon as this package is removed, and comes back when it is reinstalled.

Behavior with this package:
Screen Shot 2013-03-22 at 10 44 58 PM

Behavior without this package:
Screen Shot 2013-03-22 at 10 45 39 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.