Skip to content

Commit

Permalink
LSP: Add missing Location tests for module access
Browse files Browse the repository at this point in the history
  • Loading branch information
jansul committed Aug 5, 2023
1 parent cad3b28 commit c3ddc13
Show file tree
Hide file tree
Showing 14 changed files with 877 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
global component Header {
const TITLE = "Mint"

fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header:TITLE }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 8
},
"end": {
"line": 1,
"character": 13
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
global component Header {
fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.render() }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 6
},
"end": {
"line": 1,
"character": 12
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
global component Header {
get title : String {
"Mint"
}

fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.title }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 6
},
"end": {
"line": 1,
"character": 11
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
global component Header {
fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.render() }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 9
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 0,
"character": 17
},
"end": {
"line": 0,
"character": 23
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
global component Header {
state title = "Mint"

fun render : Html {
<div/>
}
}
----------------------------------------------------------------file header.mint
component Test {
fun render : Html {
<div>
<{ Header.title }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 8
},
"end": {
"line": 1,
"character": 13
}
},
"uri": "file://#{root_path}/header.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module Header {
const TITLE = "Mint"
}
----------------------------------------------------------------file module.mint
component Test {
fun render : Html {
<div>
<{ Header:TITLE }>
</div>
}
}
------------------------------------------------------------------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": 3,
"character": 16
}
},
"method": "textDocument/definition"
}
-------------------------------------------------------------------------request
{
"jsonrpc": "2.0",
"result": {
"range": {
"start": {
"line": 1,
"character": 8
},
"end": {
"line": 1,
"character": 13
}
},
"uri": "file://#{root_path}/module.mint"
},
"id": 1
}
------------------------------------------------------------------------response
Loading

0 comments on commit c3ddc13

Please sign in to comment.