-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: workspace cache #95
Conversation
opts.maybe_vendor_override.as_ref(), | ||
), | ||
workspace: new_rc(Workspace::new_single(config_folder)), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix here. Basically, if someone specifies a path like not-deno.json
then we shouldn't do workspace discovery because there's no way that this configuration file could be part of the workspace.
Additionally, if someone specifies a deno.jsonc
file when there's a deno.json
file, the deno.json
file would be part of the workspace and not the deno.jsonc
, so we should also not do workspace resolution in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, good catch 👍
src/workspace/mod.rs
Outdated
} | ||
|
||
#[test] | ||
fn test_config_not_deno_workspace_member_non_natural_config_file_name() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opts.maybe_vendor_override.as_ref(), | ||
); | ||
let mut final_members = BTreeMap::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted out to function.
Some(deno_json.dir_path().join("vendor")) | ||
} else { | ||
None | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to just accept a deno json instead of ConfigFolders, which was needlessly complex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and `WorkspaceDirectory` - Uses the workspace cache in the lsp * denoland/deno_config#95 * denoland/deno_config#96
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and `WorkspaceDirectory` - Uses the workspace cache in the lsp * denoland/deno_config#95 * denoland/deno_config#96
This adds a workspace cache for use by the LSP, but also there's a bug fix for another edge case. I'll point out the test and code that fixes the edge case.