mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-11 09:08:32 +08:00
Use one LSP connection per project
This commit is contained in:
@@ -225,57 +225,3 @@ 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 = ale#lsp#NewConnection({})
|
||||
call ale#lsp#RegisterProject(b:conn.id, '/foo/bar')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ '/foo/bar': {
|
||||
\ 'root': '/foo/bar',
|
||||
\ 'initialized': 0,
|
||||
\ 'message_queue': [],
|
||||
\ 'capabilities_queue': [],
|
||||
\ 'init_request_id': 0,
|
||||
\ },
|
||||
\ },
|
||||
\ b:conn.projects
|
||||
|
||||
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 = ale#lsp#NewConnection({})
|
||||
call ale#lsp#RegisterProject(b:conn.id, '')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ '<<EMPTY>>': {
|
||||
\ 'root': '',
|
||||
\ 'initialized': 1,
|
||||
\ 'message_queue': [],
|
||||
\ 'capabilities_queue': [],
|
||||
\ 'init_request_id': 0,
|
||||
\ },
|
||||
\ },
|
||||
\ b:conn.projects
|
||||
|
||||
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