Merge pull request #642 from Techatrix/dev
Correctly handle anytype in inlay hint tooltips
This commit is contained in:
commit
58a83ffd25
@ -118,10 +118,15 @@ fn writeCallHint(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *Doc
|
|||||||
const no_alias = if (param.comptime_noalias) |t| token_tags[t] == .keyword_noalias or token_tags[t - 1] == .keyword_noalias else false;
|
const no_alias = if (param.comptime_noalias) |t| token_tags[t] == .keyword_noalias or token_tags[t - 1] == .keyword_noalias else false;
|
||||||
const comp_time = if (param.comptime_noalias) |t| token_tags[t] == .keyword_comptime or token_tags[t - 1] == .keyword_comptime else false;
|
const comp_time = if (param.comptime_noalias) |t| token_tags[t] == .keyword_comptime or token_tags[t - 1] == .keyword_comptime else false;
|
||||||
|
|
||||||
|
const tooltip = if (param.anytype_ellipsis3) |token|
|
||||||
|
if (token_tags[token] == .keyword_anytype) "anytype" else ""
|
||||||
|
else
|
||||||
|
decl_tree.getNodeSource(param.type_expr);
|
||||||
|
|
||||||
try builder.appendParameterHint(
|
try builder.appendParameterHint(
|
||||||
tree.tokenLocation(0, tree.firstToken(call.ast.params[i])),
|
tree.tokenLocation(0, tree.firstToken(call.ast.params[i])),
|
||||||
decl_tree.tokenSlice(param.name_token.?),
|
decl_tree.tokenSlice(param.name_token.?),
|
||||||
decl_tree.getNodeSource(param.type_expr),
|
tooltip,
|
||||||
no_alias,
|
no_alias,
|
||||||
comp_time,
|
comp_time,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user