File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require 'provider.inlay-hint'
1111local m = {}
1212
1313m .fillings = {}
14+ m .resolvedMap = {}
1415
1516local function mergeFillings (provider )
1617 for _ , filling in ipairs (m .fillings ) do
@@ -29,6 +30,19 @@ local function mergeFillings(provider)
2930 end
3031end
3132
33+ local function resolve (t )
34+ for k , v in pairs (t ) do
35+ if type (v ) == ' table' then
36+ resolve (v )
37+ end
38+ if type (v ) == ' string' then
39+ t [k ] = v :gsub (' %{(.-)%}' , function (key )
40+ return m .resolvedMap [key ] or ' '
41+ end )
42+ end
43+ end
44+ end
45+
3246function m .getProvider ()
3347 local provider = {
3448 offsetEncoding = client .getOffsetEncoding (),
@@ -52,6 +66,7 @@ function m.getProvider()
5266 nonil .disable ()
5367
5468 mergeFillings (provider )
69+ resolve (provider )
5570
5671 return provider
5772end
@@ -60,4 +75,8 @@ function m.filling(t)
6075 m .fillings [# m .fillings + 1 ] = t
6176end
6277
78+ function m .resolve (key , value )
79+ m .resolvedMap [key ] = value
80+ end
81+
6382return m
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ m.register 'initialize' {
109109
110110 if params .rootUri then
111111 workspace .initRoot (params .rootUri )
112+ cap .resolve (' ROOT_URI' , furi .decode (params .rootUri ):gsub (' \\ ' , ' /' ) .. ' /' )
112113 end
113114
114115 if params .workspaceFolders then
@@ -188,7 +189,10 @@ m.register 'workspace/didRenameFiles' {
188189 filters = {
189190 {
190191 pattern = {
191- glob = ' **' ,
192+ glob = ' {ROOT_URI}**' ,
193+ options = {
194+ ignoreCase = true ,
195+ }
192196 },
193197 },
194198 },
@@ -203,7 +207,7 @@ m.register 'workspace/didRenameFiles' {
203207 for _ , file in ipairs (params .files ) do
204208 local oldUri = furi .normalize (file .oldUri )
205209 local newUri = furi .normalize (file .newUri )
206- if files . exists (oldUri )
210+ if workspace . isValidLuaUri (oldUri )
207211 and workspace .isValidLuaUri (newUri ) then
208212 renames [# renames + 1 ] = {
209213 oldUri = oldUri ,
You can’t perform that action at this time.
0 commit comments