Skip to content

Commit

Permalink
revert(lsp): defer attaching client to BufEnter (#409)
Browse files Browse the repository at this point in the history
This reverts commit 90bfbc5.
  • Loading branch information
mrcjkb committed May 25, 2024
1 parent 90bfbc5 commit 9d3ee35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
7 changes: 0 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- LSP: Defer attaching the LSP client to `BufEnter` for a smoother experience
on low-end devices.

## [4.23.5] - 2024-05-24

### Fixed
Expand Down
11 changes: 2 additions & 9 deletions ftplugin/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,12 @@ end

vim.g.loaded_rustaceanvim = true

local bufnr = vim.api.nvim_get_current_buf()
local auto_attach = config.server.auto_attach
if type(auto_attach) == 'function' then
local bufnr = vim.api.nvim_get_current_buf()
auto_attach = auto_attach(bufnr)
end

if auto_attach then
-- Defer for a smoother experience on low-end devices
vim.api.nvim_create_autocmd('BufEnter', {
buffer = bufnr,
group = vim.api.nvim_create_augroup('RustaceanvimAttach', { clear = true }),
callback = function()
require('rustaceanvim.lsp').start()
end,
})
require('rustaceanvim.lsp').start()
end

0 comments on commit 9d3ee35

Please sign in to comment.