artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
1.82k stars 33 forks source link

Too many levels of symbolic links #317

Open adrianlzt opened 1 month ago

adrianlzt commented 1 month ago

I have a directory with many markdown files used to take notes. In that directory structure there are symbolic links doing circular paths. For example: /home/adrian/adrianRepo/web/apps/google/programacion -> ../../../programacion/google /home/adrian/adrianRepo/programacion/google/apps -> /home/adrian/adrianRepo/web/apps/google

This seems to configure marksman returning this error:

[ERROR][2024-06-12 18:04:14] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "[18:04:14 INF] <LSP Entry> Starting Marksman LSP server: {}\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "---------------------------------------------------------------------------"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "Marksman encountered a fatal error\nPlease, report the error at https://github.com/artempyanykh/marksman/issues\n---------------------------------------------------------------------------\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "Marksman version: "
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "1.0.0.0\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "OS: Arch Linux\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "Arch: "
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "X64\n---------------------------------------------------------------------------\n"
[ERROR][2024-06-12 18:04:18] .../vim/lsp/rpc.lua:770    "rpc"   "/home/adrian/.local/share/nvim/mason/bin/marksman"     "stderr"        "Too many levels of symbolic links : '/home/adrian/adrianRepo/programacion/google/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/ap
ps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/programacion/apps/gmail/script.md'\n"

I'm not sure how this could be fixed, but I think circular symbolic links could be normal.

Thanks!

artempyanykh commented 1 week ago

Thanks for reporting this @adrianlzt! I understand the problem. Not sure what's the best way to solve it though. Need to think for a bit.

(some vague concerns around uniqueness of paths to documents and also resolving symlinks to folders outside of the root folder; maybe reading workspace folder in a BFS fashion and picking the shortest paths could be enough...)

adrianlzt commented 1 week ago

Maybe just ignoring symlinks? Or an option to ignore them.