Git Product home page Git Product logo

ensime.tmbundle's Introduction

ENSIME TextMate Bundle

See a preview video here

Using it

NOTICE: You need to have an .ensime project file in the root of your project. For more information about this file please read the ENSIME manual or modify the sample one below:

Here's a sample .ensime file:

(:project-package "com.sidewayscoding" 
 :use-sbt t 
 :root-dir "/Users/Mads/dev/projects/functional_dictionary/")

Now open a file file in that project and hit ⌃⇧R and chose "Start ENSIME". This will start the ENSIME backend and the output will be written in a HTML output window. You can safely minimize this window now. Now initialize ENSIME by hitting ⌃⇧R and pick the command "Initialize ENSIME". This will send your project file to ENSIME and it will start analyzing your code. After a few seconds ENSIME is ready to help you out.

  • Refactoring
    • Organize imports (⌃⇧H): This will organize your imports and remove any unused imports
    • Reformat Document (⌃⇧H): This will reformat the current document
    • Rename (⌃⇧H): This will rename the selected text.
  • Other
    • Navigation (⌘⇧C): Works just like Go-to-file expect it knows about the classes/objects/traits/etc. in your project. This will show all of the members in all of the packages in your project. You can navigate the list using the arrow-keys and filter it using the search field at the top. Hitting enter will open the file where the selected item was declared and move the caret to the appropriate line.
    • Inspect (⌃⇧i): This will show a tooltip with the type of the expression under the caret.
    • Type check project(⌃⇧V): This will type check your project. If there are any errors it will display a drop-down list with the errors. If you pick one of the items it will jump to that line in the file with the error.
    • Code completion (⌥+⎋): This will do code-completion or either types or methods depending on when you call it.

Installation

NOTICE: You need to have ENSIME installed. You can download it here. Simply download it and unpack it anywhere you like.

To install the bundle simply run the following in your terminal:

git clone https://github.com/mads379/ensime.tmbundle.git
open ensime.tmbundle

Add the shell variable ENSIME_HOME in TextMate -> Preferences... -> Advanced -> Shell Variables to the root of your ENSIME distribution (This would be the path to the folder you just unpacked). For me this is /Users/Mads/dev/tools/emacs_config/ensime_2.8.1-0.3.8

About

This bundle takes advantage of the ENSIME backend to bring IDE features to TextMate Scala projects.

ensime.tmbundle's People

Contributors

mads-hartmann 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

Watchers

 avatar

ensime.tmbundle's Issues

Cannot Initialize Ensime Properly

Hi,
I am trying to use ensime but i got this error after the inizialize command:

Writing: 000052(:return (:abort 202 "Malformed swank:init-project call: (swank:init-project)") 0)

I tried to remove all the bundles keeping only scala and esime.

You know how to fix this problem ?

Thx

active?

ENSIME itself has been undergoing a rejuvenation recently.

I was just wondering if this project is still actively maintained?

Inspect type oddities

The type inspection doesn't always give the correct type.

There are two issues that i know of:

  • Saving the file isn't enough, I have to tell ENSIME to run a type-check on the file so it can build a new type-tree
  • It seems that the caret position is wrong as it will give the type of an expression at another position (I have no idea why this is)

it must be user error: navigation and organize imports

I can't get much to work. The first two things I tried were:

"Navigation".  Result: /Users/paulp/Library/Application Support/TextMate/Bundles/ensime.tmbundle/Support/ensime.rb:155:in navigate': undefined methodcollect' for nil:NilClass (NoMethodError) from /tmp/temp_textmate.2SmPeG:5

"Organize Imports". Result: It churns for a while, then never removes anything, even imports I add just for the purpose of not being used.

I'm using the 2.8.1 final bundle for ensime and the heads of the scala.tmbundle and ensime.tmbundle repositories. It's connected and they're talking -- the type inspector works, for instance -- so it's not a "is the power on" failure.

Inspect Type with Type args.

n the following example the type displayed is List instead of List[Int]. Ensime gives all the type-arg information so I just need to use it.

val list = 1 :: 2 :: 3 :: 4 :: Nil
list

Deal with abort messages

If something goes wrong Ensime will put the Abort string instead of OK string in the messages. Currently I'm not doing anything to check for this. It would be more stable if I did.

swank:init-project fails if project_config (.ensime) starts with a ;

Handling RPC: (swank:connection-info)
Writing: 000076(:return (:ok (:pid nil :server-implementation (:name "ENSIMEserver") :machine nil :features nil :version "0.0.1")) 0)
)' expected but ' found
Writing: 000019(:reader-error 203 "nil")
Error in socket reader: java.io.EOFException: End of file reached in socket reader

Cannot Start the backend

Hi,
I followed the instructions to get it running but when I run ⌃⇧R and chooise 'Start Ensime' the following gets pasted into my open file window:

/bin/bash: Start: command not found

rename renames the wrong thing (off by 1)

Next I tried out "rename" on a class. It says "Rename AnyExt to what" in the dialogue so I know it knows what I highlighted: but when I kick off the rename, it instead renames the type parameter T on which AnyExt is parameterized (i.e. one identifier to the right.)

On case-sensitive file systems, scalaparser.rb is not found

On a case-sensitive file system, if you start TextMate and then try to start ENSIME server you see:

/Users/richard/Library/Application Support/TextMate/Pristine Copy/Bundles/ENSIME.tmbundle/Support/ensime.rb:15:in require': no such file to load -- /Users/richard/Library/Application Support/TextMate/Pristine Copy/Bundles/ENSIME.tmbundle/Support/scalaparser.rb (LoadError) from /Users/richard/Library/Application Support/TextMate/Pristine Copy/Bundles/ENSIME.tmbundle/Support/ensime.rb:15 from /tmp/temp_textmate.Kb9EHX:8:inrequire' from /tmp/temp_textmate.Kb9EHX:8

The work around is to edit line 15 of /Users/$YOU/Library/Application Support/TextMate/Pristine Copy/Bundles/ENSIME.tmbundle/Support/ensime.rb and change:

require BUNDLE_LIB + "scalaparser.rb"

...to...

require BUNDLE_LIB + "ScalaParser.rb"

(Or I guess rename the scalaparser file)

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.