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 = &.{"("},
.retriggerCharacters = &.{","},
},
.textDocumentSync = .Full,
.textDocumentSync = .{
.openClose = true,
.change = .Full,
.save = true,
},
.renameProvider = true,
.completionProvider = .{ .resolveProvider = false, .triggerCharacters = &[_][]const u8{ ".", ":", "@", "]" }, .completionItem = .{ .labelDetailsSupport = 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.
const InitializeResult = struct {
offsetEncoding: PositionEncodingKind,
@ -437,14 +447,10 @@ const InitializeResult = struct {
triggerCharacters: []const string,
retriggerCharacters: []const string,
},
textDocumentSync: 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);
}
textDocumentSync: struct {
openClose: bool,
change: TextDocumentSyncKind,
save: bool,
},
renameProvider: bool,
completionProvider: struct {