mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-28 06:46:52 +08:00
Fix #907 - Stop LSP integration breaking with empty string keys in NeoVim
This commit is contained in:
@@ -3,6 +3,7 @@ Before:
|
||||
|
||||
After:
|
||||
unlet! b:data
|
||||
unlet! b:conn
|
||||
|
||||
Execute(GetNextMessageID() should increment appropriately):
|
||||
" We should get the initial ID, and increment a bit.
|
||||
@@ -220,3 +221,51 @@ Execute(ale#lsp#ReadMessageData() should handle a message with part of a second
|
||||
\ . '{"id":2,"jsonrpc":"2.0","result":{"foo":"barÜ"}}'
|
||||
\ . b:data
|
||||
\ )
|
||||
|
||||
Execute(Projects with regular project roots should be registered correctly):
|
||||
let b:conn = {'projects': {}}
|
||||
|
||||
call ale#lsp#RegisterProject(b:conn, '/foo/bar')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'projects': {
|
||||
\ '/foo/bar': {'initialized': 0, 'message_queue': [], 'init_request_id': 0},
|
||||
\ },
|
||||
\ },
|
||||
\ b:conn
|
||||
|
||||
Execute(Projects with regular project roots should be fetched correctly):
|
||||
let b:conn = {
|
||||
\ 'projects': {
|
||||
\ '/foo/bar': {'initialized': 0, 'message_queue': [], 'init_request_id': 0},
|
||||
\ },
|
||||
\}
|
||||
|
||||
AssertEqual
|
||||
\ {'initialized': 0, 'message_queue': [], 'init_request_id': 0},
|
||||
\ ale#lsp#GetProject(b:conn, '/foo/bar')
|
||||
|
||||
Execute(Projects with empty project roots should be registered correctly):
|
||||
let b:conn = {'projects': {}}
|
||||
|
||||
call ale#lsp#RegisterProject(b:conn, '')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'projects': {
|
||||
\ '<<EMPTY>>': {'initialized': 1, 'message_queue': [], 'init_request_id': 0},
|
||||
\ },
|
||||
\ },
|
||||
\ b:conn
|
||||
|
||||
Execute(Projects with empty project roots should be fetched correctly):
|
||||
let b:conn = {
|
||||
\ 'projects': {
|
||||
\ '<<EMPTY>>': {'initialized': 1, 'message_queue': [], 'init_request_id': 0},
|
||||
\ },
|
||||
\}
|
||||
|
||||
AssertEqual
|
||||
\ {'initialized': 1, 'message_queue': [], 'init_request_id': 0},
|
||||
\ ale#lsp#GetProject(b:conn, '')
|
||||
|
||||
Reference in New Issue
Block a user