-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mint-lang:master' into navigation
- Loading branch information
Showing
104 changed files
with
4,510 additions
and
51 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
crystal 1.8.2 | ||
crystal 1.9.1 | ||
mint 0.18.0 |
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
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
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
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,102 @@ | ||
record Subscription { | ||
a : Bool, | ||
b : Bool | ||
} | ||
|
||
provider Provider : Subscription { | ||
const NAME = "hello" | ||
|
||
state a : String = "" | ||
|
||
get b : String { | ||
a | ||
} | ||
|
||
fun name : String { | ||
NAME | ||
} | ||
} | ||
|
||
component Main { | ||
use Provider { | ||
a: true, | ||
b: false | ||
} | ||
|
||
fun render { | ||
<div/> | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
const A = _R({ | ||
a: [ | ||
"a", | ||
Decoder.boolean | ||
], | ||
b: [ | ||
"b", | ||
Decoder.boolean | ||
] | ||
}); | ||
|
||
const B = new(class extends _P { | ||
constructor() { | ||
super(); | ||
|
||
this.state = { | ||
c: `` | ||
}; | ||
|
||
this._d({ | ||
b: () => { | ||
return `hello` | ||
} | ||
}); | ||
} | ||
|
||
get c() { | ||
return this.state.c; | ||
} | ||
|
||
get d() { | ||
return this.c | ||
} | ||
|
||
a() { | ||
return this.b; | ||
} | ||
}); | ||
|
||
class C extends _C { | ||
componentWillUnmount() { | ||
B._unsubscribe(this); | ||
} | ||
|
||
componentDidUpdate() { | ||
if (true) { | ||
B._subscribe(this, new A({ | ||
a: true, | ||
b: false | ||
})) | ||
} else { | ||
B._unsubscribe(this) | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
if (true) { | ||
B._subscribe(this, new A({ | ||
a: true, | ||
b: false | ||
})) | ||
} else { | ||
B._unsubscribe(this) | ||
}; | ||
} | ||
|
||
render() { | ||
return _h("div", {}); | ||
} | ||
}; | ||
|
||
C.displayName = "Main"; |
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,24 @@ | ||
record Subscription { | ||
a : Bool | ||
} | ||
|
||
provider Provider:Subscription { | ||
/* Comment */constNAME="hello" | ||
|
||
fun name:String { | ||
NAME | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
record Subscription { | ||
a : Bool | ||
} | ||
|
||
provider Provider : Subscription { | ||
/* Comment */ | ||
const NAME = "hello" | ||
|
||
fun name : String { | ||
NAME | ||
} | ||
} |
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,34 @@ | ||
record Subscription { | ||
a : Bool | ||
} | ||
|
||
provider Provider:Subscription { | ||
/* Comment */constNAME="hello" | ||
|
||
state a :String = "" | ||
getb:String { | ||
a | ||
} | ||
fun name:String { | ||
NAME | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
record Subscription { | ||
a : Bool | ||
} | ||
|
||
provider Provider : Subscription { | ||
/* Comment */ | ||
const NAME = "hello" | ||
|
||
state a : String = "" | ||
|
||
get b : String { | ||
a | ||
} | ||
|
||
fun name : String { | ||
NAME | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
spec/language_server/definition/location/variable_block_statement_target
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,55 @@ | ||
module Test { | ||
fun upperCaseMint : String { | ||
let test = | ||
"Mint" | ||
|
||
String.toUpperCase(test) | ||
} | ||
} | ||
------------------------------------------------------------------file test.mint | ||
{ | ||
"id": 0, | ||
"method": "initialize", | ||
"params": { | ||
"capabilities": { | ||
"textDocument": { | ||
"definition": { | ||
"linkSupport": false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"id": 1, | ||
"params": { | ||
"textDocument": { | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"position": { | ||
"line": 5, | ||
"character": 23 | ||
} | ||
}, | ||
"method": "textDocument/definition" | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 8 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 12 | ||
} | ||
}, | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"id": 1 | ||
} | ||
------------------------------------------------------------------------response |
61 changes: 61 additions & 0 deletions
61
spec/language_server/definition/location/variable_casebranch_enumdestructuring
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,61 @@ | ||
enum Status { | ||
Error | ||
Ok(text : String) | ||
} | ||
|
||
module Test { | ||
fun toString (status : Status) : String { | ||
case status { | ||
Status::Ok(text) => text | ||
Status::Error => "error" | ||
} | ||
} | ||
} | ||
------------------------------------------------------------------file test.mint | ||
{ | ||
"id": 0, | ||
"method": "initialize", | ||
"params": { | ||
"capabilities": { | ||
"textDocument": { | ||
"definition": { | ||
"linkSupport": false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"params": { | ||
"textDocument": { | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"position": { | ||
"line": 8, | ||
"character": 26 | ||
} | ||
}, | ||
"method": "textDocument/definition" | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"range": { | ||
"start": { | ||
"line": 8, | ||
"character": 17 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"character": 21 | ||
} | ||
}, | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"id": 1 | ||
} | ||
------------------------------------------------------------------------response |
60 changes: 60 additions & 0 deletions
60
spec/language_server/definition/location/variable_component_connect
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,60 @@ | ||
component Test { | ||
connect Theme exposing { primary } | ||
|
||
fun render : Html { | ||
<div> | ||
<{ primary }> | ||
</div> | ||
} | ||
} | ||
------------------------------------------------------------------file test.mint | ||
store Theme { | ||
state primary : String = "#00a0e8" | ||
} | ||
-----------------------------------------------------------------file store.mint | ||
{ | ||
"id": 0, | ||
"method": "initialize", | ||
"params": { | ||
"capabilities": { | ||
"textDocument": { | ||
"definition": { | ||
"linkSupport": false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"id": 1, | ||
"params": { | ||
"textDocument": { | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"position": { | ||
"line": 5, | ||
"character": 9 | ||
} | ||
}, | ||
"method": "textDocument/definition" | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"range": { | ||
"start": { | ||
"line": 1, | ||
"character": 27 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"character": 34 | ||
} | ||
}, | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"id": 1 | ||
} | ||
------------------------------------------------------------------------response |
Oops, something went wrong.