Open ag91 opened 3 years ago
In my use case,
(lsp-session-folders)
returns a list containing both "/my-dir" and "/my-dir/". The last--max-by
will pick the second.
This should not happen. Can you provide steps to reproduce?
Mmm, okay. On my system the way I can reproduce this is by cloning a repository in the /tmp/ directory. At that point (lsp-find-session-folder (lsp-session) "build.sbt")
gives me "/tmp/", which it is strange in itself.
The other projects I have that cause the issue are old: I have been using lsp-metals on them from a long time and maybe before the directory was stored with the final "/"?
Maybe I can try to reset those projects: how would I do that?
Hi, thank you very much for this mode! I am starting appreciating it just now and I am really happy with my Scala development!
I was trying to analyze the stacktrace in a sbt-mode buffer, and for some weird reasons the lsp-session was not recognized.
The issue is
lsp-find-session-folder
because the current implementation is:In my use case,
(lsp-session-folders)
returns a list containing both "/my-dir" and "/my-dir/". The last--max-by
will pick the second. The problem arises withlsp-find-workspace
, the current implementation:The bit
(gethash (lsp-find-session-folder session file-name) folder->servers)
works only for/my-dir
and NOT for/my-dir/
. I guess this bug escaped you because the file-name field is optional and probably not very used. I can open a PR to fix it, but I would need the maintainers wisdom to understand if it is better fixing that inlsp-find-workspace
because maybe changinglsp-find-session-folder
may break other things.Again thanks for the amazing work!