Skip to content

feat: import hints and pub funcs discovery - #10

Merged
gerau merged 1 commit into
masterfrom
feature/import-function-hints
Jul 31, 2026
Merged

feat: import hints and pub funcs discovery#10
gerau merged 1 commit into
masterfrom
feature/import-function-hints

Conversation

@KyrylR

@KyrylR KyrylR commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@KyrylR
KyrylR requested a review from gerau July 30, 2026 12:17

@gerau gerau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7aaca2d; tested locally

Comment thread src/backend.rs
Comment on lines +1054 to +1063
fn items_contain_main(items: &[parse::Item]) -> bool {
items.iter().any(|item| match item {
parse::Item::Function(function) => function.name().as_inner() == "main",
parse::Item::Module(module) => items_contain_main(module.items()),
parse::Item::TypeAlias(_)
| parse::Item::Use(_)
| parse::Item::EnumDeclaration(_)
| parse::Item::Ignored => false,
})
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this MR, but we should consider moving these functions into a separate module.

Comment thread src/imports.rs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we cannot put it under completion module and parse it from there?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, though will take a look/refactor it in a follow up PRs

Comment thread src/backend.rs
};

Some(
ProjectContext::discover(path.as_ref(), &project_settings, &workspace_roots)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we somehow cache this discover and refresh cache at Save, for example?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will think about it, added to my TODOs

@gerau
gerau merged commit cbf7cf5 into master Jul 31, 2026
9 checks passed
@gerau
gerau deleted the feature/import-function-hints branch July 31, 2026 11:03
@KyrylR
KyrylR restored the feature/import-function-hints branch August 25, 2026 13:34
@KyrylR
KyrylR deleted the feature/import-function-hints branch August 25, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants