Skip to content

Add use_local setting#299

Open
mstarodub wants to merge 1 commit into
blopker:mainfrom
mstarodub:mxs-push-ko
Open

Add use_local setting#299
mstarodub wants to merge 1 commit into
blopker:mainfrom
mstarodub:mxs-push-ko

Conversation

@mstarodub

Copy link
Copy Markdown

I did not like [1] the presence of suggestions to create project-local dictionaries or exclusion lists, so I thought this could be a useful feature (analogous to use_global) to allow disabling them.

[1] I think this post by Andrew Kelley explains the reasoning best.

Copilot AI review requested due to automatic review settings July 24, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new use_local configuration setting to control whether project-local Codebook configuration (and related LSP quick-fix suggestions) should be used, analogous to the existing use_global behavior.

Changes:

  • Introduces use_local: bool in ConfigSettings with serde defaults.
  • Extends CodebookConfig with a use_local() accessor and implements it for file/memory configs.
  • Updates LSP code actions to only offer project-local “add to dictionary” / “ignore file” actions when use_local is enabled.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/codebook-lsp/src/lsp.rs Gates project-local code actions behind config_handle().use_local().
crates/codebook-config/src/settings.rs Adds the use_local setting to the serialized config model with defaults.
crates/codebook-config/src/lib.rs Adds use_local() to the config trait and applies use_local during effective-settings calculation.

Comment on lines +289 to +293
if !project.use_local {
return if project.use_global {
global_config
.content()
.cloned()
fn should_flag_word(&self, word: &str) -> bool;
fn get_ignore_patterns(&self) -> Vec<Regex>;
fn get_min_word_length(&self) -> usize;
fn use_local(&self) -> bool;
Comment on lines +289 to +293
if !project.use_local {
return if project.use_global {
global_config
.content()
.cloned()
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