tamago324 / nlsp-settings.nvim

A plugin for setting Neovim LSP with JSON or YAML files
MIT License
316 stars 18 forks source link

Windows fixes and stuff #19

Closed lopi-py closed 2 years ago

lopi-py commented 2 years ago

fix(windows): use path.sanitize to handle correctly windows paths with lspconfig fix(config): config.values.float -> config.values.local_settings_rootmarkers fix(core): changed typo err -> err in nlspsettings.lua when checking local config errors feat(log): use nvim-notify if available or vim.notify feat(selection): use vim.ui.select to select a server feat(path): use lspconfig.util.path to handle path stuff like is_file, is_dir, etc feat(array): use next() to check if an array is empty fix(local-buf-config): vim.lsp.get_client_by_id(server.client_id) was used where server is getted from get_server_name() so doesn't make sense(because a string does not have the client_id property)

example of vim.ui.select with dressing(without dressing looks like before) example of nvim-notify

tamago324 commented 2 years ago

Thank you for the PR. Sorry for the late reply.

I would like to make the nvim-notify thing optional. So, I would like to set the default value in config.lua as follows.

local defaults_values = {
  ...
  nvim_notify = {
    enable = false,
    timeout = 5000,
  }
}

I think it will also change the command.lua.

local log = function(message, level)
  local title = 'NLsp Settings'

  local config_notify = config.get('nvim_notify')
  if notify and config_notify and config_notify.enable then
    notify(message, level, {
      title = title,
      timeout = config_notify.timeout,
    })
  else
    vim.notify(('[%s] '):format(title) .. message, level)
  end
end

Please also change the README.

## Installation

Plug 'neovim/nvim-lspconfig'
Plug 'tamago324/nlsp-settings.nvim'

" Recommend
Plug 'williamboman/nvim-lsp-installer'

" Optional
Plug 'rcarriga/nvim-notify'

Also, please add it to the help file.

lopi-py commented 2 years ago
local defaults_values = {
  ...
  nvim_notify = {
    enable = false,
    timeout = 5000,
  }
}

I think it should be enabled by default

tamago324 commented 2 years ago

I'm sorry. I prefer off by default.
The feature should be explicitly enabled by the user.

Also, thank you for adding the stylua config file.

lopi-py commented 2 years ago

It's disabled btw

tamago324 commented 2 years ago

I'm going to merge it as is, and I'm sorry if it offends you.

Thank you for your contribution.

lopi-py commented 2 years ago

I'm sorry if it offends you.

dw, doesn't matter