-
Notifications
You must be signed in to change notification settings - Fork 15
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
[Feature Request] Use w/o lspconfig
#167
Comments
Agreed, I always like removing dependencies :) I will just copy the the root dir function over into our own utils. As far as otter is concerned: local autocommands = api.nvim_get_autocmds({ group = "lspconfig", pattern = lang }) if one doesn't set the filetype, in order to activate just the language server and not other autocommands you might not need for the hidden otter buffer. However, that doesn't mean that the |
Glad to hear it; just hope it can help! So OK, in the past hour I got a local fork of -- Delete 'local util = require 'lspconfig.util', of course
-- ...
local root_dir = vim.fs.dirname(vim.fs.find({'_quarto.yml'}, { path = buffer_path, type = 'file', upward = true })[1]) This is more of a quick hack than anything, but seems to work well so far. It does presume that there's no such thing as a Quarto project that doesn't have a Maybe some kind of
|
yeah, I think the filetype setting generally just works and wanting actual files on disk tends be the case with some linters (your ruff). I don't think you need
This raises the question if there is some standard way |
the augroup is here: https://github.com/neovim/nvim-lspconfig/blob/d37812c49063eda10ad1f7c7695509365ac7bd47/lua/lspconfig/configs.lua#L63 But like I said, you can create your own augroup that happens to have the same name and do your lsp autoloading in there, then otter also picks it up. Or just keep setting the ft. |
I'm putting together a config that uses the native neovim LSP configuration, without
lspconfig
(ormason
). Since my life is primarily a stack of Quarto documents at this point, being able to use the handy functionality provided byquarto-nvim
is close to my heart.Unfortunately, as far as I know, it is impossible to use
quarto-nvim
withoutlspconfig
, since one of the very first thingsquarto-nvim
does islocal util = require 'lspconfig.util'
. As far as I can tell, the only reason this is done is to access the root directory:local root_dir = util.root_pattern '_quarto.yml'(buffer_path)
.I was hoping you might consider removing the hard-dependency on
lspconfig
, by allowing the project root to be found by some other means (ex. a "you're on your own" config option where I provide my ownroot_dir
finding logic).Thank you for your time, and for
quarto-nvim
!-Sof
What's Wrong with
lspconfig
?Well, nothing. It's great! I refer to it frequently when configuring
nvim
. It is, however, opinionated. And its opinions differ from mine 😛 .nvim
's LSP system is itself not so opinionated (the slogan ofnvim
, perhaps). Perhaps not quite opinionated enough. As of recently, however, it seems thatnvim
can increasingly do more and more of the "really important" parts oflspconfig
's job, like finding root folders based on markers and/or a custom function. It also seems that there's far less plumbing in today's nightlynvim
. So I ask, why should I bring in in a massive plugin likelspconfig
, which itself has a lot of nuanced functionality, for somethingnvim
actually already does sufficiently?My point is not so much to convince anybody, or claim "
lspconfig
is bad now". My point is there are valid reasons why it may not always desirable to uselspconfig
, and that the flexibility of catering to this may be worth the effort!But Isn't Non-
lspconfig
LSP Pretty Low Level?Not really - though resources can be sparse, since
lspconfig
style configs dominates search engine results.Suppose one wants
ruff
integration. Justuv tool install ruff
, then create this auto-discovered file:Then, one just needs an
LspAttach
autocmd:The official LSP docs helps fill in the blanks, including examples of how to wire up
textDocument/formatting
.But Doesn't
otter.nvim
requirelspconfig
Too?Officially, sure. As it turns out, when
write_to_disk = true
, therequire('lspconfig')
doesn't seem to be called. Apart from that, an autocmd onFileType
that callsrequire('otter').activate()
seems to transitively jiggleLspAttach
just fine.Here's my (seemingly) working
lazy.nvim
config:The text was updated successfully, but these errors were encountered: