-
Notifications
You must be signed in to change notification settings - Fork 7
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
Report spelling errors as info rather than warnings #17
Comments
Interesting, could you share a screenshot? I'm not sure how to replicate this behaviour. |
In this extension, The setting is set to "info", but still returns a "warning" (yellow). In the code spell checker extension, I get the report as "info" (blue) I was originally using the code spell checker extension, but went looking for something with less false positives, and your extension seems to do great at that. Having spelling errors marked as "info" instead of as a "warning", would make it easier to separate programing warnings from spelling mistakes. This issue is also consistent under the "problems" tab of vscode. |
Ah gotcha. So It sounds like you'd like to configure the diagnostic severity which isn't currently supported but is something that I'd be happy to add. |
Ok, that makes sense. Thank you. |
🤖 I have created a release *beep* *boop* --- ## [0.1.7](v0.1.6...v0.1.7) (2023-10-22) ### Features * configurable diagnostic severity ([7e7e743](7e7e743)), closes [#17](#17) * typos 1.16.20 ([fb013ea](fb013ea)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: potatobot-prime[bot] <132267321+potatobot-prime[bot]@users.noreply.github.com>
@AspieSoft I've released v0.1.7 which has the new setting |
I'm really sorry for bothering you all on this closed issue but I didn't find a better place where to ask 😞 Question: the diagnostics levels cannot be customized on NeoVim via Sorry for the dumb question and once again for the bother. P.S: thank you really a lot for all you amazing work! 🙇♂️ |
Hey @fusillicode it should be possible on any editor than can provide initialisation options to the lsp server. I'm sorry I don't know how to do that with neovim but if you find a way let us know 😊 |
@tekumara thanks really a lot for the quick feedback! 🙇♂️ If I make it to work with Neovim I'll come back with the solution and maybe open a PR to document the thing! 👍 Thanks again for everything! ♾️ 🙇♂️ |
@fusillicode: Putting it in typos_lsp = {
init_options = {
diagnosticSeverity = 'Warning',
},
}, |
@nghialm269 thanks for the feedback but unfortunately it's not working on my side https://github.com/fusillicode/dotfiles/blob/39fa7e51d89924091703c9ebc68897e8cec5a468/nvim/lua/mason-tools.lua#L49-L53 🥲 Where did you put that config in your Neovim config if I can ask? |
@fusillicode: here is the mini config file from nvim-lspconfig: local on_windows = vim.loop.os_uname().version:match("Windows")
local function join_paths(...)
local path_sep = on_windows and "\\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd([[set runtimepath=$VIMRUNTIME]])
local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"
vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))
local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local lspconfig_path = join_paths(package_root, "test", "start", "nvim-lspconfig")
if vim.fn.isdirectory(lspconfig_path) ~= 1 then
vim.fn.system({ "git", "clone", "https://github.com/neovim/nvim-lspconfig", lspconfig_path })
end
vim.lsp.set_log_level("trace")
require("vim.lsp.log").set_format_func(vim.inspect)
local nvim_lsp = require("lspconfig")
local on_attach = function(_, bufnr)
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = { buffer = bufnr, noremap = true, silent = true }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
end
-- Add the server that troubles you here
local name = "typos_lsp"
local cmd = { '/home/nghialm/.local/share/nvim/mason/bin/typos-lsp' } -- needed for elixirls, lua_ls, omnisharp
if not name then
print("You have not defined a server name, please edit minimal_init.lua")
end
if not nvim_lsp[name].document_config.default_config.cmd and not cmd then
print([[You have not defined a server default cmd for a server
that requires it please edit minimal_init.lua]])
end
nvim_lsp[name].setup({
cmd = cmd,
on_attach = on_attach,
init_options = {
diagnosticSeverity = 'Warning',
},
})
-- test typo symbo save to you should see the warning typo in the last line ( |
@nghialm269 thanks so much for coming back so quickly and with that extensive example! ♾️ 🙇♂️ |
To anyone who will bump into this, my issue was fixed thanks to this. More specifically the I managed to do this ☝️ in my (at the time of writing) config in this way. ♾️ thanks once again to @nghialm269 🙏 🙇♂️ |
In the vscode extension settings, if I set the log level to "info", it continues to report spelling errors as warnings.
The text was updated successfully, but these errors were encountered: