-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LSP: Add Go To Definition support for
Ast::ModuleAccess
(#623)
- Loading branch information
Showing
41 changed files
with
2,258 additions
and
34 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
spec/language_server/definition/location/module_access_component_constant
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,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 |
61 changes: 61 additions & 0 deletions
61
spec/language_server/definition/location/module_access_component_function
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 @@ | ||
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 |
65 changes: 65 additions & 0 deletions
65
spec/language_server/definition/location/module_access_component_gets
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,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 |
61 changes: 61 additions & 0 deletions
61
spec/language_server/definition/location/module_access_component_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,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 |
63 changes: 63 additions & 0 deletions
63
spec/language_server/definition/location/module_access_component_state
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,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 |
59 changes: 59 additions & 0 deletions
59
spec/language_server/definition/location/module_access_module_constant
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,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 |
Oops, something went wrong.