Skip to content

'textDocument/completion' provider should check whether completion is enabled #3137

@jllv

Description

@jllv

m.register 'textDocument/completion' {
---@async
function (params)
local uri = files.getRealUri(params.textDocument.uri)
if not workspace.isReady(uri) then
return nil
end

Before checking whether the workspace is ready, I think as a first step the config value of 'Lua.completion.enable' should be checked.

Compare 'textDocument/hover' as a reference:

m.register 'textDocument/hover' {
capability = {
hoverProvider = true,
},
abortByFileUpdate = true,
---@async
function (params)
local doc = params.textDocument
local uri = files.getRealUri(doc.uri)
if not config.get(uri, 'Lua.hover.enable') then
return
end
if not workspace.isReady(uri) then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions