Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: provide additional search_path patterns for typechecking #484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juleswritescode merged 15 commits into main from issue/#482
Aug 31, 2025

Conversation

Copy link
Collaborator

@juleswritescode juleswritescode commented Aug 30, 2025
edited
Loading

Adds a linter.searchPathPatterns option where a user can add glob-patterns for additional schemas to be searched when typechecking.

Screenshot 2025年08月30日 at 07 54 00 Screenshot 2025年08月30日 at 07 54 13 Screenshot 2025年08月30日 at 07 54 30

Copy link
Collaborator

@psteinroe psteinroe left a comment

Choose a reason for hiding this comment

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

nice!

a few nits:

  • is linter the right place for this? Or rather db settings?
  • maybe we can compile the glob already in the settings, and not in every typecheck run?

Copy link
Collaborator Author

juleswritescode commented Aug 30, 2025
edited
Loading

is linter the right place for this? Or rather db settings?

Hmm had it there at first :D The reason I used the linter in the end was that the search_path only applies to the type checking, and to nothing else DB related. for example, if we use the EXECUTE STATEMENT feature, it'll not use those search paths.

I also fear that there might be a misunderstanding that you "configure the db to use the search_path".

But I don't have a strong opinion on this. What do you prefer?

Copy link
Collaborator

is linter the right place for this? Or rather db settings?

Hmm had it there at first :D The reason I used the linter in the end was that the search_path only applies to the type checking, and to nothing else DB related. for example, if we use the EXECUTE STATEMENT feature, it'll not use those search paths.

I also fear that there might be a misunderstanding that you "configure the db to use the search_path".

But I don't have a strong opinion on this. What do you prefer?

mhh what do you think of adding a new section into he settings for typechecking? That way, we can also add disable etc. linting and type checking are two different things after all. and the lint settings are used to configure individual rules.

Copy link
Collaborator Author

juleswritescode commented Aug 31, 2025
edited
Loading

is linter the right place for this? Or rather db settings?

Hmm had it there at first :D The reason I used the linter in the end was that the search_path only applies to the type checking, and to nothing else DB related. for example, if we use the EXECUTE STATEMENT feature, it'll not use those search paths.
I also fear that there might be a misunderstanding that you "configure the db to use the search_path".
But I don't have a strong opinion on this. What do you prefer?

mhh what do you think of adding a new section into he settings for typechecking? That way, we can also add disable etc. linting and type checking are two different things after all. and the lint settings are used to configure individual rules.

I think that's a good idea! I'll do it in this PR

Copy link
Collaborator Author

done!

Copy link
Collaborator

@psteinroe psteinroe left a comment

Choose a reason for hiding this comment

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

nice!

@@ -455,6 +455,7 @@ impl Workspace for WorkspaceServer {
let path_clone = params.path.clone();
let schema_cache = self.schema_cache.load(pool.clone())?;
let input = doc.iter(TypecheckDiagnosticsMapper).collect::<Vec<_>>();
let search_path_patterns = settings.typecheck.search_path.clone();
Copy link
Collaborator

@psteinroe psteinroe Aug 31, 2025

Choose a reason for hiding this comment

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

nit: why not passing the entire config struct?

Copy link
Collaborator Author

@juleswritescode juleswritescode Aug 31, 2025

Choose a reason for hiding this comment

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

because of a circular dependency: workspace depends on typecheck, typecheck depends on workspace::TypecheckSettings

psteinroe reacted with thumbs up emoji
@juleswritescode juleswritescode merged commit 8869683 into main Aug 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@psteinroe psteinroe psteinroe approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /