Skip to content

Conversation

@ayamir
Copy link
Owner

@ayamir ayamir commented May 26, 2025

This path change the lazy load event of nvim-lspconfig to BufReadPre and BufNewFile, to resolve the issue that the lsp servers don't autostart.

@ayamir ayamir requested review from charliie-dev and misumisumi May 26, 2025 06:13
Copy link
Collaborator

@charliie-dev charliie-dev left a comment

Choose a reason for hiding this comment

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

LGTM!

@charliie-dev
Copy link
Collaborator

this PR fixes the issue in #1466

@ayamir ayamir merged commit 53eeeec into 0.11 May 26, 2025
4 checks passed
@ayamir ayamir deleted the fix/load-lspconfig branch May 26, 2025 06:22
Jint-lzxy added a commit that referenced this pull request Aug 1, 2025
Jint-lzxy added a commit that referenced this pull request Aug 1, 2025
This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig
changed how `LspStart` works. Now it only starts one _specific_ server (passed
via the first argument), instead of starting all matching servers automatically.
So we gotta manually start all the servers that match the current filetype
instead.

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
@Jint-lzxy Jint-lzxy mentioned this pull request Aug 1, 2025
ayamir pushed a commit that referenced this pull request Aug 4, 2025
* Revert "fix: remove manual `LspStart`, close #1478. (#1479)"

This reverts commit 7dab4b9.

* Revert "fixup(#1466): load lsp config with proper event. (#1472)"

This reverts commit 53eeeec.

* fix: LSP start logic

This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig
changed how `LspStart` works. Now it only starts one _specific_ server (passed
via the first argument), instead of starting all matching servers automatically.
So we gotta manually start all the servers that match the current filetype
instead.

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

---------

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
ayamir added a commit that referenced this pull request Aug 7, 2025
* Revert "fix: remove manual `LspStart`, close #1478. (#1479)"

This reverts commit 7dab4b9.

* Revert "fixup(#1466): load lsp config with proper event. (#1472)"

This reverts commit 53eeeec.

* fix: LSP start logic

This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig
changed how `LspStart` works. Now it only starts one _specific_ server (passed
via the first argument), instead of starting all matching servers automatically.
So we gotta manually start all the servers that match the current filetype
instead.

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

* fix: redundant return

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

* fix: invoke `:LspStart` correctly

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

---------

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
ayamir added a commit that referenced this pull request Aug 7, 2025
* feat(mason)!: migrate to v2.x

Just wrapped up going thru all the changes in mason 2.x (and nvim 0.11 too)!
This should be a follow up to #1466 and (hopefully) fix all the issues related
to the updated LSP API (like servers not spawning and other weirdness) and works
together w #1496.

Acc the main issue was that some mason package names don't match their names in
lspconfig, so just using `lsp_deps` directly works for most, but breaks a bunch
of others (tldr: that mismatch is what was causing all the edge cases and broken
behavior).

I also went ahead and enabled `automatic_installation` because why not lol means
we don't have to manually call `vim.lsp.enable()` for everything, which might
save a tiny bit of perf too.

Didn't test this super thoroughly yet so pls lmk if anything's still broken!

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

* fixup! feat(mason)!: migrate to v2.x

* fixup! feat(mason)!: migrate to v2.x

* fixup! feat(mason)!: migrate to v2.x

* fix: LSP start logic (#1496)

* Revert "fix: remove manual `LspStart`, close #1478. (#1479)"

This reverts commit 7dab4b9.

* Revert "fixup(#1466): load lsp config with proper event. (#1472)"

This reverts commit 53eeeec.

* fix: LSP start logic

This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig
changed how `LspStart` works. Now it only starts one _specific_ server (passed
via the first argument), instead of starting all matching servers automatically.
So we gotta manually start all the servers that match the current filetype
instead.

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

---------

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

* fix: unresolved nvim_lsp

* feat(lsp): unify language server setup

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>

---------

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
Co-authored-by: ayamir <lgt986452565@gmail.com>
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.

3 participants