Skip to content

Commit dfa0667

Browse files
committed
Add 'analysis/' from commit 'e414cb11908aea619469b619c0f32c4f79dab09a'
git-subtree-dir: analysis git-subtree-mainline: 18c3731 git-subtree-split: e414cb1
2 parents 18c3731 + e414cb1 commit dfa0667

File tree

125 files changed

+28202
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+28202
-0
lines changed

analysis/.depend

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
src/BuildSystem.cmx : src/ModuleResolution.cmx src/Log.cmx src/Infix.cmx \
2+
src/Files.cmx
3+
src/EditorSupportCommands.cmx : src/Utils.cmx src/Uri2.cmx src/TopTypes.cmx \
4+
src/State.cmx src/SharedTypes.cmx src/Shared.cmx src/References.cmx \
5+
src/Protocol.cmx src/NewCompletions.cmx src/Hover.cmx src/Files.cmx
6+
src/Files.cmx :
7+
src/FindFiles.cmx : src/Utils.cmx src/SharedTypes.cmx \
8+
src/ModuleResolution.cmx src/Log.cmx src/vendor/Json.cmx src/Infix.cmx \
9+
src/Files.cmx src/BuildSystem.cmx
10+
src/Hover.cmx : src/Utils.cmx src/SharedTypes.cmx src/Shared.cmx \
11+
src/References.cmx src/Query.cmx
12+
src/Infix.cmx : src/Log.cmx src/Files.cmx
13+
src/Log.cmx :
14+
src/MarkdownOfOCamldoc.cmx : src/vendor/odoc_parser/root.cmx \
15+
src/vendor/odoc_parser/paths.cmx src/vendor/odoc_parser/parser_.cmx \
16+
src/vendor/omd/omd.cmx src/Log.cmx src/vendor/odoc_parser/location_.cmx \
17+
src/vendor/odoc_parser/error.cmx src/vendor/odoc_parser/comment.cmx
18+
src/ModuleResolution.cmx : src/Infix.cmx src/Files.cmx
19+
src/NewCompletions.cmx : src/Utils.cmx src/Uri2.cmx src/TopTypes.cmx \
20+
src/State.cmx src/SharedTypes.cmx src/Shared.cmx src/Query.cmx \
21+
src/Protocol.cmx src/PartialParser.cmx src/Log.cmx src/Infix.cmx \
22+
src/Hover.cmx
23+
src/Packages.cmx : src/Uri2.cmx src/TopTypes.cmx src/SharedTypes.cmx \
24+
src/Log.cmx src/vendor/Json.cmx src/Infix.cmx src/FindFiles.cmx \
25+
src/Files.cmx src/BuildSystem.cmx
26+
src/PartialParser.cmx : src/SharedTypes.cmx src/Infix.cmx
27+
src/PrepareUtils.cmx :
28+
src/PrintType.cmx : src/vendor/res_outcome_printer/res_outcome_printer.cmx \
29+
src/vendor/res_outcome_printer/res_doc.cmx
30+
src/ProcessAttributes.cmx : src/SharedTypes.cmx src/PrepareUtils.cmx
31+
src/ProcessCmt.cmx : src/Utils.cmx src/SharedTypes.cmx \
32+
src/ProcessAttributes.cmx src/Infix.cmx
33+
src/ProcessExtra.cmx : src/Utils.cmx src/SharedTypes.cmx src/Shared.cmx \
34+
src/Query.cmx src/ProcessCmt.cmx src/ProcessAttributes.cmx src/Log.cmx
35+
src/Process_406.cmx : src/SharedTypes.cmx src/Shared.cmx \
36+
src/ProcessExtra.cmx src/ProcessCmt.cmx src/PrintType.cmx \
37+
src/Process_406.cmi
38+
src/Process_406.cmi : src/Uri2.cmx src/SharedTypes.cmx
39+
src/Protocol.cmx :
40+
src/Query.cmx : src/SharedTypes.cmx src/Log.cmx src/Infix.cmx
41+
src/References.cmx : src/Utils.cmx src/Uri2.cmx src/SharedTypes.cmx \
42+
src/Query.cmx src/Log.cmx src/Infix.cmx
43+
src/RescriptEditorSupport.cmx : src/EditorSupportCommands.cmx
44+
src/Shared.cmx : src/PrintType.cmx src/Files.cmx
45+
src/SharedTypes.cmx : src/Utils.cmx src/Uri2.cmx src/Shared.cmx \
46+
src/Infix.cmx
47+
src/State.cmx : src/Utils.cmx src/Uri2.cmx src/TopTypes.cmx \
48+
src/SharedTypes.cmx src/Process_406.cmx src/Packages.cmx \
49+
src/vendor/omd/omd.cmx src/MarkdownOfOCamldoc.cmx src/Log.cmx \
50+
src/Infix.cmx src/FindFiles.cmx src/Files.cmx src/BuildSystem.cmx
51+
src/TopTypes.cmx : src/Uri2.cmx src/SharedTypes.cmx
52+
src/Uri2.cmx :
53+
src/Utils.cmx : src/Protocol.cmx
54+
src/vendor/Json.cmx :
55+
src/vendor/odoc_parser/ast.cmx : src/vendor/odoc_parser/paths.cmx \
56+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/comment.cmx
57+
src/vendor/odoc_parser/comment.cmx : src/vendor/odoc_parser/paths.cmx \
58+
src/vendor/odoc_parser/location_.cmx
59+
src/vendor/odoc_parser/error.cmx : src/vendor/odoc_parser/location_.cmx
60+
src/vendor/odoc_parser/helpers.cmx : src/vendor/odoc_parser/paths.cmx
61+
src/vendor/odoc_parser/lang.cmx : src/vendor/odoc_parser/root.cmx \
62+
src/vendor/odoc_parser/paths.cmx src/vendor/odoc_parser/comment.cmx
63+
src/vendor/odoc_parser/location_.cmx :
64+
src/vendor/odoc_parser/odoc_lexer.cmx : src/vendor/odoc_parser/token.cmx \
65+
src/vendor/odoc_parser/parse_error.cmx \
66+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/error.cmx \
67+
src/vendor/odoc_parser/odoc_lexer.cmi
68+
src/vendor/odoc_parser/odoc_lexer.cmi : src/vendor/odoc_parser/token.cmx \
69+
src/vendor/odoc_parser/location_.cmx
70+
src/vendor/odoc_parser/parse_error.cmx : \
71+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/error.cmx
72+
src/vendor/odoc_parser/parser_.cmx : src/vendor/odoc_parser/syntax.cmx \
73+
src/vendor/odoc_parser/semantics.cmx \
74+
src/vendor/odoc_parser/odoc_lexer.cmx \
75+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/error.cmx \
76+
src/vendor/odoc_parser/ast.cmx src/vendor/odoc_parser/parser_.cmi
77+
src/vendor/odoc_parser/parser_.cmi : src/vendor/odoc_parser/paths.cmi \
78+
src/vendor/odoc_parser/error.cmx src/vendor/odoc_parser/comment.cmx \
79+
src/vendor/odoc_parser/ast.cmx
80+
src/vendor/odoc_parser/paths.cmx : src/vendor/odoc_parser/root.cmx \
81+
src/vendor/odoc_parser/paths_types.cmx src/vendor/odoc_parser/paths.cmi
82+
src/vendor/odoc_parser/paths.cmi : src/vendor/odoc_parser/root.cmi \
83+
src/vendor/odoc_parser/paths_types.cmx
84+
src/vendor/odoc_parser/paths_types.cmx : src/vendor/odoc_parser/root.cmx
85+
src/vendor/odoc_parser/root.cmx : src/vendor/odoc_parser/root.cmi
86+
src/vendor/odoc_parser/root.cmi :
87+
src/vendor/odoc_parser/semantics.cmx : src/vendor/odoc_parser/token.cmx \
88+
src/vendor/odoc_parser/paths.cmx src/vendor/odoc_parser/parse_error.cmx \
89+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/error.cmx \
90+
src/vendor/odoc_parser/comment.cmx src/vendor/odoc_parser/ast.cmx \
91+
src/vendor/odoc_parser/semantics.cmi
92+
src/vendor/odoc_parser/semantics.cmi : src/vendor/odoc_parser/paths.cmi \
93+
src/vendor/odoc_parser/error.cmx src/vendor/odoc_parser/comment.cmx \
94+
src/vendor/odoc_parser/ast.cmx
95+
src/vendor/odoc_parser/syntax.cmx : src/vendor/odoc_parser/token.cmx \
96+
src/vendor/odoc_parser/parse_error.cmx \
97+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/helpers.cmx \
98+
src/vendor/odoc_parser/error.cmx src/vendor/odoc_parser/comment.cmx \
99+
src/vendor/odoc_parser/ast.cmx src/vendor/odoc_parser/syntax.cmi
100+
src/vendor/odoc_parser/syntax.cmi : src/vendor/odoc_parser/token.cmx \
101+
src/vendor/odoc_parser/location_.cmx src/vendor/odoc_parser/error.cmx \
102+
src/vendor/odoc_parser/ast.cmx
103+
src/vendor/odoc_parser/token.cmx : src/vendor/odoc_parser/comment.cmx
104+
src/vendor/omd/html_characters.cmx :
105+
src/vendor/omd/omd.cmx : src/vendor/omd/omd_representation.cmx \
106+
src/vendor/omd/omd_parser.cmx src/vendor/omd/omd_lexer.cmx \
107+
src/vendor/omd/omd_backend.cmx src/vendor/omd/omd.cmi
108+
src/vendor/omd/omd.cmi : src/vendor/omd/omd_representation.cmi
109+
src/vendor/omd/omd_backend.cmx : src/vendor/omd/omd_utils.cmx \
110+
src/vendor/omd/omd_representation.cmx src/vendor/omd/omd_backend.cmi
111+
src/vendor/omd/omd_backend.cmi : src/vendor/omd/omd_utils.cmi \
112+
src/vendor/omd/omd_representation.cmi
113+
src/vendor/omd/omd_html.cmx :
114+
src/vendor/omd/omd_lexer.cmx : src/vendor/omd/omd_utils.cmx \
115+
src/vendor/omd/omd_representation.cmx src/vendor/omd/omd_lexer.cmi
116+
src/vendor/omd/omd_lexer.cmi : src/vendor/omd/omd_representation.cmi
117+
src/vendor/omd/omd_parser.cmx : src/vendor/omd/omd_utils.cmx \
118+
src/vendor/omd/omd_representation.cmx src/vendor/omd/omd_lexer.cmx \
119+
src/vendor/omd/omd_backend.cmx src/vendor/omd/omd_parser.cmi
120+
src/vendor/omd/omd_parser.cmi : src/vendor/omd/omd_utils.cmi \
121+
src/vendor/omd/omd_representation.cmi
122+
src/vendor/omd/omd_representation.cmx : src/vendor/omd/omd_utils.cmx \
123+
src/vendor/omd/omd_representation.cmi
124+
src/vendor/omd/omd_representation.cmi :
125+
src/vendor/omd/omd_types.cmx :
126+
src/vendor/omd/omd_utils.cmx : src/vendor/omd/omd_utils.cmi
127+
src/vendor/omd/omd_utils.cmi :
128+
src/vendor/omd/omd_xtxt.cmx : src/vendor/omd/omd_xtxt.cmi
129+
src/vendor/omd/omd_xtxt.cmi :
130+
src/vendor/res_outcome_printer/res_comment.cmx : \
131+
src/vendor/res_outcome_printer/res_comment.cmi
132+
src/vendor/res_outcome_printer/res_comment.cmi :
133+
src/vendor/res_outcome_printer/res_doc.cmx : \
134+
src/vendor/res_outcome_printer/res_minibuffer.cmx \
135+
src/vendor/res_outcome_printer/res_doc.cmi
136+
src/vendor/res_outcome_printer/res_doc.cmi :
137+
src/vendor/res_outcome_printer/res_minibuffer.cmx : \
138+
src/vendor/res_outcome_printer/res_minibuffer.cmi
139+
src/vendor/res_outcome_printer/res_minibuffer.cmi :
140+
src/vendor/res_outcome_printer/res_outcome_printer.cmx : \
141+
src/vendor/res_outcome_printer/res_token.cmx \
142+
src/vendor/res_outcome_printer/res_doc.cmx
143+
src/vendor/res_outcome_printer/res_token.cmx : \
144+
src/vendor/res_outcome_printer/res_comment.cmx

analysis/.github/workflows/ci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [macos-latest, ubuntu-latest, windows-latest]
15+
16+
runs-on: ${{matrix.os}}
17+
18+
steps:
19+
- uses: actions/checkout@v2.3.4
20+
21+
- name: Cache OCaml's opam
22+
uses: actions/cache@v2.1.5
23+
with:
24+
path: ~/.opam
25+
key: ${{matrix.os}}-latest-ocaml-4.06.1
26+
27+
- name: Use OCaml
28+
uses: avsm/setup-ocaml@v1.1.10
29+
with:
30+
ocaml-version: 4.06.1
31+
32+
- name: Use Node.js
33+
uses: actions/setup-node@v2.1.5
34+
with:
35+
node-version: 14.4.0
36+
37+
- run: npm ci
38+
39+
# These 2 runs (or just the second?) are for when you have opam dependencies. We don't.
40+
# Don't add deps. But if you ever do, un-comment these
41+
# - run: opam pin add rescript-editor-support.dev . --no-action
42+
# - run: opam install . --deps-only --with-doc --with-test
43+
44+
- run: eval $(opam env) && make test
45+
if: matrix.os != 'windows-latest'
46+
# CI windows running the binary somehow stucks. Not sure why. Disable for now.
47+
- run: "& $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- make"
48+
if: matrix.os == 'windows-latest'
49+
50+
# Also avoids artifacts upload permission loss:
51+
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss
52+
- name: Compress files
53+
run: tar -cvf rescript-editor-support.tar -C lib rescript-editor-support.exe
54+
55+
- uses: actions/upload-artifact@v2
56+
with:
57+
name: ${{matrix.os}}-rescript-editor-support.exe
58+
path: rescript-editor-support.tar

analysis/.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.DS_Store
2+
.merlin
3+
!/.merlin
4+
npm-debug.log
5+
*.install
6+
examples/*/lib
7+
tests/lib
8+
node_modules
9+
*.cmi
10+
*.cmt
11+
*.cmti
12+
*.cmx
13+
*.o
14+
lib/*
15+
!lib/README.md

analysis/.merlin

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
B src
2+
B src/vendor
3+
B src/vendor/odoc_parser
4+
B src/vendor/omd
5+
B src/vendor/res_outcome_printer
6+
B ../../.opam/4.06.1/lib/ocaml/compiler-libs/
7+
8+
S src
9+
S src/vendor
10+
S src/vendor/odoc_parser
11+
S src/vendor/omd
12+
S src/vendor/res_outcome_printer
13+
S ../../.opam/4.06.1/lib/ocaml/compiler-libs/
14+
15+
FLG -w +26+27+32+33+39

analysis/.ocamlformat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cases-exp-indent = 2
2+
space-around-arrays = false
3+
space-around-lists = false
4+
space-around-records = false
5+
space-around-variants = false

analysis/.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"editor.formatOnSave": false,
3+
"git.ignoreLimitWarning": true,
4+
"git.enabled": true,
5+
"editor.codeLens": true,
6+
"editor.tabSize": 2,
7+
"workbench.settings.editor": "json",
8+
"ocaml.sandbox": {
9+
"kind": "global"
10+
}
11+
}

analysis/.vscode/tasks.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
]
5+
}

analysis/Changes.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# master
2+
- Fix issue in jump-to-definition on Windows. (See https://github.com/rescript-lang/rescript-vscode/issues/98) where the wrong URI was generated.
3+
- Don't show file path on hover.
4+
- Add autocomplete for props in JSX components.
5+
- Autocomplete: fix issue where `->` autocomplete was overruling `.`. See https://github.com/rescript-lang/rescript-editor-support/issues/99.
6+
- Add pipe autocomplete for builtin list, array, string, option types. And for string and array literals.
7+
- Fix hover on labels in component functions with compiler version 9.1, and labels with type annotation.
8+
9+
## Release 1.0.6 of rescript-vscode
10+
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/03ee0d97b250474028d4fb08eac81ddb21ccb082) is vendored in [rescript-vscode 1.0.6](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.6).
11+
12+
#### New features
13+
- Add support for autocomplete for pipe-first `foo->`: the type of `foo` is used to determine the module to take completions from.
14+
- Add support for autocomplete for decorators such as `@module` and `@val`.
15+
- Add support for autocomplete of labelled arguments `foo(~label... )`.
16+
- Add support for @deprecated attributes in autocomplete.
17+
- Support for upcoming `rescript` npm package for the compiler. Looks for `rescript` in addition to `bs-platform` in `node_modules`.
18+
19+
#### Fixes
20+
21+
- Fix issue for uncurried functions where the internal definition of `Js.Fn.arity` is shown on hover. (See https://github.com/rescript-lang/rescript-editor-support/issues/62).
22+
- Fix type hint when hovering over labeled arguments of components (See https://github.com/rescript-lang/rescript-editor-support/issues/63).
23+
- Fix issue where values declared with type annotation would not show up in autocomplete, and would show no doc comment on hover. (See https://github.com/rescript-lang/rescript-vscode/issues/72).
24+
- Fix hover on definitions inside a react component module, or whenever multiple definitins for the same value exist in the module (See https://github.com/rescript-lang/rescript-editor-support/issues/67).
25+
- Fix autocomplete issue where multiple open's were considered in the wrong priority order (See https://github.com/rescript-lang/rescript-editor-support/issues/72).
26+
- Autocomplete: add support for `open!` in addition to `open`.
27+
28+
## Release 1.0.5 of rescript-vscode
29+
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/6bdd10f6af259edc5f9cbe5b9df06836de3ab865) is vendored in [rescript-vscode 1.0.5](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.5).
30+
31+
- Add support for doc strings when hovering on modules.
32+
- Add support for printing uncurried function types in hover.
33+
- Fix autocomplete issue where `open Foo` would be picked up inside line comments (see https://github.com/rescript-lang/rescript-editor-support/issues/15).
34+
- Don't print parens as in `A()` for 0-ary variants.
35+
- Fix infinite loop in autocomplete that can cause `rescript-editor-support.exe` processes to use up 100% cpu.
36+
- Fix jump to type definition for types defined in an inner module.
37+
38+
## Release 1.0.3 of rescript-vscode
39+
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/214d220d8573f9f0c8d54e623c163e01617bf124) is vendored in [rescript-vscode 1.0.3](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.3).
40+
41+
- Fix type shown when hovering on record fields (see https://github.com/rescript-lang/rescript-vscode/issues/52), and doc comments for records.
42+
- Fix issue where type variables are printed with global renaming when hovering or autocompleting a module (see https://github.com/rescript-lang/rescript-editor-support/issues/38).
43+
- Fix issue where a log file was always created (see https://github.com/rescript-lang/rescript-vscode/issues/47).
44+
- Add support for hover on the id of toplevel module definitions (```module Id = ...```).
45+
46+
## Release 1.0.1 of rescript-vscode
47+
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/232ad609766c415048750c5cc828973a9995f382) is vendored in [rescript-vscode 1.0.1](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.1).
48+
49+
- Support printing inline records.
50+
- Add typedef hover support.
51+
- Always output valid json, even in case of internal error.
52+
- Remove semicolon in module top level preview.
53+
- Support syntax highlight in hover fenced blocks.
54+
- Fix printing of variant arguments.
55+
- Use outcome printer from the syntax to print type declarations.
56+
- Fix issue in command-line parsing on Windows with paths of the form `c:/...:line:column`.
57+
58+
## Release 1.0.0 of rescript-vscode
59+
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/d45f45793a307a3bb87dcac0542fd412669f1b6e) is vendored in [rescript-vscode 1.0.0](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.0).

analysis/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) ReScript
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

analysis/Makefile

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
SHELL = /bin/bash
2+
MAKEFLAGS += --jobs 4
3+
INCLUDES = -I src -I src/vendor/odoc_parser -I src/vendor/omd -I src/vendor/res_outcome_printer -I src/vendor
4+
5+
OCAMLOPT = ocamlopt.opt
6+
OCAMLFLAGS = -g -w +26+27+32+33+39 -bin-annot -I +compiler-libs $(INCLUDES)
7+
OCAMLDEP = ocamldep.opt
8+
9+
%.cmi : %.mli
10+
@echo Building $@
11+
@$(OCAMLOPT) $(OCAMLFLAGS) -c $<
12+
%.cmx : %.ml
13+
@echo Building $@
14+
@$(OCAMLOPT) $(OCAMLFLAGS) -c $<
15+
16+
include .depend
17+
depend:
18+
@$(OCAMLDEP) -native $(INCLUDES) `find src -name "*.ml" -o -name "*.mli"` > .depend
19+
20+
SOURCE_FILES = $(shell $(OCAMLDEP) -sort `find src -name "*.ml"` | sed -E "s/\.ml/.cmx/g")
21+
22+
lib/rescript-editor-support.exe: $(SOURCE_FILES)
23+
@echo Linking...
24+
@$(OCAMLOPT) $(OCAMLFLAGS) -O2 -o ./lib/rescript-editor-support.exe \
25+
-I +compiler-libs unix.cmxa str.cmxa ocamlcommon.cmxa $(INCLUDES) $(SOURCE_FILES)
26+
@echo Done!
27+
28+
build-native: lib/rescript-editor-support.exe depend
29+
30+
dce: build-native
31+
node_modules/.bin/reanalyze -dce-cmt src -suppress src/vendor
32+
33+
tests/node_modules/.bin/rescript:
34+
@cd tests && npm install
35+
36+
tests/lib/.compiler.log: tests/node_modules/.bin/rescript
37+
@cd tests && node_modules/.bin/rescript build -with-deps
38+
39+
test: dce tests/lib/.compiler.log
40+
./test.sh
41+
42+
clean:
43+
git clean -dfx src
44+
45+
.DEFAULT_GOAL := build-native
46+
47+
.PHONY: depend clean build-native dce test

0 commit comments

Comments
 (0)