Issue Description
Both as an LSP (in Helix) and running lint from the command line, Codebook seems to require that the config file is at codebook.toml (or the path configured with configPath in LSP options) rather than looking in parent directories.
If my understanding is correct, Helix provides a different root to LSPs for different file types, e.g. the directory with Cargo.toml for Rust files but the directory with .git for TOML files. While these roots are usually the same, it results in Codebook seeming to require multiple codebook.toml files in a monorepo where, for example, the Git root and the Cargo root are not the same.
This should work:
monorepo/
├── .git/
├── rust_project/
│ ├── src/
│ │ └── main.rs
│ └── Cargo.toml
└── codebook.toml
But this seems to be required (when used as an LSP):
monorepo/
├── .git/
├── rust_project/
│ ├── src/
│ │ └── main.rs
│ ├── Cargo.toml
│ └── codebook.toml # For typos in `main.rs`
└── codebook.toml # For typos in `Cargo.toml`
In this case, no location of a manually combined codebook.toml file seems to be in effect in both main.rs and Cargo.toml. I reproduced similar behavior for Go, Python, and TypeScript.
A codebook.toml file completely above the Git root seems to be ignored for all file types.
Operating System
Linux (Ubuntu/Debian)
Editor
Helix
Codebook Version
0.3.40
Configuration
Steps to Reproduce
CLI steps:
echo 'words = ["wurld"]' > codebook.toml
cargo new hello
echo 'fn main() { println!("Hello wurld"); }' > hello/src/main.rs
codebook-lsp lint hello/src/main.rs # Passes
cd hello
codebook-lsp lint src/main.rs # Fails
Resultant directory structure for reference:
.
├── hello/
│ ├── .git/
│ ├── src/
│ │ └── main.rs
│ ├── target/
│ ├── .gitignore
│ ├── Cargo.lock
│ └── Cargo.toml
└── codebook.toml
LSP steps:
- Create the same structure and file content as above.
- Open
main.rs in Helix. (The working directory when starting Helix doesn't matter.)
- Observe that "wurld" is marked as a typo even though it is an allowed word in a parent directory's
codebook.toml.
Expected Behavior
Whether Codebook is given a root by Helix based on the file type or is simply invoked from the command line, it should find and use a config file present in a parent directory.
Actual Behavior
Codebook seems to only check one place for a config file relative to a root directory defined by the editor or the CLI's working directory.
Code Sample
fn main() { println!("Hello, wurld!"); }
Log Output
I enabled them according to the README, but could not figure out where the output should be. Sorry.
Additional Context
No response
Issue Description
Both as an LSP (in Helix) and running
lintfrom the command line, Codebook seems to require that the config file is atcodebook.toml(or the path configured withconfigPathin LSP options) rather than looking in parent directories.If my understanding is correct, Helix provides a different root to LSPs for different file types, e.g. the directory with
Cargo.tomlfor Rust files but the directory with.gitfor TOML files. While these roots are usually the same, it results in Codebook seeming to require multiplecodebook.tomlfiles in a monorepo where, for example, the Git root and the Cargo root are not the same.This should work:
But this seems to be required (when used as an LSP):
In this case, no location of a manually combined
codebook.tomlfile seems to be in effect in bothmain.rsandCargo.toml. I reproduced similar behavior for Go, Python, and TypeScript.A
codebook.tomlfile completely above the Git root seems to be ignored for all file types.Operating System
Linux (Ubuntu/Debian)
Editor
Helix
Codebook Version
0.3.40
Configuration
Steps to Reproduce
CLI steps:
Resultant directory structure for reference:
LSP steps:
main.rsin Helix. (The working directory when starting Helix doesn't matter.)codebook.toml.Expected Behavior
Whether Codebook is given a root by Helix based on the file type or is simply invoked from the command line, it should find and use a config file present in a parent directory.
Actual Behavior
Codebook seems to only check one place for a config file relative to a root directory defined by the editor or the CLI's working directory.
Code Sample
Log Output
Additional Context
No response