-
-
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.
LSP: Fix issues where modules share the same name as an Enum/Record
- Loading branch information
Showing
7 changed files
with
182 additions
and
22 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
spec/language_server/definition/location/module_access_module_name_shared
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,68 @@ | ||
record Header { | ||
title : String | ||
} | ||
----------------------------------------------------------------file record.mint | ||
module Header { | ||
fun default : Header { | ||
{ title: "Mint" } | ||
} | ||
} | ||
----------------------------------------------------------------file module.mint | ||
component Test { | ||
fun render : Html { | ||
let header = | ||
Header.default() | ||
|
||
<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": 6 | ||
} | ||
}, | ||
"method": "textDocument/definition" | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 7 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 13 | ||
} | ||
}, | ||
"uri": "file://#{root_path}/module.mint" | ||
}, | ||
"id": 1 | ||
} | ||
------------------------------------------------------------------------response |
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
88 changes: 88 additions & 0 deletions
88
spec/language_server/definition/location_link/module_access_module_name_shared
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,88 @@ | ||
record Header { | ||
title : String | ||
} | ||
----------------------------------------------------------------file record.mint | ||
module Header { | ||
fun default : Header { | ||
{ title: "Mint" } | ||
} | ||
} | ||
----------------------------------------------------------------file module.mint | ||
component Test { | ||
fun render : Html { | ||
let header = | ||
Header.default() | ||
|
||
<div> | ||
<{ header.title }> | ||
</div> | ||
} | ||
} | ||
------------------------------------------------------------------file test.mint | ||
{ | ||
"id": 0, | ||
"method": "initialize", | ||
"params": { | ||
"capabilities": { | ||
"textDocument": { | ||
"definition": { | ||
"linkSupport": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"params": { | ||
"textDocument": { | ||
"uri": "file://#{root_path}/test.mint" | ||
}, | ||
"position": { | ||
"line": 3, | ||
"character": 6 | ||
} | ||
}, | ||
"method": "textDocument/definition" | ||
} | ||
-------------------------------------------------------------------------request | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"originSelectionRange": { | ||
"start": { | ||
"line": 3, | ||
"character": 6 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"character": 12 | ||
} | ||
}, | ||
"targetUri": "file://#{root_path}/module.mint", | ||
"targetRange": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"character": 1 | ||
} | ||
}, | ||
"targetSelectionRange": { | ||
"start": { | ||
"line": 0, | ||
"character": 7 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 13 | ||
} | ||
} | ||
}, | ||
"id": 1 | ||
} | ||
------------------------------------------------------------------------response |
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