Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a larger test for the extension #455

Merged
merged 4 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions analysis/examples/larger-project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/lib
14 changes: 14 additions & 0 deletions analysis/examples/larger-project/.merlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
####{BSB GENERATED: NO EDIT
FLG -ppx '/Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/darwin/bsc.exe -as-ppx -bs-jsx 3'
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/lib/ocaml
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/rescript/lib/ocaml
FLG -w +a-4-9-20-40-41-42-50-61-102
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@rescript/react/lib/ocaml
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@rescript/react/lib/ocaml
S /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@glennsl/bs-json/lib/ocaml
B /Users/cristianocalcagno/GitHub/rescript-vscode/analysis/examples/larger-project/node_modules/@glennsl/bs-json/lib/ocaml
S src
B lib/bs/src
S src/exception
B lib/bs/src/exception
####BSB GENERATED: NO EDIT}
Empty file.
21 changes: 21 additions & 0 deletions analysis/examples/larger-project/bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"reanalyze": {
"analysis": ["dce"],
"suppress": [],
"unsuppress": []
},
"name": "sample-typescript-app",
"bsc-flags": ["-bs-super-errors -w a"],
"reason": { "react-jsx": 3 },
"bs-dependencies": ["@rescript/react", "@glennsl/bs-json"],
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": {
"module": "es6",
"in-source": true
}
}
192 changes: 192 additions & 0 deletions analysis/examples/larger-project/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions analysis/examples/larger-project/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "large-project",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "rescript build -w",
"build": "rescript build",
"clean": "rescript clean -with-deps"
},
"devDependencies": {
"react": "^16.13.1",
"react-dom": "^16.8.6",
"rescript": "^9.1.4"
},
"dependencies": {
"@glennsl/bs-json": "^5.0.4",
"@rescript/react": "^0.10.3"
}
}
2 changes: 2 additions & 0 deletions analysis/examples/larger-project/src/AutoAnnotate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions analysis/examples/larger-project/src/AutoAnnotate.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type variant = R(int)

@genType
type record = {variant: variant}

type r2 = {r2: int}

type r3 = {r3: int}

type r4 = {r4: int}

@genType
type annotatedVariant =
| R2(r2, r3)
| R4(r4)
2 changes: 2 additions & 0 deletions analysis/examples/larger-project/src/BootloaderResource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions analysis/examples/larger-project/src/BootloaderResource.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* NOTE: This is a spooky interface that provides no type safety. It should be
* improved. Use with caution. */
@module("BootloaderResource")
external read: JSResource.t<'a> => 'a = "read"
13 changes: 13 additions & 0 deletions analysis/examples/larger-project/src/BucklescriptAnnotations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions analysis/examples/larger-project/src/BucklescriptAnnotations.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@genType
type someMutableFields = {
@set
"mutable0": string,
"immutable": int,
@set
"mutable1": string,
@set
"mutable2": string,
}

@genType
type someMethods = {
@meth
"send": string => unit,
@meth
"on": (string, (. int) => unit) => unit,
@meth
"threeargs": (int, string, int) => string,
"twoArgs": (. int, string) => int,
}

// let foo = (x: someMethods) => x["threeargs"](3, "a", 4)

let bar = (x: someMethods) => {
let f = x["twoArgs"]
f(. 3, "a")
}
19 changes: 19 additions & 0 deletions analysis/examples/larger-project/src/ComponentAsProp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions analysis/examples/larger-project/src/ComponentAsProp.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@ocaml.doc(
" This is like declaring a normal ReasonReact component's `make` function, except the body is a the interop hook wrapJsForReason "
)
@genType
@react.component
let make = (~title, ~description, ~button=?) => {
<div>
<div>
title
description
{switch button {
| Some(button) => button
| None => React.null
}}
</div>
</div>
}
26 changes: 26 additions & 0 deletions analysis/examples/larger-project/src/CreateErrorHandler1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions analysis/examples/larger-project/src/CreateErrorHandler1.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Error1 = {
type t = string
let notification = s => (s, s)
}

module MyErrorHandler = ErrorHandler.Make(Error1)

MyErrorHandler.notify("abc")
Loading