ratmice / nimbleparse_lsp

lsp server for grmtools lex & yacc
Other
7 stars 1 forks source link

Try and make neovim instructions clearer #27

Closed ratmice closed 1 year ago

ratmice commented 1 year ago

Following issue #26 it seemed to be it might be clearer if the instructions took the on_attach function as a parameter, and added a setup function.

I'm personally a bit torn, e.g. i apparently have local modifications to this configuration (which i need to figure out if it requires any plugins, and consider adding):

any thoughts, or opinions @madhavpcm?

local modifications:

  local severity = {
    "error",
    "warn",
    "info",
    "info",
  }
  local handlers = {
        ["window/showMessage"] = function(err, method, params, client_id)
       vim.notify(method.message, severity[params.type])
        end,
  }
  require 'lspconfig.configs'[name] = {
      default_config = {
        autostart = true,
    cmd = cmd,
    -- Don't add filetypes here, not adding them causes it to default to a glob pattern.
    root_dir = util.root_pattern('nimbleparse.toml'),
        settings = {},
    handlers = handlers
      },
 }
madhavpcm commented 1 year ago

I couldnt post updates as I was busy. So these local modifications are supposed to be done on my dotfiles I presume?

Following issue https://github.com/ratmice/nimbleparse_lsp/issues/26 it seemed to be it might be clearer if the instructions took the on_attach function as a parameter, and added a setup function.

Yes this seems nice!

ratmice commented 1 year ago

No worries, I just commited them figuring it was an improvement and we can update them again if necessary.

The local modifications are just changes from the suggested installation instructions that I noticed were in my dotfiles, It deals with using a plugin for displaying notifications from the LSP if I recall. For instance when you edit a nimbleparse.toml it sends a notification that a restart is required though the handlers function.

So I guess what i'm trying to convey is that the nimbleparse.lua file might require some manual editing based on peoples editor/plugin preferences. And i'm not sure if there is a way we can avoid mixing the stuff we need to override with editor setup specific configuration things.

I'm not really that familiar with neovim or lua, so if anyone does have thoughts on that they are more than welcome!

ratmice commented 1 year ago

Nevermind about the local config stuff, I now see that that stuff was actually already documented under the Notifications heading.