summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-30 14:42:00 +0100
committerw0rp <devw0rp@gmail.com>2017-07-30 14:42:00 +0100
commit84af543907e222dd6035a37f7a7b9a99b9fd11ad (patch)
tree58421a4063af944405a0e96cfb111c92244ba975
parent63b9d9e9df9811eec3470e38b234cd2d959169eb (diff)
downloadale-84af543907e222dd6035a37f7a7b9a99b9fd11ad.zip
Fix some bugs so the PHP language server will show errors at least once
-rw-r--r--ale_linters/php/langserver.vim2
-rw-r--r--autoload/ale/lsp.vim6
2 files changed, 5 insertions, 3 deletions
diff --git a/ale_linters/php/langserver.vim b/ale_linters/php/langserver.vim
index 8dad5ac7..29545542 100644
--- a/ale_linters/php/langserver.vim
+++ b/ale_linters/php/langserver.vim
@@ -25,7 +25,7 @@ endfunction
function! ale_linters#php#langserver#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
- return !empty(l:git_path) ? fnamemodify(l:git_path, ':h') : ''
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('php', {
diff --git a/autoload/ale/lsp.vim b/autoload/ale/lsp.vim
index 2c9b2990..eb407314 100644
--- a/autoload/ale/lsp.vim
+++ b/autoload/ale/lsp.vim
@@ -164,6 +164,8 @@ function! s:HandleInitializeResponse(conn, response) abort
return
endif
+ let l:project.initialized = 1
+
" After the server starts, send messages we had queued previously.
for l:message_data in l:project.message_queue
call s:SendMessageData(a:conn, l:message_data)
@@ -211,7 +213,7 @@ function! s:RegisterProject(conn, project_root) abort
" Tools without project roots are ready right away, like tsserver.
let a:conn.projects[a:project_root] = {
\ 'initialized': empty(a:project_root),
- \ 'init_messsage_id': 0,
+ \ 'init_request_id': 0,
\ 'message_queue': [],
\}
endif
@@ -319,7 +321,7 @@ function! ale#lsp#Send(conn_id, message, ...) abort
" Only send the init message once.
if !l:project.init_request_id
let [l:init_id, l:init_data] = ale#lsp#CreateMessageData(
- \ ale#lsp#message#Initialize(l:conn.project_root),
+ \ ale#lsp#message#Initialize(l:project_root),
\)
let l:project.init_request_id = l:init_id