mauricioszabo / generic-lsp

MIT License
11 stars 0 forks source link

[Feature Request] Fallback to the current file directory if there is no active project #9

Closed Spiker985 closed 1 year ago

Spiker985 commented 2 years ago

It looks like the init-lsp function uses the project directory to set the workspaceFolders for the lsp server.

It may make sense to fall back to atom.workspace.getActiveTextEditor().getDirectoryPath() and atom.workspace.getActiveTextEditor().getFileName() if atom.project.getPaths() is empty - in the event that someone only has a single file open, but would still like to use a LSP.

mauricioszabo commented 1 year ago

I would be possible, BUT - at least clojure-lsp, rust-analyzer and clangd all expect to see some specific files on the workspace path. So, while it would allow you to run the LSP server, it will probably not be useful and it'll report weird, invalid, and confusing things...