Import files from folders above: import ..a.b, import ...a.b
Leading dots go up one folder less than their count (.. is one up, ... is two). The language server index and formatter understand them, and a missing file is reported with its real path. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b496a7b03
commit
910bde692a
11 files changed
+139
-8
No files matched your search
@@ -113,3 +113,9 @@ fn step_as_a_name_and_c_imports() {
|
||||
"import \"raylib.h\" { Color, RED }\nimport \"zlib.h\" link \"z\"\n\nfunc step(dt: f32) {}\n\nfunc main() {\n step(1.0)\n for i in 0..10 step 2 { print(i) }\n}\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn import_paths_going_up_keep_their_dots() {
|
||||
let src = "import ...engine.engine\nimport ..side\nimport a.b\n\nfunc main() {\n for i in 0..3 { print(i) }\n}\n";
|
||||
assert_eq!(fmt(src), src);
|
||||
}
|
||||
Reference in new issue
Block a user