Giter VIP home page Giter VIP logo

coffeescript-eclipse's Introduction

New home!

I am happy to announce that this project is becoming a part of something bigger and has a new home at https://github.com/Nodeclipse/coffeescript-eclipse.

Intro

This is a project to provide an Eclipse plugin for CoffeeScript, using Xtext. Development uses Xtext 2.1. It works as a regular Eclipse plugin (see Installation for details). Highlights include

  • syntax highlighting
  • variable autocompletion in the current namespace
  • autoindent

Status

It's aimed at being mostly compatible with the original CoffeeScript project. There are some extra features and some missing, but you probably (and hopefully) won't notice the difference in everyday use.

Extra features

CoffeeScript is a dyanmic language, the parser doesn't check the types or even the existence of variables, such mismatches are detected at runtime. This plugin is based on Xtext which is geared to static languages, providing some useful tools for dealing with these issues. Doing proper type inference for such a flexible language would be difficult, but there are some cases where more checking can be done than by the original CoffeeScript parser. Consider this snippet

foo = 1
bar = foo + increment

It is perfectly valid code, the increment variable is undefined, though. This plugin will issue a warning about a reference to an unknown variable. It works within string interpolation, too, so the next snippet will also give a warning

console.log "Incremented by ${ increment }"

Note that the console variable won't cause any warning, it's handled as a built-in variable.

Incompatibilities

The plugin handles properly most language constructs, including all examples in the coffeescript documentation folder. There are two cases it cannot handle, though, post-increment and assignment to a deeply nested property.

# Not working
drinkBeer(glasses++)  

# Workaround
drinkBeer(glasses)
glasses += 1

# Not working
my.secret.money = 1000

# Workaround
tmp = my.secret
tmp.money = 1000

I guess they don't hurt that much... Getting the value of a deeply nested property is OK.

# This is working
borrow(my.secret.money)
borrowed = my.secret.money

Changelog

0.2.2
Embed coffeescript in a DSL (see the `example` directory)
Planned next release
Integrated build: convert coffee code to javascript, and run it

Installation

You will need an Eclipse instance with Xtext plugins. You can either install a complete Indigo distribution with Xtext, or install the required plugins into your existing workspace. See download Xtext 2.1 for details.

The update site is: http://coffeescript-editor.eclipselabs.org.codespot.com/hg/ So in Eclipse, perform these steps

  • Help -> Install New Software...
  • Add..., then use this url as Location
  • Work with..., and choose the location you just added
  • Select Coffeescript editor
  • Next and Finish

You may be given a warning, but that won't affect the plugin.

coffeescript-eclipse's People

Contributors

adamschmideg avatar

Watchers

chaozhang avatar  avatar

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.