forked from erlang/sourcer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy all code from erlide_kernel and start renaming modules
Now we have a starting point.
- Loading branch information
Showing
97 changed files
with
10,351 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_build | ||
erl_crash.dump | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"version": "0.1.0", | ||
"configurations": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"_build": true | ||
}, | ||
"search.exclude": { | ||
"_build": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Available variables which can be used inside of strings. | ||
// ${workspaceRoot}: the root folder of the team | ||
// ${file}: the current opened file | ||
// ${fileBasename}: the current opened file's basename | ||
// ${fileDirname}: the current opened file's dirname | ||
// ${fileExtname}: the current opened file's extension | ||
// ${cwd}: the current working directory of the spawned process | ||
|
||
// A task runner that calls a custom npm script that compiles the extension. | ||
{ | ||
"version": "0.1.0", | ||
|
||
// we want to run npm | ||
"command": "npm", | ||
|
||
// the command is a shell script | ||
"isShellCommand": true, | ||
|
||
// show the output window only if unrecognized errors occur. | ||
"showOutput": "silent", | ||
|
||
// we run the custom script "compile" as defined in package.json | ||
"args": ["run", "compile", "--loglevel", "silent"], | ||
|
||
// The tsc compiler is started in watching mode | ||
"isBackground": true, | ||
|
||
// use the standard tsc in watch mode problem matcher to find compile problems in the output. | ||
"problemMatcher": "$tsc-watch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.vscode/** | ||
.gitignore | ||
erl_crash.dump | ||
|
||
.settings/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>erlang_ls</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.erlide.core.erlbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.erlide.core.erlnature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
encoding//src/erl_scan_local.erl=UTF-8 | ||
eclipse.preferences.version=1 | ||
encoding/<project>=ISO-8859-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
backend_version=19.0 | ||
eclipse.preferences.version=1 | ||
external_includes= | ||
external_modules= | ||
include_dirs=include; | ||
output_dir=ebin | ||
source_dirs=src; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
builderData=INTERNAL|compile|clean|test| | ||
configType=INTERNAL | ||
eclipse.preferences.version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
erlang_ls | ||
===== | ||
|
||
An OTP application | ||
|
||
Build | ||
----- | ||
|
||
$ rebar3 compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
{deps, [ | ||
|
||
]}. | ||
|
||
{escript_main_app, erlang_ls}. | ||
{escript_comment, "%% v0.2.0\n"}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{application, erlang_ls, | ||
[{description, "An OTP application"}, | ||
{vsn, "0.1.0"}, | ||
{registered, []}, | ||
{mod, { erlang_ls_app, []}}, | ||
{applications, | ||
[kernel, | ||
stdlib | ||
]}, | ||
{env,[]}, | ||
{modules, []}, | ||
|
||
{maintainers, []}, | ||
{licenses, ["Apache 2.0"]}, | ||
{links, []} | ||
]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-module(erlang_ls). | ||
|
||
-export([main/1]). | ||
|
||
-define(DEFAULT_PORT, 9000). | ||
|
||
main(Args) -> | ||
case getopt:parse(cli_options(), Args) of | ||
{ok, {Opts, _Other}} -> | ||
Port = proplists:get_value(port, Opts, ?DEFAULT_PORT), | ||
|
||
ok = application:load(lsp_server), | ||
ok = application:set_env(lsp_server, port, Port), | ||
|
||
case application:ensure_all_started(lsp_server, permanent) of | ||
{ok, _R} -> | ||
receive stop -> ok end, | ||
ok; | ||
_Err -> | ||
io:format("Startup error: ~p~n", [_Err]), | ||
ok | ||
end; | ||
_Err -> | ||
io:format("Error: ~p~n", [_Err]), | ||
getopt:usage(cli_options(), "lsp_server") | ||
end, | ||
ok. | ||
|
||
cli_options() -> | ||
[ | ||
{port, $p, "port", integer, "LSP server port"}, | ||
{verbose, $v, "verbose", integer, "Verbosity level"} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
%%%------------------------------------------------------------------- | ||
%% @doc erlang_ls public API | ||
%% @end | ||
%%%------------------------------------------------------------------- | ||
|
||
-module(erlang_ls_app). | ||
|
||
-behaviour(application). | ||
|
||
%% Application callbacks | ||
-export([start/2, stop/1]). | ||
|
||
%%==================================================================== | ||
%% API | ||
%%==================================================================== | ||
|
||
start(_StartType, _StartArgs) -> | ||
erlang_ls_sup:start_link(). | ||
|
||
%%-------------------------------------------------------------------- | ||
stop(_State) -> | ||
ok. | ||
|
||
%%==================================================================== | ||
%% Internal functions | ||
%%==================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
%%%------------------------------------------------------------------- | ||
%% @doc erlang_ls top level supervisor. | ||
%% @end | ||
%%%------------------------------------------------------------------- | ||
|
||
-module(erlang_ls_sup). | ||
|
||
-behaviour(supervisor). | ||
|
||
%% API | ||
-export([start_link/0]). | ||
|
||
%% Supervisor callbacks | ||
-export([init/1]). | ||
|
||
-define(SERVER, ?MODULE). | ||
|
||
%%==================================================================== | ||
%% API functions | ||
%%==================================================================== | ||
|
||
start_link() -> | ||
supervisor:start_link({local, ?SERVER}, ?MODULE, []). | ||
|
||
%%==================================================================== | ||
%% Supervisor callbacks | ||
%%==================================================================== | ||
|
||
%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} | ||
init([]) -> | ||
{ok, { {one_for_all, 0, 1}, []} }. | ||
|
||
%%==================================================================== | ||
%% Internal functions | ||
%%==================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>lsp_server</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.erlide.core.erlbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.erlide.core.erlnature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
encoding//src/erl_scan_local.erl=UTF-8 | ||
eclipse.preferences.version=1 | ||
encoding/<project>=ISO-8859-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
backend_version=19.0 | ||
eclipse.preferences.version=1 | ||
external_includes= | ||
external_modules= | ||
include_dirs=include; | ||
output_dir=ebin | ||
source_dirs=src; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
builderData=INTERNAL|compile|clean|test| | ||
configType=INTERNAL | ||
eclipse.preferences.version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lsp_server | ||
===== | ||
|
||
An OTP application | ||
|
||
Build | ||
----- | ||
|
||
$ rebar3 compile |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{require_otp_vsn, "20.*"}. | ||
|
||
{plugins, [ | ||
rebar_covertool, | ||
rebar3_hex | ||
]}. | ||
|
||
{deps, [ | ||
{jsx, "2.8.2"}, | ||
{getopt, "0.8.2"} | ||
]}. | ||
|
||
{erl_opts, [ | ||
warn_deprecated_function, | ||
warn_export_all, | ||
warn_export_vars, | ||
warn_obsolete_guard, | ||
warn_shadow_vars, | ||
warn_unused_function, | ||
warn_unused_import, | ||
warn_unused_record, | ||
warn_unused_vars, | ||
|
||
nowarnings_as_errors | ||
%warnings_as_errors | ||
]}. | ||
{erl_first_files, [ | ||
]}. | ||
|
||
{edoc_opts,[{todo,true}]}. | ||
|
||
{eunit_opts, [ | ||
verbose, | ||
%nowarn_missing_spec, | ||
nowarnings_as_errors, | ||
{report,{eunit_surefire,[{dir,"."}]}} | ||
]}. | ||
{eunit_compile_opts, [ | ||
nowarn_missing_spec | ||
]}. | ||
|
||
{xref_warnings, true}. | ||
{xref_checks, [ | ||
undefined_function_calls, | ||
undefined_functions, | ||
locals_not_used, | ||
% exports_not_used, | ||
deprecated_function_calls, | ||
deprecated_functions | ||
]}. | ||
|
||
{dialyzer, [ | ||
%% Store PLT locally inside the project in .rebar (Default) | ||
%% {plt_location, local}, | ||
%% Store PLT in custom directory | ||
%% {plt_location, "custom_dir"}, | ||
{warnings, [unmatched_returns, error_handling, unknown]}, | ||
{base_plt_apps, [erts, kernel, stdlib, syntax_tools, tools]} | ||
]}. | ||
|
||
{cover_export_enabled, true}. | ||
{cover_enabled, true}. | ||
{cover_print_enable, true}. | ||
|
||
{covertool_eunit, {"_build/test/cover/eunit.coverdata", "eunit.coverage.xml"}}. | ||
{covertool_prefix_len, 0}. | ||
|
||
{xref_checks,[ | ||
undefined_function_calls, | ||
undefined_functions, | ||
locals_not_used, | ||
%exports_not_used, | ||
deprecated_function_calls, | ||
deprecated_functions | ||
]}. | ||
|
Oops, something went wrong.