Skip to content

Commit 1fd2578

Browse files
committed
update
1 parent fe92165 commit 1fd2578

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lua/phoenix/init.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,8 @@ function server.create()
567567
end
568568

569569
function srv.completion(params, callback)
570-
local uri = params.textDocument.uri
571570
local position = params.position
572-
local filename = uri:gsub('file://', '')
571+
local filename = vim.uri_to_fname(params.textDocument.uri)
573572
local root = get_root(filename)
574573

575574
if not root then
@@ -674,6 +673,15 @@ function server.create()
674673
end
675674
end
676675

676+
srv['textDocument/didClose'] = function(params)
677+
local filename = vim.uri_to_fname(params.textDocument.uri)
678+
local root = get_root(filename)
679+
if not root then
680+
return
681+
end
682+
root[filename] = nil
683+
end
684+
677685
function srv.shutdown(params, callback)
678686
callback(nil, nil)
679687
end

0 commit comments

Comments
 (0)