fix builtin completion
This commit is contained in:
parent
84837dfe58
commit
fb9f50d606
10
src/main.zig
10
src/main.zig
@ -411,7 +411,15 @@ fn processJsonRpc(parser: *std.json.Parser, json: []const u8) !void {
|
|||||||
const pos_index = try document.positionToIndex(pos);
|
const pos_index = try document.positionToIndex(pos);
|
||||||
const char = document.text[pos_index];
|
const char = document.text[pos_index];
|
||||||
|
|
||||||
if (char == '@') {
|
var check_for_builtin_pos = pos_index;
|
||||||
|
var is_builtin = false;
|
||||||
|
|
||||||
|
while (check_for_builtin_pos > 0) : (check_for_builtin_pos -= 1) {
|
||||||
|
if (document.text[check_for_builtin_pos] == '@') {is_builtin = true; break;}
|
||||||
|
if (!std.ascii.isAlpha(document.text[check_for_builtin_pos])) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_builtin) {
|
||||||
try send(types.Response{
|
try send(types.Response{
|
||||||
.id = .{.Integer = id},
|
.id = .{.Integer = id},
|
||||||
.result = .{
|
.result = .{
|
||||||
|
Loading…
Reference in New Issue
Block a user