Giter Club home page Giter Club logo

coffeescript-netbeans's Introduction

CoffeeScript support for NetBeans IDE

http://netbeans.org/

FEATURES:

  • Just works!

    • (No need for Node.js)
  • Advanced syntax highlighting

  • Error checking by background compilation

    • (Rhino JavaScript engine is used to compile *.coffee files)
  • Autocompiling to a JavaScript file in the same directory

    • (Test it in a web browser right away)
  • Syntax highlighting and error checking in scripts

    • (HTML and PHP files)
  • Indentation & formatting, code folding

  • Option to use Node.js with coffee command for compiling. Supported platforms: Mac, Linux and new experimental support for Windows.

  • Cakefile project support

VERSION HISTORY:

  • 1.4

    • Internal improvements and bugfixes
  • 1.3

    • CoffeeScript updated to v1.6.3

    • Improved *nix command line support

  • 1.2.1

    • Bugfixes
  • 1.2

    • CoffeeScript updated to v1.4.0

    • New option to set autocompile target folder

    • New option to always use UTF8 encoding for CoffeeScript files

    • NetBeans 7.3 support

  • 1.1.1

    • CoffeeScript updated to v1.3.3
  • 1.1.0

    • CoffeeScript updated to v1.3.1

    • Syntax highlight improvements

  • 1.0.2

    • Bugfixes
  • 1.0.1

    • Bugfixes
  • 1.0.0

    • Node.js compiling experimental support for Windows

    • Cakefile project support

    • Default indentation level 2spaces

  • 0.9.6

    • CoffeeScript updated to v1.2.0
  • 0.9.5

    • Code folding

    • Bugfixes

  • 0.9.4

    • Support for Node.js and coffee command compiling (Mac, Linux only)

    • Bugfixes

  • 0.9.3

    • Bugfixes
  • 0.9.2

    • CoffeeScript updated to v1.1.2

    • Rhino updated to 1.7R3

    • Bugfixes

  • 0.9.1

    • Added the support for indentation & formatting
  • 0.9

    • CoffeeScript updated to v1.1.1

    • Added syntax highlighting and error checking in scripts (HTML, PHP)

INSTRUCTIONS:

Download coffeescript-nb.nbm and add it using NetBeans plugin manager

Plugin requires NetBeans 7.0

SCREENSHOT:

screenshot2


screenshot

LICENSE:

Apache License, Version 2.0

COPYRIGHT:

2011-2013 Denis Stepanov

coffeescript-netbeans's People

Contributors

atmattpatt avatar bartsidee avatar dstepanov avatar scippio 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coffeescript-netbeans's Issues

go to declaration - feature

Thanks for the great plugin!

I as wondering if it would be possible to add a "go to declaration" extension to the right click->navigation menu (just like with javascript). It is very handy feature to browse browse the code.

Thanks!

CoffeeScriptHTMLParserTask: Missing READ-LOCK when accessing TokenHierarchy

When editing HTML files in my NetBeans HTML5 projects, then I often see this exception in the IDE Log:

INFO [org.netbeans.spi.lexer.MutableTextInput]: !!WARNING!! Missing READ-LOCK when accessing TokenHierarchy: input-source:org.netbeans.modules.editor.NbEditorDocument@4e32085c, mimeType='text/html', kitClass=null, length=247, version=1, file=org.netbeans.modules.html.HtmlDataObject@f194afb[Q:\dev\projects\trash\editorconfig-test-project-2\index.html@a2dea57f:40ebf435]
java.lang.Exception
 at org.netbeans.lib.lexer.TokenHierarchyOperation.ensureReadLocked(TokenHierarchyOperation.java:406)
 at org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequence(TokenHierarchyOperation.java:431)
 at org.netbeans.api.lexer.TokenHierarchy.tokenSequence(TokenHierarchy.java:201)
 at coffeescript.nb.CoffeeScriptHTMLParserTask.run(CoffeeScriptHTMLParserTask.java:42)
 at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:573)
 at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:744)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
 at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

Are you handling file locks when writing / reading files?

Here is an example how file locks should / can be handled:

  DataObject dataObject = ...;
  FileObject fo = dataObject.getPrimaryFile();

  FileLock lock = FileLock.NONE;

  try {
    if (!fo.isLocked()) {
      BufferedOutputStream os = new BufferedOutputStream(fo.getOutputStream(lock));
      os.write("Hello World".getBytes("ASCII"));
      os.flush();
      os.close();
    }
  } catch (IOException ex) {
    Exceptions.printStackTrace(ex);
    return false;
  } finally {
    lock.releaseLock();
  }

I am using Version 1.4 (1373799590_coffeescript-nb.nbm) and apart from that the plugin is really great!! Thank you for your efforts so far! 👍

Code Folding

Thanks for this great extension!

Would it be possible to include code-folding in a later release?

Compile on *nix system - Login shell

Is there a reason that CoffeeScriptNodeJSCompiler.createValidateProcessBuilderNix() and CoffeeScriptNodeJSCompiler.createCompileProcessBuilderNix() uses Bash as a login shell?

Running as a login shell with source the current user's .bashrc or .bash_profile files, which may cause side effects. Those side effects are then included in the output JavaScript file.

For example, if my .bash_profile contains the following:

echo -n "Load average: " && cat /proc/loadavg

When I go to compile a .coffee file through NetBeans, the resulting JavaScript file uses something like:

Load average: 0.00 0.01 0.05 1/84 16976
// Generated by CoffeeScript 1.6.1
(function() {
    var _this = this;
    // ...

Which of course is not valid JS.

I've been trying to think of a reason for using a login shell but I've come up empty. Can the -l be removed?

Feature Request

alt+shift+f Code formatting would be awesome if possible :)

Indentation & formatting

I'm having bugs when trying to format this code whit ALT+SHIFT+F

express = require("express")
app = module.exports = express.createServer()
app.configure ->
  app.set "views", __dirname + "/views"
  app.set "view engine", "jade"
  app.use express.bodyParser()
  app.use express.methodOverride()
  app.use app.router
  app.use express.static(__dirname + "/public")

app.configure "development", ->
  app.use express.errorHandler(
    dumpExceptions: true
    showStack: true
  )

app.configure "production", ->
  app.use express.errorHandler()

app.get "/", (req, res) ->
  res.render "index", title: "Express"

app.listen 3000
console.log "Express server listening on port %d in %s mode", app.address().port, app.settings.env

Ability to create project with existing sources

There doesn't seem to be a way to create a CoffeeScript project that already has existing source. This is challenging when using Git repos, etc. Could you add the capability to create a NetBeans CoffeeScript project using existing sources?

Thanks,
Dan

speed problem - partial compile

It is taking 45 seconds to compile a 900 line file on a fast desktop. Can this be sped up?

For my uses a partial compile of selected lines would be great. I only use it to check syntax. I do all my compiling remotely on a server where a compile of the same file takes about 2 seconds.

So consider this a feature request for compiling selected lines.

Edit: I should note that I need the partial compile to also see what the compiled JS is. I'm not just using it for syntax checking. Also I just realized it would be nice to compile the entire file to find line numbers when debugging.

Code completion, intelli sense or auto-complete

Hey,

first off, thanks for this nice plugin!
Is there any way to enable code completion for coffee files?
Thought to treat them as javascript files (mime), but that doesn't work.

Thanks,
Ron

File Locking

Hope this is an appropriate post for this site. I posted over at the netbeans site but they suggested I contact the plugin author.

Having a problem on two different Win 7 64 bit computers. Just recently (in the last two weeks) downloaded Netbeans and the coffeescript plugin to both computers. both computers are recent builds (past 2 months) and neither had the JDK or Netbeans loaded before. I'm only using Netbeans with the coffeescript plugin right now (not using Netbeans for any other purpose so not sure if the file locking problem occurs in other contexts).

Problem is that I create a new coffeescript file and compile it. This creates a new javascript file. Subsequent attempts to re-compile the file frequently fail with this message:

org.openide.filesystems.FileAlreadyLockedException: C:\Users\myusername\Documents\NetBeansProjects\HQ 1072 Reservation Calendar\src\end-test.js
at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.registerLock(LockForFile.java:114)
at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:103)
at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:353)
at org.openide.filesystems.FileObject.delete(FileObject.java:363)
at coffeescript.nb.CoffeeScriptAction$CompilerTask.compile(CoffeeScriptAction.java:245)
at coffeescript.nb.CoffeeScriptAction$ConsoleOutputCompileTask.run(CoffeeScriptAction.java:194)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

Attempts to open the file or view file properties fail. After variable time delay the file eventually unlocks, or closing and reopening Netbeans unlocks the file.

Netbeans Information
Product Version: NetBeans IDE 7.1.1 (Build 201203012225)
Java: 1.7.0_03; Java HotSpot(TM) 64-Bit Server VM 22.1-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\oigsdgbrewej.netbeans\7.1.1
Cache directory: C:\Users\oigsdgbrewej.netbeans\7.1.1\var\cache

As I said before it's happening on two different machines:

Windows 7 Enterprise Service Pack 1
Processor: Intel(R) Xeon(TM) CPU X5570 @ 2.93GHz 2.93GHz (2 processors)
Installed memory (RAM): 6.00 GB
System type: 64-bit Operating System

Windows 7 Enterprise Service Pack 1
Processor: Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz 2.20GHz
Installed memory (RAM): 8.00 GB
System type: 64-bit Operating System

[0.9] fail to install on netbeans7.0beta

only beta has ruby support, I have to stay on this version. Could you help to make it work on that? thanks.

error
Some plugins require plugin Swing Layout Extensions integration to be installed.
The plugin Swing Layout Extensions integration is requested in version >= 1.16.1 but only 1.15 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Rhino IDE JavaScript Handler to be installed.
The plugin Rhino IDE JavaScript Handler is requested in version >= 1.112.1 but only 1.111 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Progress API to be installed.
The plugin Progress API is requested in version >= 1.23.1 but only 1.22 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Common Scripting Language API (new) to be installed.
The plugin Common Scripting Language API (new) is requested in version >= 2.14.1.2.1.1.6 but only 2.10.0.2.1.1.5 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin MIME Lookup API to be installed.
The plugin MIME Lookup API is requested in version >= 1.21.1 but only 1.20 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Editor Settings to be installed.
The plugin Editor Settings is requested in version >= 1.35.1 but only 1.34 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin HTML Lexer to be installed.
The plugin HTML Lexer is requested in version >= 1.12.1 but only 1.11 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Lexer to be installed.
The plugin Lexer is requested in version >= 1.38.1.1 but only 1.37.0.1 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Options Dialog and SPI to be installed.
The plugin Options Dialog and SPI is requested in version >= 1.21.1 but only 1.20 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Parsing API to be installed.
The plugin Parsing API is requested in version >= 1.39.1.6 but only 1.36.0.5 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Editor Hints to be installed.
The plugin Editor Hints is requested in version >= 1.17.1.7.8 but only 1.16.0.7.4 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin UI Utilities API to be installed.
The plugin UI Utilities API is requested in version >= 7.30.1 but only 7.29 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Execution API to be installed.
The plugin Execution API is requested in version >= 1.21.1 but only 1.20 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin File System API to be installed.
The plugin File System API is requested in version >= 7.46.1 but only 7.42 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin I/O APIs to be installed.
The plugin I/O APIs is requested in version >= 1.26.1 but only 1.25 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Datasystems API to be installed.
The plugin Datasystems API is requested in version >= 7.20.1 but only 7.19 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Nodes API to be installed.
The plugin Nodes API is requested in version >= 7.20.1 but only 7.18 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Text API to be installed.
The plugin Text API is requested in version >= 6.36.1 but only 6.33 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Utilities API to be installed.
The plugin Utilities API is requested in version >= 8.14.1 but only 8.9 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Lookup API to be installed.
The plugin Lookup API is requested in version >= 8.6.1 but only 8.5 was found. The following plugin is affected:       CoffeeScript Netbeans
Some plugins require plugin Window System API to be installed.
The plugin Window System API is requested in version >= 6.39.1 but only 6.35 was found. The following plugin is affected:       CoffeeScript Netbeans Some plugins not installed to avoid potential installation problems.

Compilation error on a console

I see that the compilation error are insert in the file that compile not in a console windows...
Also i get error like this:
coffee> { parsers: { name: 'parsers', constructor: [Function], max: 1000, list: [] }, STATUS_CODES: { '100': 'Continue', '101': 'Switching Protocols', '102': 'Processing', '200': 'OK', '201': 'Created', '202': 'Accepted', '203': 'Non-Authoritative Information', '204': 'No Content', '205': 'Reset Content', '206': 'Partial Content', '207': 'Multi-Status', '300': 'Multiple Choices', '301': 'Moved Permanently', '302': 'Moved Temporarily', '303': 'See Other', '304': 'Not Modified', '305': 'Use Proxy', '307': 'Temporary Redirect', '400': 'Bad Request', '401': 'Unauthorized', '402': 'Payment Required', '403': 'Forbidden', '404': 'Not Found', '405': 'Method Not Allowed', '406': 'Not Acceptable', '407': 'Proxy Authentication Required', '408': 'Request Time-out', '409': 'Conflict', '410': 'Gone', '411': 'Length Required', '412': 'Precondition Failed', '413': 'Request Entity Too Large', '414': 'Request-URI Too Large', '415': 'Unsupported Media Type', '416': 'Requested Range Not Satisfiable', '417': 'Expectation Failed', '418': 'I\'m a teapot', '422': 'Unprocessable Entity', '423': 'Locked', '424': 'Failed Dependency', '425': 'Unordered Collection', '426': 'Upgrade Required', '428': 'Precondition Required', '429': 'Too Many Requests', '431': 'Request Header Fields Too Large', '500': 'Internal Server Error', '501': 'Not Implemented', '502': 'Bad Gateway', '503': 'Service Unavailable', '504': 'Gateway Time-out', '505': 'HTTP Version Not Supported', '506': 'Variant Also Negotiates', '507': 'Insufficient Storage', '509': 'Bandwidth Limit Exceeded', '510': 'Not Extended', '511': 'Network Authentication Required' }, IncomingMessage: { [Function: IncomingMessage] super_: { [Function: Readable] ReadableState: [Function: ReadableState], super_: [Object], _fromList: [Function: fromList] } }, OutgoingMessage: { [Function: OutgoingMessage] super_: { [Function: Stream] super_: [Object], Readable: [Object], Writable: [Object], Duplex: [Object], Transform: [Object], PassThrough: [Object], Stream: [Circular] } }, ServerResponse: { [Function: ServerResponse] super_: { [Function: OutgoingMessage] super_: [Object] } }, Agent: { [Function: Agent] super_: { [Function: EventEmitter] listenerCount: [Function] }, defaultMaxSockets: 5 }, globalAgent: { domain: null, _events: { free: [Function] }, _maxListeners: 10, options: {}, requests: {}, sockets: {}, maxSockets: 5, createConnection: [Function] }, ClientRequest: { [Function: ClientRequest] super_: { [Function: OutgoingMessage] super_: [Object] } }, request: [Function], get: [Function], Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } }, createServer: [Function], _connectionListener: [Function: connectionListener], Client: [Function: deprecated], createClient: [Function: deprecated] } coffee> coffee> { domain: null, _events: { request: [Function], connection: [Function: connectionListener], clientError: [Function] }, _maxListeners: 10, _connections: 0, connections: [Getter/Setter], _handle: null, _usingSlaves: false, _slaves: [], allowHalfOpen: true, httpAllowHalfOpen: false, timeout: 120000 } coffee> �[0;31mReferenceError: res is not defined�[0m coffee> �[0;31mReferenceError: res is not defined�[0m coffee> Invalid REPL keyword coffee> coffee>

Special Characters - UTF8

When I use special characters in the coffeescript code they are not compiled according to utf8. For example "Ë" compiles to "��".

line breakpoints

I can't add line breakpoints in *.coffeescript files and netbeans debugger doesn't work well

I hope you can fix this

Navigator Panel

First I have to thank you for this great plugin! :)

My suggestion is to use the navigator panel of netbeans. Would be awesome if you could list the classes and their methods.

Error validation stopped working on 7.3

Error validation is not working anymore on netbeans 7.3 (OSX, rhino, plugin 1.4)

There are no warning notification at the line numbers and on compilation I do not see the compile error but an error with the plugin:

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
    at coffeescript.nb.CoffeeScriptRhinoCompiler.compile(CoffeeScriptRhinoCompiler.java:59)
    at coffeescript.nb.CoffeeScriptAction$CompilerTask.compile(CoffeeScriptAction.java:236)
    at coffeescript.nb.CoffeeScriptAction$ConsoleOutputCompileTask.run(CoffeeScriptAction.java:193)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

code completion

Hi.

I'm developing a site using jquery + text/coffeescript. Is there anyway to enable basic tag completion from netbeans like when writing javascript ( auto close bracket, quotes, etc) and jquery autocomplete. It will help me a lot.

Thank you for this great plugin.

Custom Code Folding?

It seems like this project may no longer be actively maintained, however, FWIW this would be a very useful feature to have in the project.

Two Feature Requests

I know both of these are things that netbeans should provide, but I am hoping you could figure out how to get them to work somehow.

  1. I need line numbers in compiled output that displays in the netbeans "Compiling XXX" window . When I get an error in node I would really like to link it to your output but the lack of line numbers makes that impossible. Maybe as an option you could put something like /* 0012 */ at the beginning of every output line.

  2. Provide a shortcut key to compile the current page and produce this window.

Can't insert single quote

There are some instances where I can't insert a single quote in a .coffee file. When pressing the key, it seems that it might be inserted but deleted straight away.

Closing the file in the editor and opening it again fixes the issue for a little while.

I've noticed the problem in NB 7.2 and 7.3 and version 1.2 of the plugin.

NullPointerException at coffeescript.nb.CoffeeScriptHTMLParserTask.run

Hello,

this exception has been reported to NetBeans Bugzilla:

Stacktrace: 
java.lang.NullPointerException
   at coffeescript.nb.CoffeeScriptHTMLParserTask.run(CoffeeScriptHTMLParserTask.java:45)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
   at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
   at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
   at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
   at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)

See https://netbeans.org/bugzilla/show_bug.cgi?id=255166.

Please evaluate the issue.
Thank you very much.

Indentation features

Hi,

is there any plan on improving editor indentation?

The biggest pain point right now is having to manually indent every new line as it starts at 0. Using tab to indent also doesn't recognize the correct indentation level like in other Netbeans file editors.

A really simple solution to start would be to just maintain the indentation level of the previous line.

To make it full-featured, you could also consider the following:

  • smart indentation that auto-indents based on syntax (detects start / end of code blocks etc.)
  • tab options (no. of tabs / use spaces or tabs etc.)
  • using tab, shift-tab to indent
  • auto-format code

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.