Skip to content

Commit 9967f95

Browse files
authored
Add a larger test for the extension (#455)
* Add a larger test for the extension Includes larger files, such as `res_core.ml` and vendored compiler libs from the syntax module. * no lock * Add example in analysis/examples * Artifacts.
1 parent 15e5b7c commit 9967f95

File tree

243 files changed

+70060
-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.

243 files changed

+70060
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/lib
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
####{BSB GENERATED: NO EDIT
2+
FLG -ppx '/Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/darwin/bsc.exe -as-ppx -bs-jsx 3'
3+
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/lib/ocaml
4+
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/lib/ocaml
5+
FLG -w +a-4-9-20-40-41-42-50-61-102
6+
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@rescript/react/lib/ocaml
7+
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@rescript/react/lib/ocaml
8+
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@glennsl/bs-json/lib/ocaml
9+
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@glennsl/bs-json/lib/ocaml
10+
S src
11+
B lib/bs/src
12+
S src/exception
13+
B lib/bs/src/exception
14+
####BSB GENERATED: NO EDIT}

analysis/examples/larger-project/.watchmanconfig

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"reanalyze": {
3+
"analysis": ["dce"],
4+
"suppress": [],
5+
"unsuppress": []
6+
},
7+
"name": "sample-typescript-app",
8+
"bsc-flags": ["-bs-super-errors -w a"],
9+
"reason": { "react-jsx": 3 },
10+
"bs-dependencies": ["@rescript/react", "@glennsl/bs-json"],
11+
"sources": [
12+
{
13+
"dir": "src",
14+
"subdirs": true
15+
}
16+
],
17+
"package-specs": {
18+
"module": "es6",
19+
"in-source": true
20+
}
21+
}

analysis/examples/larger-project/package-lock.json

+192
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "large-project",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"start": "rescript build -w",
7+
"build": "rescript build",
8+
"clean": "rescript clean -with-deps"
9+
},
10+
"devDependencies": {
11+
"react": "^16.13.1",
12+
"react-dom": "^16.8.6",
13+
"rescript": "^9.1.4"
14+
},
15+
"dependencies": {
16+
"@glennsl/bs-json": "^5.0.4",
17+
"@rescript/react": "^0.10.3"
18+
}
19+
}

analysis/examples/larger-project/src/AutoAnnotate.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type variant = R(int)
2+
3+
@genType
4+
type record = {variant: variant}
5+
6+
type r2 = {r2: int}
7+
8+
type r3 = {r3: int}
9+
10+
type r4 = {r4: int}
11+
12+
@genType
13+
type annotatedVariant =
14+
| R2(r2, r3)
15+
| R4(r4)

analysis/examples/larger-project/src/BootloaderResource.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* NOTE: This is a spooky interface that provides no type safety. It should be
2+
* improved. Use with caution. */
3+
@module("BootloaderResource")
4+
external read: JSResource.t<'a> => 'a = "read"

analysis/examples/larger-project/src/BucklescriptAnnotations.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@genType
2+
type someMutableFields = {
3+
@set
4+
"mutable0": string,
5+
"immutable": int,
6+
@set
7+
"mutable1": string,
8+
@set
9+
"mutable2": string,
10+
}
11+
12+
@genType
13+
type someMethods = {
14+
@meth
15+
"send": string => unit,
16+
@meth
17+
"on": (string, (. int) => unit) => unit,
18+
@meth
19+
"threeargs": (int, string, int) => string,
20+
"twoArgs": (. int, string) => int,
21+
}
22+
23+
// let foo = (x: someMethods) => x["threeargs"](3, "a", 4)
24+
25+
let bar = (x: someMethods) => {
26+
let f = x["twoArgs"]
27+
f(. 3, "a")
28+
}

analysis/examples/larger-project/src/ComponentAsProp.js

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@ocaml.doc(
2+
" This is like declaring a normal ReasonReact component's `make` function, except the body is a the interop hook wrapJsForReason "
3+
)
4+
@genType
5+
@react.component
6+
let make = (~title, ~description, ~button=?) => {
7+
<div>
8+
<div>
9+
title
10+
description
11+
{switch button {
12+
| Some(button) => button
13+
| None => React.null
14+
}}
15+
</div>
16+
</div>
17+
}

analysis/examples/larger-project/src/CreateErrorHandler1.js

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Error1 = {
2+
type t = string
3+
let notification = s => (s, s)
4+
}
5+
6+
module MyErrorHandler = ErrorHandler.Make(Error1)
7+
8+
MyErrorHandler.notify("abc")

0 commit comments

Comments
 (0)