Giter VIP home page Giter VIP logo

sourcer's People

Contributors

deadtrickster avatar dgud avatar hommeabeil avatar klajo avatar subsetpark avatar vladdu 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

sourcer's Issues

[Question] Status?

I wonder what status this project has. Would it make sense to start working on a Theia extension already?

STDIO input?

The kakoune lsp editor integration https://github.com/ul/kak-lsp expects to be able to send input to its servers via standard io. Do you have any intention of exposing that as an option as well as TCP?

indent: handle multiline strings and atoms

currently each line is indented separately, and if it is part of a multiline string, that is not detected and usually all indentation disappears.

we need to keep track of which lines are affected and not change indentation for them.

Investigate: what if there are more expressions after the end of a multiline string? are they indented properly?

How to contribute?

I'm exited about this project and want to know how to help.
What things are you working on at the moment?
What's needed until this can recommend using sources in day to day work?

It would be really nice to have a list of issues for items you want help with (create issues and tag them)!
Add a milestone for issues needed to be resolved before general availability!

Indentation

Hello, how can I use sourcer for indent line/file?

lsp-format insert unknown character

I use sourcer with emacs lsp-mode and replacing elixir_ls that come from elixir-ls organization with sourcer. After I write this source:

% hello_module.erl
-module(hello_module).
-export([hello/0]).

hello() ->
    X = "hello",
    io:format("~s~n", [X]).

And then I invoke lsp-format-buffer to format source. Sourcer edit my source with extra character:

�����������������������������������������% hello_module.erl
-module(hello_module).
-export([hello/0]).

hello() ->
    io:format("~s~n", ["Hello, World"]).

The trace log is here:

[Trace - 11:37:53 PM] Sending request 'textDocument/formatting - (235)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/wingyplus/workspace/erlang-playground/hello_module.erl"
  },
  "options": {
    "tabSize": 8,
    "insertSpaces": false
  }
}


[Trace - 11:37:53 PM] Received response 'textDocument/formatting - (235)' in 20ms.
Result: [
  {
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 9991,
        "character": 0
      }
    },
    "newText": "\u0006\u0006\u0006\u0006\u0006\u0006\u0006\u0006\u0006\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000% hello_module.erl\n-module(hello_module).\n-export([hello/0]).\n\nhello() ->\n    io:format(\"~s~n\", [\"Hello, World\"]).\n"
  }
]

How to start the server?

Hello, I'm looking into sourcer as a replacement for now-unmantained EDTS, but can not even start it :)

Could you tell me how it's supposed to be started/used?

2> application:ensure_all_started(lsp_server). 

=INFO REPORT==== 2-Apr-2019::16:33:38 ===
    application: lsp_server
    exited: {{error,
                 {{badmatch,undefined},
                  [{lsp_server_sup,children,0,
                       [{file,
                            "/home/maxim/projects/sourcer/apps/lsp_server/src/lsp_server_sup.erl"},
                        {line,19}]},
                   {lsp_server_sup,init,1,
                       [{file,
                            "/home/maxim/projects/sourcer/apps/lsp_server/src/lsp_server_sup.erl"},
                        {line,14}]},
                   {supervisor,init,1,[{file,"supervisor.erl"},{line,294}]},
                   {gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},
                   {gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},
                   {proc_lib,init_p_do_apply,3,
                       [{file,"proc_lib.erl"},{line,247}]}]}},
             {lsp_server_app,start,[normal,[]]}}
    type: temporary

=INFO REPORT==== 2-Apr-2019::16:33:38 ===
    application: getopt
    exited: stopped
    type: temporary

=INFO REPORT==== 2-Apr-2019::16:33:38 ===
    application: jsx
    exited: stopped
    type: temporary
{error,{lsp_server,{{error,{{badmatch,undefined},
                            [{lsp_server_sup,children,0,
                                             [{file,"/home/maxim/projects/sourcer/apps/lsp_server/src/lsp_server_sup.erl"},
                                              {line,19}]},
                             {lsp_server_sup,init,1,
                                             [{file,"/home/maxim/projects/sourcer/apps/lsp_server/src/lsp_server_sup.erl"},
                                              {line,14}]},
                             {supervisor,init,1,[{file,"supervisor.erl"},{line,294}]},
                             {gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},
                             {gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},
                             {proc_lib,init_p_do_apply,3,
                                       [{file,"proc_lib.erl"},{line,247}]}]}},
                    {lsp_server_app,start,[normal,[]]}}}}

run dialyzer in the build

  • create a Makefile that calls dialyzer
  • change build commands for travis
  • create default PLTs on erlide.org and wget them when building, to shorten build times

LSP: accept extraneous parameters

Some clients (for example lsp4j) try to be backwards compatible with regard to LSP versions and send parameters that contain extra values. We need to be able to ignore those.

Erlang LSP errs without message.

I am connecting with sourcer via --transport stdio, from Microsoft's Monaco editor. After the client sends the initialize request, the language server never sends a response, causing the client to fail.

Here are the args passed to the language server when starting up:
--transport stdio -v

The request sent from the client looks like:

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"rootPath":null,"rootUri":"file:///home","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true}},"textDocument":{"synchronization":{"dynamicRegistration":true},"completion":{"completionItem":{"snippetSupport":true},"dynamicRegistration":true},"hover":{"dynamicRegistration":true},"signatureHelp":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"definition":{"dynamicRegistration":true},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true}}},"trace":"off"}}

And the error I am seeing from the language server's output when it processes the request is:
Erlang Server: Logger - error:
And that's all it prints -- not telling what the actually error is.

Could you kindly let me know how I can print the actual error message, so that I can dig further?

Or maybe let me know why it fails, if it's possible to tell from the above info.

Thanks!

indent: better preferences

  • add API
  • use proplists
  • express (some) values based on indentW; how? maybe Fixed | {IndentW, IndentWHalves, Fixed}?

Using "sourcer" as a command line application?

Hello there,

Sorry if my question doesn't makes sense, I'm new to Erlang and even newer to rebar3.

I've been looking for a "code formatter", I've tried rebar3_format and rebar3_steamroller, but seems like they need to be called as "rebar3 <plugin_name>" from the project root, and they format the entire project.
If I enter in the apps/src/ directory and try to call it in there it fails, because it doesn't find the command.

In README, sourcer says "The actual work is done by this application. It is meant to be LSP-agnostic so that it can be used in other contexts and tools.".

Does being used in other context and tools means that it can be somehow compiled and used without calling "rebar3"?

What I'm looking for is to be able to call sourcer file_name.erl in command line and it returns an indented file as output.
As I've said, I'm new to rebar3, I don't know if it can be compiled and called in command line like this.

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.