solidity/test/libsolidity/lsp/goto/goto_definition_imports.sol

72 lines
1.5 KiB
Solidity
Raw Normal View History

2021-12-20 13:10:17 +00:00
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
import {Weather as Wetter} from "./lib.sol";
// ^ @wheatherImportCursor
2021-12-20 13:10:17 +00:00
import "./lib.sol" as That;
// ^^^^ @ThatImport
2021-12-20 13:10:17 +00:00
contract C
{
function test_symbol_alias() public pure returns (Wetter result)
// ^ @WetterCursor
2021-12-20 13:10:17 +00:00
{
result = Wetter.Sunny;
}
function test_library_alias() public pure returns (That.Color result)
// ^ @ThatCursor
2021-12-20 13:10:17 +00:00
{
That.Color color = That.Color.Red;
// ^ @ThatVarCursor ^ @ThatExpressionCursor
2021-12-20 13:10:17 +00:00
result = color;
}
}
// ----
// lib: @diagnostics 2072
// -> textDocument/definition {
// "position": @wheatherImportCursor
// }
// <- [
// {
// "range": @whetherEnum,
// "uri": "lib.sol"
// }
// ]
// -> textDocument/definition {
// "position": @WetterCursor
// }
// <- [
// {
// "range": @whetherEnum,
// "uri": "lib.sol"
// }
// ]
// -> textDocument/definition {
// "position": @ThatCursor
// }
// <- [
// {
// "range": @ColorEnum,
// "uri": "lib.sol"
// }
// ]
// -> textDocument/definition {
// "position": @ThatVarCursor
// }
// <- [
// {
// "range": @ColorEnum,
// "uri": "lib.sol"
// }
// ]
// -> textDocument/definition {
// "position": @ThatExpressionCursor
// }
// <- [
// {
// "range": @ThatImport,
// "uri": "goto_definition_imports.sol"
// }
// ]