Skip to content
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

Has anyone gotten typos.config to work on Neovim? #31

Closed
mawkler opened this issue Jan 27, 2024 · 6 comments · Fixed by #32 or #34
Closed

Has anyone gotten typos.config to work on Neovim? #31

mawkler opened this issue Jan 27, 2024 · 6 comments · Fixed by #32 or #34
Labels
bug Something isn't working

Comments

@mawkler
Copy link

mawkler commented Jan 27, 2024

I'm trying to explicitly set the typos config using typos.config. However, it doesn't seem to get picked up. I've tried specifying the config value in all kinds of ways, but none of them seems to work:

require('lspconfig').typo_lsp.setup({
  init_options = {
    config = '/custom/path/.typos.toml',
    config = {'/custom/path/.typos.toml'},
  },
  config = {'/custom/path/.typos.toml'},
  config = '/custom/path/.typos.toml',
  settings = {
    typos = {
      config = {'/custom/path/.typos.toml'},
      config = '/custom/path/.typos.toml',
    }
  }
})

What am I doing wrong?

@tekumara
Copy link
Owner

config is received via initializationOptions so it goes in init_options, eg:

require('lspconfig').typos_lsp.setup({
    init_options = {
      config = '/custom/path/.typos.toml',
    }
})

However, it looks like there's an edge case! When Neovim doesn't initialise typo_lsp with workspaceFolders (ie: workspaceFolders = vim.NIL) the config file is ignored 😱 This is something that typos-lsp should handle, so I'll look into making a fix.

PS: It looks like workspaceFolders is derived from root_dir by default (ie: when not explicitly set). However, if workspaceFolders is not explicitly set, and root_dir is nil (because it doesn't contain any of these files) then we end up with rootPath = vim.NIL, rootUri = vim.NIL, workspaceFolders = vim.NIL and therefore an ignored config file 😞

@tekumara tekumara added the bug Something isn't working label Jan 28, 2024
@mawkler
Copy link
Author

mawkler commented Jan 30, 2024

Interesting, thanks for looking into it!

tekumara pushed a commit that referenced this issue Feb 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.12](v0.1.11...v0.1.12)
(2024-02-04)


### Features

* typos 1.18.0 with January 2024 dictionary changes
([dfb3e55](dfb3e55))


### Bug Fixes

* use config file when workspace folder absent
([79ae446](79ae446)),
closes [#31](#31)

---
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>
@mawkler
Copy link
Author

mawkler commented Feb 5, 2024

@tekumara Is the v0.1.12 release supposed to show up under releases? It still seems to show v0.1.11 as the latest version 🤔

@tekumara
Copy link
Owner

tekumara commented Feb 5, 2024

Unfortunately there's a 32-bit windows build error I haven't managed to fix yet blocking the release 😞

tekumara pushed a commit that referenced this issue Feb 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.12](v0.1.11...v0.1.12)
(2024-02-05)


### Features

* typos 1.18.0 with January 2024 dictionary changes
([dfb3e55](dfb3e55))


### Bug Fixes

* error LNK2019: unresolved external symbol _GetLogicalDrives
([6ec5abf](6ec5abf)),
closes [#33](#33)
* use config file when workspace folder absent
([79ae446](79ae446)),
closes [#31](#31)

---
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>
@tekumara
Copy link
Owner

tekumara commented Feb 5, 2024

Fixed and v0.1.12 has been released, let me know how you go 🤞

@mawkler
Copy link
Author

mawkler commented Feb 5, 2024

@tekumara Yes, my issue has been fixed! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants