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

regenerate diagnostics when zig executable has changed #1733

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/DocumentStore.zig
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@
return @bitCast(self.impl.status.load(.Acquire));
}

pub fn isOpen(self: Handle) bool {
return self.getStatus().open;

Check warning on line 363 in src/DocumentStore.zig

View check run for this annotation

Codecov / codecov/patch

src/DocumentStore.zig#L362-L363

Added lines #L362 - L363 were not covered by tests
}

/// returns the previous value
fn setOpen(self: *Handle, open: bool) bool {
if (open) {
Expand Down
7 changes: 7 additions & 0 deletions src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,13 @@
}

if (server.status == .initialized) {
if (new_zig_exe_path and server.client_capabilities.supports_publish_diagnostics) {
for (server.document_store.handles.values()) |handle| {
if (!handle.isOpen()) continue;
try server.pushJob(.{ .generate_diagnostics = try server.allocator.dupe(u8, handle.uri) });

Check warning on line 901 in src/Server.zig

View check run for this annotation

Codecov / codecov/patch

src/Server.zig#L898-L901

Added lines #L898 - L901 were not covered by tests
}
}

const json_message = try server.sendToClientRequest(
.{ .string = "semantic_tokens_refresh" },
"workspace/semanticTokens/refresh",
Expand Down
Loading