Skip to content

Commit b773037

Browse files
ribru17sumneko
authored andcommitted
Align inlay hint spacing with other LSPs
1 parent ddc96bd commit b773037

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* `NEW` Add support for lambda style functions, `|paramList| expr` is syntactic sugar for `function(paramList) return expr end`
88
* `FIX` Respect `completion.showParams` config for local function completion
99
* `CHG` Improve performance of multithreaded `--check` and `undefined-field` diagnostic
10+
* `CHG` Change spacing of parameter inlay hints to match other LSPs, like `rust-analyzer`
1011

1112
## 3.9.3
1213
`2024-6-11`

script/core/hint.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ local function typeHint(uri, results, start, finish)
5959
end
6060
mark[src] = true
6161
results[#results+1] = {
62-
text = ':' .. view,
62+
text = ': ' .. view,
6363
offset = src.finish,
6464
kind = define.InlayHintKind.Type,
6565
where = 'right',

script/provider/provider.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ m.register 'textDocument/inlayHint' {
14261426
},
14271427
position = converter.packPosition(state, res.offset),
14281428
kind = res.kind,
1429-
paddingLeft = res.kind == 1,
1430-
paddingRight = res.kind == 2,
1429+
paddingLeft = false,
1430+
paddingRight = res.kind == define.InlayHintKind.Parameter,
14311431
}
14321432
end
14331433
return hintResults

0 commit comments

Comments
 (0)