erlang / sourcer Goto Github PK
View Code? Open in Web Editor NEWAn Erlang language server, providing IDE services.
License: Apache License 2.0
An Erlang language server, providing IDE services.
License: Apache License 2.0
Elvis is the Erlang style reviewer (https://github.com/inaka/elvis).
Many use elvis to enforce code style (me included). There are rules related to text formatting, such as:
I would like to have sourcer_indent integrated with elvis, i.e. understand formatting specific rules and apply them (e.g. add space after ,).
I wonder what status this project has. Would it make sense to start working on a Theia extension already?
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?
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?
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!
Hello, how can I use sourcer for indent line/file?
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"
}
]
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,[]]}}}}
Could you please provide some tips on how to use sourcer with Vim?
I was looking for an erlang language server and found this project and this other one https://github.com/erlang-ls/erlang_ls
Can you explain the differences?
thx
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.
Elixir is already there but no entry for Erlang:
https://langserver.org/#implementations-server
Adding to the site can be done through:
https://github.com/langserver/langserver.github.io
The same goes for Microsofts own table:
https://microsoft.github.io/language-server-protocol/implementors/servers/
Which can be added to by PR against:
https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_implementors/servers.md
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!
https://microsoft.github.io/language-server-protocol/inspector/ implements a service that allow simpler visualization of log between client and server.
Specification of the format:
https://github.com/Microsoft/language-server-protocol-inspector#log-format
Fixed | {IndentW, IndentWHalves, Fixed}
?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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.