summaryrefslogtreecommitdiff
path: root/test/completion/continue.lua
blob: 4159ea7ac940d2b5939b44956e5e0aecf9d11b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
local define = require 'proto.define'
local config = require 'config'

config.set('Lua.completion.callSnippet',    'Disable')
config.set('Lua.completion.keywordSnippet', 'Disable')
config.set('Lua.completion.workspaceWord',  false)

ContinueTyping = true

TEST [[
local zabcde
za$
]]
{
    {
        label = 'zabcde',
        kind = define.CompletionItemKind.Variable,
    }
}

TEST [[
-- zabcde
io.z$
]]
{
    {
        label = 'zabcde',
        kind = define.CompletionItemKind.Text,
    }
}


TEST [[
-- provider
pro$
]]
{
    {
        label = 'provider',
        kind = define.CompletionItemKind.Text,
    }
}

TEST [[
---@param n '"abcdefg"'
local function f(n) end

f 'abc$'
]]
{
    {
        label    = "'abcdefg'",
        kind     = define.CompletionItemKind.EnumMember,
        textEdit = EXISTS,
    }
}

TEST [[
---@type '"abcdefg"'
local t

if t == 'abc$'
]]
{
    {
        label    = "'abcdefg'",
        kind     = define.CompletionItemKind.EnumMember,
        textEdit = EXISTS,
    }
}

ContinueTyping = false