All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 Execute(Invalid results should be handled):
2 AssertEqual [[], []], ale#hover#ParseLSPResult(0)
3 AssertEqual [[], []], ale#hover#ParseLSPResult([0])
4 AssertEqual [[], []], ale#hover#ParseLSPResult('')
5 AssertEqual [[], []], ale#hover#ParseLSPResult({})
6 AssertEqual [[], []], ale#hover#ParseLSPResult([{}])
7 AssertEqual [[], []], ale#hover#ParseLSPResult([''])
8 AssertEqual [[], []], ale#hover#ParseLSPResult({'value': ''})
9 AssertEqual [[], []], ale#hover#ParseLSPResult([{'value': ''}])
10 AssertEqual [[], []], ale#hover#ParseLSPResult({'kind': 'markdown'})
11 AssertEqual [[], []], ale#hover#ParseLSPResult({'kind': 'plaintext'})
12 AssertEqual [[], []], ale#hover#ParseLSPResult({'kind': 'x', 'value': 'xxx'})
14 Execute(A string with a code fence should be handled):
24 \ ale#hover#ParseLSPResult(join([
34 \ 'unlet! b:current_syntax',
35 \ 'syntax include @ALE_hover_python syntax/python.vim',
36 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
43 \ ale#hover#ParseLSPResult(join([
53 \ 'unlet! b:current_syntax',
54 \ 'syntax include @ALE_hover_javascript syntax/javascript.vim',
55 \ 'unlet! b:current_syntax',
56 \ 'syntax include @ALE_hover_python syntax/python.vim',
57 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
58 \ 'syntax region ALE_hover_2 start=/\%5l/ end=/\%8l/ contains=@ALE_hover_python',
59 \ 'syntax region ALE_hover_3 start=/\%8l/ end=/\%10l/ contains=@ALE_hover_javascript',
70 \ 'const baz = () => undefined',
73 \ ale#hover#ParseLSPResult(join([
84 \ 'const baz = () => undefined',
88 Execute(Multiple strings with fences should be handled):
92 \ 'unlet! b:current_syntax',
93 \ 'syntax include @ALE_hover_javascript syntax/javascript.vim',
94 \ 'unlet! b:current_syntax',
95 \ 'syntax include @ALE_hover_python syntax/python.vim',
96 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
97 \ 'syntax region ALE_hover_2 start=/\%5l/ end=/\%8l/ contains=@ALE_hover_python',
98 \ 'syntax region ALE_hover_3 start=/\%8l/ end=/\%10l/ contains=@ALE_hover_javascript',
109 \ 'const baz = () => undefined',
112 \ ale#hover#ParseLSPResult([
126 \ 'const baz = () => undefined',
131 Execute(Objects with kinds should be handled):
135 \ 'unlet! b:current_syntax',
136 \ 'syntax include @ALE_hover_python syntax/python.vim',
137 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
144 \ 'const baz = () => undefined',
148 \ ale#hover#ParseLSPResult([
150 \ 'kind': 'markdown',
159 \ 'kind': 'plaintext',
162 \ 'const baz = () => undefined',
168 Execute(Simple markdown formatting should be handled):
172 \ 'unlet! b:current_syntax',
173 \ 'syntax include @ALE_hover_python syntax/python.vim',
174 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
180 \ 'formatted _ line _',
183 \ ale#hover#ParseLSPResult(join([
188 \ 'formatted \_ line \_',
191 Execute(Fences padded with spaces should be handled):
195 \ 'unlet! b:current_syntax',
196 \ 'syntax include @ALE_hover_python syntax/python.vim',
197 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%3l/ contains=@ALE_hover_python',
203 \ 'formatted _ line _',
206 \ ale#hover#ParseLSPResult(join([
211 \ 'formatted \_ line \_',
214 Execute(Non-existent syntax files shouldn't be loaded):
218 \ 'syntax region ALE_hover_1 start=/\%1l/ end=/\%2l/ contains=@ALE_hover_text',
224 \ ale#hover#ParseLSPResult(join([