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

Add documentation on how to fix utf-16 issue #215

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ capabilities.textDocument.foldingRange = {
}
local language_servers = require("lspconfig").util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
for _, ls in ipairs(language_servers) do
-- Set offsetEncoding for clangd to utf-16 not to cause
-- "warning: multiple different client offset_encodings detected for buffer, this is not supported yet" under certain conditions
-- see https://github.com/LazyVim/LazyVim/issues/3028 for background.
-- This may apply to other language servers as well.
-- if ls == "clangd" then
-- capabilities.offsetEncoding = { "utf-16" }
-- end
require('lspconfig')[ls].setup({
capabilities = capabilities
-- you can add other fields for setting up lsp server in this table
Expand Down