Idea detail
import_from
reqlan rq/language/imports.rq:8
block
Summary
From-import syntax uses from, a quoted path, import, and an idea name.
From-import may list more than one idea. Separate the names with commas.
From-import may include an alias using as.
The parser records a span for the path, each idea name, and each alias.
Each of those tokens is its own document link.
The path links to the file.
An idea name links to that declaration.
An alias links to the same declaration.
When the alias contains the imported idea name, Ctrl + click on a bracket reference still treats the whole alias as one link.
See aliased_from_import_ctrl_click.
The language server uses the parser spans: language_server_rust.
Navigation
Attributes
| Key | Value |
|---|---|
| example | ``` from "@/links-to-file.rq" import ishouldlink, ishouldbeasecondlink as ishouldbeathirdvalidlink ``` |
| implementation | parser.rs, ast.rs, analysis.rs |
| tests | parsing.test.ts:parses from-import example line inside an attribute block value, local-symbolic-links.test.ts:aliased from-import whose name contains the imported idea is one link, parser.rs:from_import_records_each_token_span, parity.rs:from_import_tokens_link_independently |
Ancestor context
No ancestor chain recorded.
Outbound references
Inbound references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| references | check_unresolved_imports | reqlan rq/core_analysis/check.rq | import_from |
| references | from_import_syntax | reqlan rq/extension/language/support/features-imports.rq | import_from |
| references | language_server_rust | reqlan rq/extension/language/support/language-server-rust.rq | import_from |
| references | aliased_from_import_ctrl_click | reqlan rq/extension/language/syntax/features-syntax-highlighting.rq | import_from |
| references | import_paths | reqlan rq/language/imports.rq | import_from |
| references | import_statement | reqlan rq/ontology.rq | import_from |
Unresolved references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| None | |||
Local graph
Initialising graph…