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
73
74
75
76
77
78
|
Execute(ale#lsp#message#Initialize() should return correct messages):
AssertEqual
\ [
\ 0,
\ 'initialize',
\ {
\ 'processId': getpid(),
\ 'rootUri': '/foo/bar',
\ 'capabilities': {},
\ }
\ ],
\ ale#lsp#message#Initialize('/foo/bar')
Execute(ale#lsp#message#Initialized() should return correct messages):
AssertEqual [1, 'initialized'], ale#lsp#message#Initialized()
Execute(ale#lsp#message#Shutdown() should return correct messages):
AssertEqual [0, 'shutdown'], ale#lsp#message#Shutdown()
Execute(ale#lsp#message#Exit() should return correct messages):
AssertEqual [1, 'exit'], ale#lsp#message#Exit(),
Execute(ale#lsp#message#DidOpen() should return correct messages):
AssertEqual
\ [
\ 1,
\ 'textDocument/didOpen',
\ {
\ 'textDocument': {
\ 'uri': '/foo/bar',
\ 'languageId': 'typescript',
\ 'version': 123,
\ 'text': 'foobar',
\ },
\ }
\ ],
\ ale#lsp#message#DidOpen('/foo/bar', 'typescript', 123, 'foobar')
Execute(ale#lsp#message#DidChange() should return correct messages):
AssertEqual
\ [
\ 1,
\ 'textDocument/didChange',
\ {
\ 'textDocument': {
\ 'uri': '/foo/bar',
\ 'version': 123,
\ },
\ 'contentChanges': [{'text': 'foobar'}],
\ }
\ ],
\ ale#lsp#message#DidChange('/foo/bar', 123, 'foobar')
Execute(ale#lsp#message#DidSave() should return correct messages):
AssertEqual
\ [
\ 1,
\ 'textDocument/didSave',
\ {
\ 'textDocument': {
\ 'uri': '/foo/bar',
\ },
\ }
\ ],
\ ale#lsp#message#DidSave('/foo/bar')
Execute(ale#lsp#message#DidClose() should return correct messages):
AssertEqual
\ [
\ 1,
\ 'textDocument/didClose',
\ {
\ 'textDocument': {
\ 'uri': '/foo/bar',
\ },
\ }
\ ],
\ ale#lsp#message#DidClose('/foo/bar')
|