Code Monkey home page Code Monkey logo

sublime-erlang's Introduction

Better Erlang Support for Sublime Text

Sublime Text comes with basic support for the Erlang programming language, but most of it is just copied from TextMate and suffers from annoying bugs. This repository contains a much-improved Erlang package.

  • Hand-tuned grammar definitions for Erlang, Leex and Yecc
  • Goto Symbol works correctly
  • Improved auto-match
  • Snippets that make your life easier when writing Erlang code

Build Systems

This package comes with a build system definition for rebar. It runs rebar in the project folder containing the current file.

There is also a build system that runs erlc.

Installation

  • clone this repository into the ST Packages folder
  • remove the Erlang folder inside your ST2 Packages folder or (more elegant) disable the Erlang package in your User Settings file.

This package is not yet available through Package Control. I recommend tracking this repository using Package Control's "Add Repository" command.

Contributing

The syntax files (.tmLanguage) are built from JSON sources using a custom build system. If you modify a grammar, please do so in the JSON file and then regenerate the XML. The XML files should be committed alongside your changes to the JSON source.

You are kindly invited to use the included Sublime Text project file.

To build all grammar files from the command line, run:

build/all.py

Pull requests and issues are welcome.

sublime-erlang's People

Contributors

fjl avatar jwheare avatar lepinay avatar nox 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  avatar

sublime-erlang's Issues

Incorrect highlighting for record definitions

Both

-record(myrec, a).

and

-record(
    myrec,
    a
).

are valid Erlang record definitions, but Sublime-Erlang does not highlight the record name correctly in the second example. It seems many syntax definitions for Sublime-Erlang could do with some more white space allowance. In fact, Erlang allows whitespace between almost all tokens in the language.

Code completion doesn't work as intended

Hello,

I'm not sure if I didn't set up the configuration correctly, but for some reason the code completion isn't showing useful results. For example when I type "io:", what appears is a huge list of functions like "appmon", "appmon:a", "appmon:dg", etc. Functions like "io:format" can't be found.

I have Erlang installed and these binaries are also available in PATH: rebar, erl, escript and dialyzer. I'm using Sublime Text 2 on Ubuntu 12.10.

Many thanks,
Derek

semicolons

It would be cool if this package did the right thing when you have a semicolon at the of a line. For instance at the end of a function it would add a new function head similar to emacs.

Still using standard Erlang package when using ctrl+b

I installed Sublime-Erlang from git and disabled Erlang package.
When doing ctrl+b it still use Erlang.sublime-build form standard Erlang package.
If I remove the Erlang package i get error:

Error trying to parse build system: No data in ~/.config/sublime-text-2/Packages/Erlang/Erlang.sublime-build:1:1

Restarting Sublime Text do not solve the issue.

No indentation after ->

First, thanks for fixing up the Erlang plug-in for Sublime, it's much improved. However, I don't get any indentation after I type ->. Looking in the indentation file, I see it there but it doesn't appear to be working. Any thoughts on how to fix it?

Thanks!

Incorrect highlighting when using macros inside fun definitions

This code:

fun ?MODULE:test/2.

doesn't highlight the macro, the function name or the arity correctly. I've just found it and haven't had time to look closer at why it's happening yet. The following also doesn't highlight correctly:

?MY_FUNCTION() ->
    ok.

I suspect it has to do with that macros allowed in the expression where function names are matched and assigned correctly.

Is this project dead?

Please consider adding another maintainer to it. So that they can at least accept pull requests.

Query highlighted incorrectly

The following code has a highlight warning even though it compiles:

query() -> query().

The query keyword has been removed since R16B.

case/of lexing expecting something more?

I have the following in my code and Sublime-Erlang seems to be expecting something different, as it indicates errors throughout the rest of the source file.

    Action = case Event of
        no -> State#state.no;
        yes -> State#state.yes;
        invalid_opt -> fun noop/1
    end,

Commenting that block out "fixes" it, as does replacing the comma with a semicolon. I'm filing this simply to make it known. If I can figure out how SublimeText plugins work, I'll dig into this and see if I can fix it.

consider add "?" in "word_separators" setting option.

 Add "?"  in the word_separators option is very import in my opinion.When we write MACRO in erlang, like ?MAX_NUM etc, but actucally there is only MAX_NUM in tags file. We can't jump to header file by ctags if there is no "?" in word_separators .

Auto completion of module functions

I would like to have auto completion of module function that are exported from a module like when i type list: the I should have all the functions listed for auto completion

editor hang once a while

Hi
I'm using Sublime-Erlang and have editor hangs approximately once a day. Not absolutely sure it is a bug in the code completion mechanism of Sublime-Erlang:

After editing the following code in bold , it just happened again, in the code completion box for the "of" ( see display at time of hang here :
https://www.dropbox.com/s/4ran9cf5uqjtbt0/Sublime-Erlang-Issue.jpg
)

...
authenticate(SeCo, Name, Credentials) ->
LocalTime = calendar:local_time(),
Result=case get_by_name(SeCo, Name) of
#ddAccount{isLocked='true'} -> {error,{"Account is locked. Contact a system administrator", Name}};
#ddAccount{lastFailureTime=LocalTime} -> {error,{"Account is suspended after login failure. Please retry", Name}};
#ddAccount{id=Id, credentials=CredList} ->
case lists:member(Credentials,CredList) o;
end,
case Result of
{error, Details} -> {error, Details};
Id -> Id
end.

authorize(_SeCo, _Permission) -> ok.

authorize_all(_SeCo, _Permissions) -> ok.

authorize_some(_SeCo, _Permissions) -> ok.
...

I'm not loosing much code when it happens but some.
Thanks for any ideas how to overcome these problems?
Thanks a lot

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.