summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-07-04 15:40:36 -0700
committer最萌小汐 <sumneko@hotmail.com>2024-07-15 12:38:56 +0800
commitb7730378a3af41acc15fcd9312fcbce549c0911a (patch)
tree1b4ad9c79e0a5c1d0003265ea8b2a0c68205ce3c
parentddc96bd1ec0be95a985ab82531763578bf7eb793 (diff)
downloadlua-language-server-b7730378a3af41acc15fcd9312fcbce549c0911a.zip
Align inlay hint spacing with other LSPs
-rw-r--r--changelog.md1
-rw-r--r--script/core/hint.lua2
-rw-r--r--script/provider/provider.lua4
3 files changed, 4 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md
index 87ef33ef..e38ccdb7 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,6 +7,7 @@
* `NEW` Add support for lambda style functions, `|paramList| expr` is syntactic sugar for `function(paramList) return expr end`
* `FIX` Respect `completion.showParams` config for local function completion
* `CHG` Improve performance of multithreaded `--check` and `undefined-field` diagnostic
+* `CHG` Change spacing of parameter inlay hints to match other LSPs, like `rust-analyzer`
## 3.9.3
`2024-6-11`
diff --git a/script/core/hint.lua b/script/core/hint.lua
index 67ac8516..9d098aa9 100644
--- a/script/core/hint.lua
+++ b/script/core/hint.lua
@@ -59,7 +59,7 @@ local function typeHint(uri, results, start, finish)
end
mark[src] = true
results[#results+1] = {
- text = ':' .. view,
+ text = ': ' .. view,
offset = src.finish,
kind = define.InlayHintKind.Type,
where = 'right',
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 15e78b9a..2e2fb5eb 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -1426,8 +1426,8 @@ m.register 'textDocument/inlayHint' {
},
position = converter.packPosition(state, res.offset),
kind = res.kind,
- paddingLeft = res.kind == 1,
- paddingRight = res.kind == 2,
+ paddingLeft = false,
+ paddingRight = res.kind == define.InlayHintKind.Parameter,
}
end
return hintResults