Skip to content
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

docs(lsp): fix the way of removing items from skipped_servers #2887

Merged
merged 2 commits into from Sep 1, 2022

Conversation

mende1
Copy link
Contributor

@mende1 mende1 commented Aug 8, 2022

Description

The currently way to remove items from skipped_servers list doesn't make any effect on the original list lvim.lsp.automatic_configuration.skipped_servers:

vim.tbl_map(function(server)
  return server ~= "emmet_ls"
end, lvim.lsp.automatic_configuration.skipped_servers)

The function vim.tbl_map only returns a new list with the certain function applied, and doesn't modify the original one. Also, by the example return server ~= "emmet_ls", it doesn't return the list with filtered values, and yes a list with booleans resulted by the function.

The solution for this is just assigning the returned list from the vim.tbl_map function inside the original list lvim.lsp.automatic_configuration.skipped_servers and also changing the function to vim.tbl_filter, because this way makes sense with the function used in the example return server ~= "emmet_ls" to recieve a list with filtered values.

lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
  return server ~= "emmet_ls"
end, lvim.lsp.automatic_configuration.skipped_servers)

Fixes #2501

@kylo252
Copy link
Collaborator

kylo252 commented Aug 9, 2022

related #2503

@lvimuser
Copy link
Collaborator

@kylo252 This should be fine? fwiw, that's what I do and been recommending over discord. This resolves the issue without doing anything special, since it's just a lua table.

@mende1 Can you squash it and fix the commit linter warning?

Error: You have commit messages with errors
✖   body's lines must not be longer than 100 characters [body-max-line-length]

- on: config.example.lua
- why? because tbl_map just return a list of booleans and tbl_filter return a list of items filtered
  by certain function
@kylo252 kylo252 force-pushed the fix/lsp-remove-skipped-servers branch from 32bc5ca to e47d5e7 Compare September 1, 2022 11:39
Copy link
Collaborator

@kylo252 kylo252 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kylo252 kylo252 changed the title fix(lsp): fix the way of removing items from skipped_servers docs(lsp): fix the way of removing items from skipped_servers Sep 1, 2022
@kylo252 kylo252 merged commit 62a1737 into LunarVim:rolling Sep 1, 2022
tomazursic pushed a commit to tomazursic/LunarVim that referenced this pull request Sep 14, 2022
* upstream/rolling:
  fix(plugins): handle deprecated options (LunarVim#3014)
  fix(core/autocmds): do not check for existence on clear_augroup (LunarVim#2963)
  fix(cmp): fix cmp select on CR (LunarVim#2980)
  fix(plugins): bring back original folke repos (LunarVim#2992)
  chore: bump plugins version (LunarVim#2972)
  fix(cmp): do not mutate the original confirm_opts on CR (LunarVim#2979)
  docs(lsp): fix the way of removing items from skipped_servers (LunarVim#2887)
  chore: remove unnecessary code (LunarVim#2923)
  chore: bump plugins version (LunarVim#2925)
  fix(ts_context_commentstring): block comment match new api (LunarVim#2948)
  fix(lsp): pass name arg to should_auto_install (LunarVim#2958)
  refactor(cmp)!: adapt new recommendations (LunarVim#2913)
  fix: update key bindings for comment.nvim to use new api (LunarVim#2926)
tomazursic pushed a commit to tomazursic/LunarVim that referenced this pull request Sep 14, 2022
* upstream/master: (30 commits)
  fix(plugins): handle deprecated options (LunarVim#3014)
  fix(core/autocmds): do not check for existence on clear_augroup (LunarVim#2963)
  fix(cmp): fix cmp select on CR (LunarVim#2980)
  fix(plugins): bring back original folke repos (LunarVim#2992)
  chore: bump plugins version (LunarVim#2972)
  fix(cmp): do not mutate the original confirm_opts on CR (LunarVim#2979)
  docs(lsp): fix the way of removing items from skipped_servers (LunarVim#2887)
  chore: remove unnecessary code (LunarVim#2923)
  chore: update changelog
  chore: bump plugins version (LunarVim#2925)
  fix(ts_context_commentstring): block comment match new api (LunarVim#2948)
  fix(lsp): pass name arg to should_auto_install (LunarVim#2958)
  refactor(cmp)!: adapt new recommendations (LunarVim#2913)
  fix: update key bindings for comment.nvim to use new api (LunarVim#2926)
  chore: bump plugins version (LunarVim#2895)
  feat(installer): handle INSTALL_PREFIX not on PATH (LunarVim#2912)
  docs: fix automatic_servers_installation example (LunarVim#2918)
  docs: fix some typos and enhance readability (LunarVim#2917)
  fix(statusline): display null-ls linters properly (LunarVim#2921)
  docs(windows): update example config (LunarVim#2919)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't remove server from the skipped list
3 participants