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

fix(lvim/lsp/manager): make client_is_configured more reliable #2851

Merged
merged 1 commit into from Jul 31, 2022
Merged

fix(lvim/lsp/manager): make client_is_configured more reliable #2851

merged 1 commit into from Jul 31, 2022

Conversation

lvimuser
Copy link
Collaborator

Description

A server_name can be the same as its filetype, which will match the given pattern if you set any filetype autocmd for it. This might prevent a server from attaching.

Consider the html lsp. Its server_name is simply html. This might prevent a user from setting up plugins like nvim-colorizer, nvim-ts-autotag or using the emmet lsp in tandem.

Solution:

Use the lua API so we can match the specific command string, which contains only the manager's setup call, instead of trying to match/parse the result of :autocmd.

How Has This Been Tested?

  • Set a 'html' filetype autocommand.
  • Check :LvimInfo.
  • Lsp should be attached.

A server_name can be the same as its filetype, which will match the
given pattern if you set any filetype autocmd for it. This might prevent
a server from attaching.
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!

this is much nicer with the lua API 🚀

related #2544 and #2549 and

@kylo252 kylo252 merged commit b8f6813 into LunarVim:rolling Jul 31, 2022
tomazursic pushed a commit to tomazursic/LunarVim that referenced this pull request Aug 21, 2022
* upstream/rolling: (30 commits)
  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)
  refactor(keymaps)!: don't hijack H/L by default (LunarVim#2874)
  chore: bump plugins version (LunarVim#2893)
  fix(lsp): return the actual resolved mason-config (LunarVim#2889)
  docs(windows): update example config for nvim-tree (LunarVim#2766)
  fix(installer): create profile.ps1 if nonexistent (LunarVim#2810)
  fix(lualine): set icon color according to the status of treesitter (LunarVim#2754)
  feat(lvim/lsp): enable tailwindcss by default (LunarVim#2870)
  fix: handle deprecated telescope.builtin.internal (LunarVim#2885)
  refactor!: migrate to mason.nvim (LunarVim#2880)
  feat(whichkey): add default keybindings to cycle to next buffer (LunarVim#2873)
  fix(installer) comment causes antivirus false positives (LunarVim#2818)
  fix(nvimtree): remove `indent_markers` icons trailing space (LunarVim#2854)
  fix: use pcall for setting up project.nvim (LunarVim#2762)
  fix(lvim/lsp/manager): make client_is_configured more reliable (LunarVim#2851)
  ...
tomazursic pushed a commit to tomazursic/LunarVim that referenced this pull request Aug 21, 2022
* upstream/master: (21 commits)
  chore: update changelog
  fix(installer) comment causes antivirus false positives (LunarVim#2818)
  fix(nvimtree): remove `indent_markers` icons trailing space (LunarVim#2854)
  fix: use pcall for setting up project.nvim (LunarVim#2762)
  fix(lvim/lsp/manager): make client_is_configured more reliable (LunarVim#2851)
  perf(cmp): remove redundant check for emmet-ls (LunarVim#2830)
  chore: update changelog
  feat(lsp): bind formatexpr and omnifunc by default (LunarVim#2865)
  chore: bump plugins version (LunarVim#2723)
  fix(packer): add max_jobs = 40 (LunarVim#2781)
  Update general-issue-form.yaml
  refactor(whichkey): use vim.keymap.set directly (LunarVim#2786)
  fix(core.comment): fix default extra mappings (LunarVim#2768)
  fix: typo in utils/installer/install.sh (LunarVim#2776)
  fix(lsp): update format filter for nightly (LunarVim#2773)
  feat: add commands to open/edit lvim logs (LunarVim#2709)
  fix dap-install (LunarVim#2772)
  feat(lsp): add option to override nlsp-settings (LunarVim#2769)
  feat(lsp): add option to override default `nvim-lsp-installer` settings (LunarVim#2698)
  fix(installer): always use check shallow clones (LunarVim#2763)
  ...
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.

None yet

2 participants