explicit request didSave notification from client (#676)

This commit is contained in:
Techatrix 2022-09-28 18:07:24 +02:00 committed by GitHub
parent ecf4e112a5
commit f3889cfe8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

View File

@ -1532,7 +1532,11 @@ fn initializeHandler(server: *Server, writer: anytype, id: types.RequestId, req:
.triggerCharacters = &.{"("}, .triggerCharacters = &.{"("},
.retriggerCharacters = &.{","}, .retriggerCharacters = &.{","},
}, },
.textDocumentSync = .Full, .textDocumentSync = .{
.openClose = true,
.change = .Full,
.save = true,
},
.renameProvider = true, .renameProvider = true,
.completionProvider = .{ .resolveProvider = false, .triggerCharacters = &[_][]const u8{ ".", ":", "@", "]" }, .completionItem = .{ .labelDetailsSupport = true } }, .completionProvider = .{ .resolveProvider = false, .triggerCharacters = &[_][]const u8{ ".", ":", "@", "]" }, .completionItem = .{ .labelDetailsSupport = true } },
.documentHighlightProvider = true, .documentHighlightProvider = true,

View File

@ -429,6 +429,16 @@ pub const PositionEncodingKind = enum {
} }
}; };
const TextDocumentSyncKind = enum(u32) {
None = 0,
Full = 1,
Incremental = 2,
pub fn jsonStringify(value: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void {
try std.json.stringify(@enumToInt(value), options, out_stream);
}
};
// Only includes options we set in our initialize result. // Only includes options we set in our initialize result.
const InitializeResult = struct { const InitializeResult = struct {
offsetEncoding: PositionEncodingKind, offsetEncoding: PositionEncodingKind,
@ -437,14 +447,10 @@ const InitializeResult = struct {
triggerCharacters: []const string, triggerCharacters: []const string,
retriggerCharacters: []const string, retriggerCharacters: []const string,
}, },
textDocumentSync: enum(u32) { textDocumentSync: struct {
None = 0, openClose: bool,
Full = 1, change: TextDocumentSyncKind,
Incremental = 2, save: bool,
pub fn jsonStringify(value: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void {
try std.json.stringify(@enumToInt(value), options, out_stream);
}
}, },
renameProvider: bool, renameProvider: bool,
completionProvider: struct { completionProvider: struct {