-
Notifications
You must be signed in to change notification settings - Fork 15
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
CSpell Multi Config Support #62
Conversation
Hi @JateNensvold the idea makes sense, before I take a deeper look, could you address the failing tests? |
Yeah! The cspell.nvim tests were actually passing before my last commit, I must have forgotten to recheck after my last change. Ill take a look as soon as I have some free time this weekend and ensure they are passing in the next commit as well as address the commit message/lua style failures. |
3af1206
to
6fac49e
Compare
Sorry for the delay. I addressed the failures that I saw in the approval workflows and they should be passing based on what I see locally. I expect there might be some more changes needed based on your thoughts on some of the rewrites I did to some of the core helper functionality to add support for multi config and configs outside the project directory. |
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.
There are a couple for formatting issues I noticed. It also looks like the tests are not passing.
I pulled these two helpers from my personal config, I think they might help with the titles for the code actions:
--- @param path string
--- @return string
M.shorten_path = function(path)
return Path:new(path):expand():gsub(Path:new("."):expand(), "."):gsub(vim.env.HOME, "~")
end
--- Formats a string using a table of substitutions.
--- E.g. `M.format("Hello ${subject}", { subject = "world" })` returns `Hello world`
---
--- @param str string The string to format
--- @param tbl table k-v pairs of string substitutions
--- @return string, number
M.format = function(str, tbl)
---@param param string
return str:gsub("$%b{}", function(param)
return (tbl[string.sub(param, 3, -2)] or param)
end)
end
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.
I also noticed it this message every time I start a neovim session:
Created a new cspell.json file at $HOME/.cache/nvim/cspell.nvim/cspell.json
Looks like the file is created unconditionally every time. That doesn't sound right.
6fac49e
to
a0d08b1
Compare
Looks like this was an unintended side effect of creating a merged cspell config that imports the other configs. I added some additional checks so the config gets/cached on disk, and is only recreated when additional config(s) have been added to the nvim setup. |
I'll give it another look later this week. |
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.
It's looking great, I commented on a couple of things we should address before merging.
93a54b0
to
9127d66
Compare
9127d66
to
c375451
Compare
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.
Works great, thanks!
Adds functionality discussed in #61