Open crashmoney opened 2 months ago
Hey @crashmoney sorry to hear your setup isn't working. Can you give me an example of a note filename and wikilink reference to that note that fails to work?
Hi @epwalsh, thanks for your quick reply. Unfortunately there isn't any specific filename that throws this error. It simply shows the 'create new note' option in cmp
, as if the note doesn't exist. I can see this happening even when I type out the name of a note that exists within the vault; it doesn't seem to be searching for existing notes at all.
For example, typing [[Notes MOC
]] simply pops up the (create) Reference
completion. Since reporting this issue yesterday, the autocomplete search spontaneously worked on one of my secondary vaults and has since ceased to work.
If it helps, I'm using ripgrep/fzf and usually don't have any issues with the setup. My main vault is hovering at around a few thousand files including config ones (I'd say 3k-4k, which shouldn't be too much of an issue for ripgrep in any case).
I'm just looking for an example so I can try to repro. What's the path of the note corresponding to [[Notes MOC]]
?
00 Atlas 🌎/Notes MOC.md
.
At first I thought it might be the emoji, but other paths without emojis (e.g. 02 Areas/Notes/Example.md
) present similarly.
Hmm yea that works fine for me even with the emoji and spaces in the filenames, and both with and without frontmatter 🤔
If you get a change, try running this Lua script and see if it collects any results:
-- save to 'tmp.lua', then from a markdown file in your vault, run with ':luafile tmp.lua'
local client = require("obsidian").get_client()
local results = client:find_notes "Notes MOC"
vim.print(string.format("Found %s notes:", #results))
for _, note in ipairs(results) do
vim.print(string.format(" - '%s'", note:display_name()))
end
Hi @epwalsh, I tried out the script you gave and got this:
E5113: Error while calling lua chunk: tmp.lua:3: calling 'find_notes' on bad self (table expected, got nil)
stack traceback:
[C]: in function 'find_notes'
tmp.lua:3: in main chunk
It doesn't look like it managed to collect anything, unfortunately :(
Hi @epwalsh, I managed to catch an error message earlier today that might help – it seems that the problem may lie with ripgrep
, though I don't think I configured it beyond defaults.
Captured stderr output while running command 'rg' with args '{ "--no-config", "--type=md", "--json", "--ignore-case",
"-g!03 Resources/Templates", "-e", "#[A-Za-z0-9_/-]*s[A-Za-
z0-9_/-]*", "-e", "\\s*- [A-Za-z0-9_/-]*s[A-Za-z0-9_/-]*$",
"-e", "tags: .*[A-Za-z0-9_/-]*s[A-Za-z0-9_/-]*", "/Users/crashmoney/Library/Mobile Documents/iCloud~md~obsidian/Documents
/vault" }'
[stderr] rg: /Users/crashmoney/Library/Mobile Documents/iCloud~
md~obsidian/Documents/vault/02 Areas/Daily Notes/2021/2
021-05/2021-05-14.md: No such file or directory (os
error 2)
They both repeat, though the second command does so with varying file names.
@crashmoney that would definitely explain it! Now I wonder why it doesn't resolve that directory. Maybe the spaces in the path need to be escaped?
Although my personal vault is also on the same iCloud path but I've never had issues with that 🤔
Hey @epwalsh, just an update on this issue. gf
has started working again with no explanation. I've since switched plugin managers to lazy.nvim
and updated the plugin, so maybe those are factors?
The repeating messages are still showing up, even when I use files outside of my Obsidian vaults. However, autocomplete has started working again with a few strange quirks. With certain files, I have to type the exact beginning of a file to see it. Otherwise it presents me with half the file name. When this happens, the full name might show up at the bottom after a lot of header references – but I haven't observed this happening consistently.
I can also see the pop-up, likely from cmp
, but can't select any of the file names I can see. This might be a quirk of my config, but I don't have this issue typing in any other files or autocompleting any other pop-ups.
Overall, it's a rather confounding issue 😅 Any further troubleshooting tips would be greatly appreciated!
🐛 Describe the bug
Wikilink autocomplete has inexplicably stopped working on my neovim, sometime within the last few days.
:ObsidianFollowLink
has stopped working as well, though sometimes (not sure what is the deciding factor) it andgf
works to follow wikilinks.I thought the bug might resolve itself at first, but alternately commenting my
nvim-cmp
,telescope.nvim
andobsidian.nvim
configurations out to try and isolate the problem hasn't worked out. I've also checked for updates on all plugins and neovim itself.A note on the config pasted below – I realize that the README says not to specify a source on
nvim-cmp
, but mine wasn't picking it up properly until I listedobsidian
,obsidian_tags
, andobsidian_new
. Removing the source specifications don't resolve the problem.P.S. Thank you for this great plugin! It's one of my daily drivers in neovim.
Config
Environment