Skip to content
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: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
.hash = "diffz-0.0.1-G2tlIWTPAQAvAIoMPQjGnqr9NlOGV8ETeDELVd9pwlwO",
},
.lsp_kit = .{
.url = "https://github.com/zigtools/lsp-kit/archive/c46ac866dda11ab58e4ba71ed0d8ba21f43e81db.tar.gz",
.hash = "lsp_kit-0.1.0-bi_PL98yCgBfW3T4iLkfV5VOXc__pOpOsQsX1tRmpqAG",
.url = "https://github.com/zigtools/lsp-kit/archive/7c4578feceb23d3bec0b4ffa5cd95c9ab54fb719.tar.gz",
.hash = "lsp_kit-0.1.0-bi_PL3ovDAC7I8o8EfDmBdPnYdebO3cO-kbg-iy1gpKM",
},
.tracy = .{
.url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.13.0.tar.gz",
Expand Down
6 changes: 3 additions & 3 deletions deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ linkFarm "zig-packages" [
};
}
{
name = "lsp_kit-0.1.0-bi_PL98yCgBfW3T4iLkfV5VOXc__pOpOsQsX1tRmpqAG";
name = "lsp_kit-0.1.0-bi_PL3ovDAC7I8o8EfDmBdPnYdebO3cO-kbg-iy1gpKM";
path = fetchzip {
url = "https://github.com/zigtools/lsp-kit/archive/c46ac866dda11ab58e4ba71ed0d8ba21f43e81db.tar.gz";
hash = "sha256-FQ1l2ie50QNuLSUrEyFwrfab1tL4H+lDBe5K7SYJ6kM=";
url = "https://github.com/zigtools/lsp-kit/archive/7c4578feceb23d3bec0b4ffa5cd95c9ab54fb719.tar.gz";
hash = "sha256-d4U0FJ8dLDtmmMatdEe1LUoZmi70CDG99nx+iZUbvFw=";
};
}
]
12 changes: 6 additions & 6 deletions src/DiagnosticsCollection.zig
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pub fn publishDiagnostics(collection: *DiagnosticsCollection) (std.mem.Allocator
var diagnostics: std.ArrayList(lsp.types.Diagnostic) = .empty;
try collection.collectLspDiagnosticsForDocument(document_uri, collection.offset_encoding, arena_allocator.allocator(), &diagnostics);

const notification: lsp.TypedJsonRPCNotification(lsp.types.PublishDiagnosticsParams) = .{
const notification: lsp.TypedJsonRPCNotification(lsp.types.publish_diagnostics.Params) = .{
.method = "textDocument/publishDiagnostics",
.params = .{
.uri = document_uri.raw,
Expand Down Expand Up @@ -361,7 +361,7 @@ fn convertErrorBundleToLSPDiangostics(

const eb_notes = eb.getNotes(msg_index);
const relatedInformation = if (eb_notes.len == 0) null else blk: {
const lsp_notes = try arena.alloc(lsp.types.DiagnosticRelatedInformation, eb_notes.len);
const lsp_notes = try arena.alloc(lsp.types.Diagnostic.RelatedInformation, eb_notes.len);
for (lsp_notes, eb_notes) |*lsp_note, eb_note_index| {
const eb_note = eb.getErrorMessage(eb_note_index);
if (eb_note.src_loc == .none) continue;
Expand All @@ -386,12 +386,12 @@ fn convertErrorBundleToLSPDiangostics(
break :blk lsp_notes;
};

var tags: std.ArrayList(lsp.types.DiagnosticTag) = .empty;
var tags: std.ArrayList(lsp.types.Diagnostic.Tag) = .empty;

var message: []const u8 = eb.nullTerminatedString(err.msg);

if (std.mem.startsWith(u8, message, "unused ")) {
try tags.append(arena, lsp.types.DiagnosticTag.Unnecessary);
try tags.append(arena, .Unnecessary);
}
if (std.mem.eql(u8, message, "found compile log statement")) {
message = try std.fmt.allocPrint(arena, "{s}\n\nCompile Log Output:\n{s}", .{ message, eb.getCompileLogOutput() });
Expand Down Expand Up @@ -510,7 +510,7 @@ test DiagnosticsCollection {
try collection.collectLspDiagnosticsForDocument(uri, .@"utf-8", arena, &diagnostics);

try std.testing.expectEqual(1, diagnostics.items.len);
try std.testing.expectEqual(lsp.types.DiagnosticSeverity.Error, diagnostics.items[0].severity);
try std.testing.expectEqual(lsp.types.Diagnostic.Severity.Error, diagnostics.items[0].severity);
try std.testing.expectEqualStrings("Living For The City", diagnostics.items[0].message);
try std.testing.expectEqual(null, diagnostics.items[0].relatedInformation);
}
Expand Down Expand Up @@ -580,7 +580,7 @@ test "DiagnosticsCollection - compile_log_text" {
try collection.collectLspDiagnosticsForDocument(src_uri, .@"utf-8", arena, &diagnostics);

try std.testing.expectEqual(1, diagnostics.items.len);
try std.testing.expectEqual(lsp.types.DiagnosticSeverity.Error, diagnostics.items[0].severity);
try std.testing.expectEqual(lsp.types.Diagnostic.Severity.Error, diagnostics.items[0].severity);
try std.testing.expectEqualStrings(
\\found compile log statement
\\
Expand Down
6 changes: 3 additions & 3 deletions src/DocumentStore.zig
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ fn notifyBuildStart(self: *DocumentStore) void {
.jsonrpc = "2.0",
.id = "progress",
.method = "window/workDoneProgress/create",
.params = lsp.types.WorkDoneProgressCreateParams{
.params = lsp.types.window.work_done_progress.CreateParams{
.token = .{ .string = progress_token },
},
},
Expand All @@ -884,7 +884,7 @@ fn notifyBuildStart(self: *DocumentStore) void {
.method = "$/progress",
.params = .{
.token = progress_token,
.value = lsp.types.WorkDoneProgressBegin{
.value = lsp.types.window.work_done_progress.Begin{
.title = "Loading build configuration",
},
},
Expand Down Expand Up @@ -917,7 +917,7 @@ fn notifyBuildEnd(self: *DocumentStore, status: EndStatus) void {
.method = "$/progress",
.params = .{
.token = progress_token,
.value = lsp.types.WorkDoneProgressEnd{
.value = lsp.types.window.work_done_progress.End{
.message = message,
},
},
Expand Down
Loading