Skip to content

Commit 5c86de2

Browse files
committed
compiler: Use --assume-main-file-path as relative path for imports
This PR fixes an issue with IDE integration where the compiler would use the relative path of the temporary file for imports, rather than the main file path specified.
1 parent f8e7568 commit 5c86de2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

selfhost/compiler.jakt

+1-4
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ class Compiler {
187187
}
188188

189189
public fn find_in_search_paths(this, anon path: Path, relative_import: bool = false, parent_path_count: usize = 0) throws -> Path? {
190-
let current_file_path = match relative_import {
191-
true => .current_file_path()
192-
false => .assume_main_file_path ?? .current_file_path()
193-
}
190+
let current_file_path = .assume_main_file_path ?? .current_file_path()
194191
if current_file_path.has_value() {
195192
mut candidate_path = current_file_path!.absolute().parent()
196193
if relative_import and parent_path_count > 0 {

0 commit comments

Comments
 (0)