Skip to content

Commit

Permalink
Update rescript-project for jump to definition tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryyppy committed Jul 19, 2021
1 parent 5231869 commit 0c28f2d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 9 deletions.
30 changes: 26 additions & 4 deletions examples/rescript-project/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/rescript-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"rescript": "9.1.2"
"rescript": "9.1.3"
}
}
6 changes: 6 additions & 0 deletions examples/rescript-project/src/TestJumpTo.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Demo.a->Js.log
Demo.b->Js.log

let user = {RecordExample.User.name: "test"}

RecordExample.logUser(user)
2 changes: 1 addition & 1 deletion examples/rescript-project/src/interpolationSyntax.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ let var3 = j`hello $name how you doin?`

let varInvalid = `hello $name how you doin?`

let expr = `2 + 2 is ${Int.toString(2 + 2)}`
let expr = `2 + 2 is ${Belt.Int.toString(2 + 2)}`
2 changes: 2 additions & 0 deletions examples/rescript-project/src/polySyntax.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ let c = #"legacy exo-tic"
let d = #732

let e = {RecordExample.User.name: "test"}

Demo.a->Js.log
5 changes: 2 additions & 3 deletions examples/rescript-project/src/recordExample.res
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ module Role = {
type t = {roleName: string}
}

let doSomething = (u: User.t) => {
let logUser = (u: User.t) => {
Js.log(u.name)
}

let other = (r: Role.t) => {
let logRole = (r: Role.t) => {
Js.log(r.roleName)
}


11 changes: 11 additions & 0 deletions examples/rescript-project/src/recordExample.resi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module User: {
type t = {name: string}
}

module Role: {
type t = {roleName: string}
}

let logUser: User.t => unit

let logRole: Role.t => unit

0 comments on commit 0c28f2d

Please sign in to comment.