Imports and Navigation
This page is intentionally short and exists to prevent confusion between three related features:
- Go-to-definition on symbols (
Identifier,MemberAccess, etc.) - Go-to-definition on import strings (
import "./X.sol") - Find references (
textDocument/references)
What goes where
- Symbol goto and import-string goto are both handled in the goto implementation:
- see
goto.md
- see
- Reference collection is handled in the references implementation:
- see
references.md
- see
Important boundary
Import strings are treated as navigation targets, not symbol references.
That means:
import "./Pool.sol"can navigate to the file via go-to-definition.textDocument/referencesdoes not return import-string literals as references for a declaration.
This boundary is deliberate in the current design so references remain declaration/usage based, while import paths remain file-navigation based.