Skip to content

Commit 9b10e5e

Browse files
committed
improve some (mostly internal) documentation
1 parent a611d69 commit 9b10e5e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/codegen/codegen.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! This program is executed from the build system to generate type bindings for the LSP specification.
2+
13
const std = @import("std");
24
const MetaModel = @import("MetaModel.zig");
35

@@ -1065,11 +1067,17 @@ fn renderMetaModel(gpa: std.mem.Allocator, meta_model: *MetaModel) error{ OutOfM
10651067

10661068
const Config = struct {
10671069
symbols: []const struct { []const u8, Action },
1070+
/// List of expressions that should be refactored i.e symbolized into a new
1071+
/// declaration to avoid generating anonymous types.
1072+
/// The new name of the declaration will be looked up in `symbols`.
10681073
symbolize: []const []const u8,
10691074

10701075
const Action = union(enum) {
1076+
/// Remove the given symbol.
10711077
remove,
1078+
/// Rename a symbol to the given name.
10721079
rename: []const u8,
1080+
/// Replace every reference of a symbol with a different one.
10731081
replace_with: []const u8,
10741082
};
10751083
};

src/codegen/config.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
.{"DidCloseNotebookDocumentParams", .{ .rename = "NotebookDocument.DidCloseParams" } },
9393
.{"DidOpenNotebookDocumentParams", .{ .rename = "NotebookDocument.DidOpenParams" } },
9494
.{"DidSaveNotebookDocumentParams", .{ .rename = "NotebookDocument.DidSaveParams" } },
95-
95+
9696
.{"NotebookCell", .{ .rename = "NotebookCell" } },
9797
.{"NotebookCellArrayChange", .{ .rename = "NotebookCell.ArrayChange" } },
9898
.{"ExecutionSummary", .{ .rename = "NotebookCell.ExecutionSummary" } },

src/codegen/lsp_types_base.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
//! avoid redundancy in names. See the [Zig Style Guide](https://ziglang.org/documentation/master/#Style-Guide)
55
//!
66
//! Examples:
7-
//! - `CompletionItem` has been renamed to `Completion.Item`
7+
//! - `CompletionItem` has been renamed to `completion.Item`
88
//! - `SemanticTokensRangeParams` has been renamed to `semantic_tokens.Params.Range`
99
//! - `WorkspaceFoldersChangeEvent` has been renamed to `workspace.folders.ChangeEvent`
1010
//! - `CreateFileOptions` has been renamed to `WorkspaceEdit.CreateFile.Options`
1111
//!
1212
//! Contributions that try to improve symbol names are welcome.
1313
//!
14-
//! To find the new name for each symbol, use the `@import("lsp").flat`
14+
//! To find the new name for each symbol, use the `@import("lsp").types.flat`
1515
//! namespace. This can also be used in place of the "ziggified" symbols if
1616
//! the original names in the LSP specification are preferred.
1717

0 commit comments

Comments
 (0)