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

Visual studio fails to format with error InvalidUtf8 #533

Closed
bpeake13 opened this issue Jul 13, 2022 · 2 comments
Closed

Visual studio fails to format with error InvalidUtf8 #533

bpeake13 opened this issue Jul 13, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bpeake13
Copy link

On windows when trying to format a file I get the following log

[Info  - 1:01:28 AM] [info-main] zls initialized
[Info  - 1:01:28 AM] [info-main] ClientCapabilities{ .supports_snippets = true, .supports_semantic_tokens = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true }
[Info  - 1:01:28 AM] [info-main] Using offset encoding: utf16
[Info  - 1:01:28 AM] [info-main] Requesting configuration!
[Info  - 1:01:28 AM] [info-doc_store] builtin config not found, falling back to default: <file>
[Info  - 1:01:34 AM] [info-doc_store] builtin config not found, falling back to default: <file>
[Warn  - 1:01:34 AM] [warn-doc_store] Failed to load packages of build file <file>
[Info  - 1:01:34 AM] [info-main] Setting configuration...
[Warn  - 1:01:52 AM] [warn-main] Failed to spawn zig fmt process, error: error.InvalidUtf8

It seems like it is using utf16 for some reason, but i dont see a config related to this

@SuperAuguste
Copy link
Member

SuperAuguste commented Jul 14, 2022

zls using utf16 for offsets should be unrelated; also, it's the LSP client that determines which offset encoding should be used, thus why this is not configurable. To me, InvalidUtf8 seems more like some sort of garbage data. Regardless, can you please provide more information/context for this issue?

@SuperAuguste
Copy link
Member

Found the problem; zls config options weren't properly being duped.

@SuperAuguste SuperAuguste transferred this issue from zigtools/zls-vscode Jul 14, 2022
@SuperAuguste SuperAuguste added the bug Something isn't working label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants