autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Floating Window not working #922

Closed mirosval closed 4 years ago

mirosval commented 4 years ago

Describe the bug

1 . Using the minimal vim config, with a working RLS I open a rust project and press K to show hover information.

  1. Instead of appearing above/below cursor, it appears on the bottom line

Environment

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.3/share/nvim"

Run :checkhealth for more info

- This plugin version (`git rev-parse --short HEAD`): a7d3456
- This plugin's binary version (`bin/languageclient --version`): languageclient 0.1.155 1ffab7ef19e2acae6f32c6f3a27581429d28e47b
- Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
  reproduce the issue. Refer to an example [here][min-vimrc.vim]): ```call plug#begin('~/.local/share/nvim/plugged')

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }

call plug#end()

augroup filetype_rust
    autocmd!
    autocmd BufReadPost *.rs setlocal filetype=rust
augroup END

" Always draw sign column. Prevent buffer moving when adding/deleting sign.
set signcolumn=yes

let g:LanguageClient_serverCommands = {
    \ 'rust': ['rustup', 'run', 'stable', 'rls'],
    \ }
let $RUST_BACKTRACE = 1
let g:LanguageClient_loggingLevel = 'INFO'
let g:LanguageClient_virtualTextPrefix = ''
let g:LanguageClient_loggingFile =  expand('~/.local/share/nvim/LanguageClient.log')
let g:LanguageClient_serverStderr = expand('~/.local/share/nvim/LanguageServer.log')

nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>```
- Language server link and version:

[min-vimrc.vim]: https://github.com/autozimu/LanguageClient-neovim/blob/next/min-vimrc.vim

```#######
LanguageClient 0.1.155 1ffab7ef19e2acae6f32c6f3a27581429d28e47b
#######
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["[!!get(g:, 'LanguageClient_autoStart', 1), s:GetVar('LanguageClient_serverCommands', {}), get(g:, 'LanguageClient_selectionUI', v:null), get(g:, 'LanguageClient_trace', v:null), expand(get(g:, 'LanguageClient_settingsPath', '.vim/settings.json')), !!get(g:, 'LanguageClient_loadSettings', 1), get(g:, 'LanguageClient_rootMarkers', v:null), get(g:, 'LanguageClient_changeThrottle', v:null), get(g:, 'LanguageClient_waitOutputTimeout', v:null), !!get(g:, 'LanguageClient_diagnosticsEnable', 1), get(g:, 'LanguageClient_diagnosticsList', 'Quickfix'), get(g:, 'LanguageClient_diagnosticsDisplay', {}), get(g:, 'LanguageClient_windowLogMessageLevel', 'Warning'), get(g:, 'LanguageClient_hoverPreview', 'Auto'), get(g:, 'LanguageClient_completionPreferTextEdit', 0), has('nvim')]"],"id":4}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 4, "jsonrpc": "2.0", "result": [1, {"rust": ["rustup", "run", "stable", "rls"]}, null, null, ".vim/settings.json", 1, null, null, null, 1, "Quickfix", {}, "Warning", "Auto", 0, 1]}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["[get(g:, 'LanguageClient_diagnosticsSignsMax', v:null), get(g:, 'LanguageClient_diagnosticsMaxSeverity', 'Hint'), get(g:, 'LanguageClient_documentHighlightDisplay', {}), !!s:GetVar('LanguageClient_selectionUI_autoOpen', 1), s:useVirtualText(), !!s:GetVar('LanguageClient_echoProjectRoot', 1)]"],"id":5}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 5, "jsonrpc": "2.0", "result": [null, "Hint", {}, 1, 1, 1]}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["get(g:, 'loaded_fzf')"],"id":6}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 6, "jsonrpc": "2.0", "result": 0}
15:10:18 INFO unnamed src/language_server_protocol.rs:238 End sync settings
15:10:18 INFO unnamed src/language_server_protocol.rs:2956 settings synced
15:10:18 INFO unnamed src/language_server_protocol.rs:2982 Project root: /Users/miroslav/Exercism/rust/forth
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:EchomsgEllipsis","params":["Project root: /Users/miroslav/Exercism/rust/forth"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:3059 End languageClient/startServer
15:10:18 INFO unnamed src/language_server_protocol.rs:257 Defining signs
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["sign define LanguageClientError text=✖ texthl=ALEErrorSign","sign define LanguageClientWarning text=⚠ texthl=ALEWarningSign","sign define LanguageClientInformation text=ℹ texthl=ALEInfoSign","sign define LanguageClientHint text=➤ texthl=ALEInfoSign"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:934 Begin initialize
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["s:hasSnippetSupport()"],"id":7}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 7, "jsonrpc": "2.0", "result": 0}
15:10:18 WARN unnamed src/language_server_protocol.rs:946 Failed to get initializationOptions: Failed to read file (/Users/miroslav/Exercism/rust/forth/.vim/settings.json): No such file or directory (os error 2)
15:10:18 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"colorProvider":null,"completion":{"completionItem":{"snippetSupport":false}},"declaration":{"linkSupport":true},"definition":{"linkSupport":true},"implementation":{"linkSupport":true},"publishDiagnostics":{"relatedInformation":true},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"typeDefinition":{"linkSupport":true}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"processId":97164,"rootPath":"/Users/miroslav/Exercism/rust/forth","rootUri":"file:///Users/miroslav/Exercism/rust/forth","trace":"off"},"id":1}
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[".",":"]},"definitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{"resolveProvider":false},"documentFormattingProvider":true,"documentRangeFormattingProvider":false,"renameProvider":true,"executeCommandProvider":{"commands":["rls.applySuggestion-97169","rls.deglobImports-97169"]}}}}
15:10:18 INFO unnamed src/language_server_protocol.rs:1027 End initialize
15:10:18 INFO unnamed src/language_server_protocol.rs:729 Begin register NCM source
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["exists('g:cm_matcher')"],"id":8}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 8, "jsonrpc": "2.0", "result": 0}
15:10:18 INFO unnamed src/language_server_protocol.rs:770 Begin register NCM2 source
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["exists('g:ncm2_loaded')"],"id":9}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 9, "jsonrpc": "2.0", "result": 0}
15:10:18 INFO unnamed src/language_server_protocol.rs:1044 Begin initialized
15:10:18 INFO unnamed src/language_server_protocol.rs:1049 End initialized
15:10:18 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","method":"initialized","params":{}}
15:10:18 WARN unnamed src/language_server_protocol.rs:3075 Failed to get workspace settings: Failed to read file (/Users/miroslav/Exercism/rust/forth/.vim/settings.json): No such file or directory (os error 2)
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=1","let g:LanguageClient_serverStatusMessage='LS: Building'"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:1766 Begin textDocument/didOpen
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"LSP#text","params":["/Users/miroslav/Exercism/rust/forth/src/lib.rs"],"id":10}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 10, "jsonrpc": "2.0", "result": ["use std::collections::HashMap;", "", "pub type Value = i32;", "pub type ForthResult = Result<(), Error>;", "", "#[derive(Default, Debug)]", "pub struct Forth {", "    stack: Vec<Value>,", "    bindings: HashMap<String, String>,", "}", "", "#[derive(Debug, PartialEq)]", "pub enum Error {", "    DivisionByZero,", "    StackUnderflow,", "    UnknownWord,", "    InvalidWord,", "}", "", "impl Forth {", "    pub fn new() -> Forth {", "        let mut bindings = HashMap::new();", "        for w in [\"dup\", \"swap\", \"over\", \"drop\", \"*\", \"+\", \"-\", \"/\"].iter() {", "            bindings.insert(w.to_string(), w.to_string());", "        }", "        Forth {", "            stack: vec![],", "            bindings,", "        }", "    }", "", "    pub fn stack(&self) -> Vec<Value> {", "        self.stack.to_owned()", "    }", "", "    pub fn eval(&mut self, input: &str) -> ForthResult {", "        if input.starts_with(':') {", "            self.create_binding(input)", "        } else {", "            self.eval_code(input)", "        }", "    }", "", "    fn eval_code(&mut self, input: &str) -> ForthResult {", "        let tokens = input", "            .split(' ')", "            .map(|s| s.to_lowercase())", "            .flat_map(|t| {", "                let binding = self.bindings.get(&t);", "                match binding {", "                    Some(binding) => binding", "                        .split(' ')", "                        .map(|x| x.to_string())", "                        .collect::<Vec<String>>(),", "                    None => vec![t],", "                }", "            })", "            .collect::<Vec<String>>();", "        for token in tokens {", "            let res = match token.as_ref() {", "                \"+\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a + b);", "                    Ok(())", "                }),", "                \"-\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a - b);", "                    Ok(())", "                }),", "                \"*\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a * b);", "                    Ok(())", "                }),", "                \"/\" => self.binary_op(|forth, a, b| match b {", "                    0 => Err(Error::DivisionByZero),", "                    b => {", "                        forth.stack.push(a / b);", "                        Ok(())", "                    }", "                }),", "                \"swap\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"over\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a);", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"drop\" => match self.stack.pop() {", "                    Some(_) => Ok(()),", "                    None => Err(Error::StackUnderflow),", "                },", "                \"dup\" => match self.stack.pop() {", "                    Some(a) => {", "                        self.stack.push(a);", "                        self.stack.push(a);", "                        Ok(())", "                    }", "                    None => Err(Error::StackUnderflow),", "                },", "                t => match t.parse::<Value>() {", "                    Ok(v) => {", "                        self.stack.push(v);", "                        Ok(())", "                    }", "                    Err(_) => Err(Error::UnknownWord),", "                },", "            };", "            if let Err(e) = res {", "                return Err(e);", "            }", "        }", "        Ok(())", "    }", "", "    fn create_binding(&mut self, input: &str) -> ForthResult {", "        if !input.starts_with(':') || !input.ends_with(';') {", "            return Err(Error::InvalidWord);", "        }", "        let mut tokens = input[1..input.len() - 2]", "            .trim()", "            .split(' ')", "            .map(|s| s.to_lowercase());", "        let keyword = tokens.next();", "        let binding = {", "            let mut b = vec![];", "            for token in tokens {", "                if !token.contains(char::is_numeric) {", "                    let binding: String = match self.bindings.get(&token) {", "                        Some(binding) => binding.to_string(),", "                        None => return Err(Error::InvalidWord),", "                    };", "                    b.push(binding);", "                } else {", "                    b.push(token.to_string());", "                }", "            }", "            b.join(\" \")", "        };", "        match (keyword, binding) {", "            (Some(ref kw), ref b) if !kw.contains(char::is_numeric) && b != \"\" => {", "                self.bindings.insert(kw.to_string(), b.to_string());", "                Ok(())", "            }", "            _ => Err(Error::InvalidWord),", "        }", "    }", "", "    fn binary_op<F>(&mut self, mut f: F) -> ForthResult", "    where", "        F: FnMut(&mut Forth, Value, Value) -> ForthResult,", "    {", "        let b = self.stack.pop();", "        let a = self.stack.pop();", "        match (a, b) {", "            (Some(a), Some(b)) => f(self, a, b),", "            _ => Err(Error::StackUnderflow),", "        }", "    }", "}", ""]}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["setlocal omnifunc=LanguageClient#complete"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:1800 End textDocument/didOpen
15:10:18 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"rust","text":"use std::collections::HashMap;\n\npub type Value = i32;\npub type ForthResult = Result<(), Error>;\n\n#[derive(Default, Debug)]\npub struct Forth {\n    stack: Vec<Value>,\n    bindings: HashMap<String, String>,\n}\n\n#[derive(Debug, PartialEq)]\npub enum Error {\n    DivisionByZero,\n    StackUnderflow,\n    UnknownWord,\n    InvalidWord,\n}\n\nimpl Forth {\n    pub fn new() -> Forth {\n        let mut bindings = HashMap::new();\n        for w in [\"dup\", \"swap\", \"over\", \"drop\", \"*\", \"+\", \"-\", \"/\"].iter() {\n            bindings.insert(w.to_string(), w.to_string());\n        }\n        Forth {\n            stack: vec![],\n            bindings,\n        }\n    }\n\n    pub fn stack(&self) -> Vec<Value> {\n        self.stack.to_owned()\n    }\n\n    pub fn eval(&mut self, input: &str) -> ForthResult {\n        if input.starts_with(':') {\n            self.create_binding(input)\n        } else {\n            self.eval_code(input)\n        }\n    }\n\n    fn eval_code(&mut self, input: &str) -> ForthResult {\n        let tokens = input\n            .split(' ')\n            .map(|s| s.to_lowercase())\n            .flat_map(|t| {\n                let binding = self.bindings.get(&t);\n                match binding {\n                    Some(binding) => binding\n                        .split(' ')\n                        .map(|x| x.to_string())\n                        .collect::<Vec<String>>(),\n                    None => vec![t],\n                }\n            })\n            .collect::<Vec<String>>();\n        for token in tokens {\n            let res = match token.as_ref() {\n                \"+\" => self.binary_op(|forth, a, b| {\n                    forth.stack.push(a + b);\n                    Ok(())\n                }),\n                \"-\" => self.binary_op(|forth, a, b| {\n                    forth.stack.push(a - b);\n                    Ok(())\n                }),\n                \"*\" => self.binary_op(|forth, a, b| {\n                    forth.stack.push(a * b);\n                    Ok(())\n                }),\n                \"/\" => self.binary_op(|forth, a, b| match b {\n                    0 => Err(Error::DivisionByZero),\n                    b => {\n                        forth.stack.push(a / b);\n                        Ok(())\n                    }\n                }),\n                \"swap\" => self.binary_op(|forth, a, b| {\n                    forth.stack.push(b);\n                    forth.stack.push(a);\n                    Ok(())\n                }),\n                \"over\" => self.binary_op(|forth, a, b| {\n                    forth.stack.push(a);\n                    forth.stack.push(b);\n                    forth.stack.push(a);\n                    Ok(())\n                }),\n                \"drop\" => match self.stack.pop() {\n                    Some(_) => Ok(()),\n                    None => Err(Error::StackUnderflow),\n                },\n                \"dup\" => match self.stack.pop() {\n                    Some(a) => {\n                        self.stack.push(a);\n                        self.stack.push(a);\n                        Ok(())\n                    }\n                    None => Err(Error::StackUnderflow),\n                },\n                t => match t.parse::<Value>() {\n                    Ok(v) => {\n                        self.stack.push(v);\n                        Ok(())\n                    }\n                    Err(_) => Err(Error::UnknownWord),\n                },\n            };\n            if let Err(e) = res {\n                return Err(e);\n            }\n        }\n        Ok(())\n    }\n\n    fn create_binding(&mut self, input: &str) -> ForthResult {\n        if !input.starts_with(':') || !input.ends_with(';') {\n            return Err(Error::InvalidWord);\n        }\n        let mut tokens = input[1..input.len() - 2]\n            .trim()\n            .split(' ')\n            .map(|s| s.to_lowercase());\n        let keyword = tokens.next();\n        let binding = {\n            let mut b = vec![];\n            for token in tokens {\n                if !token.contains(char::is_numeric) {\n                    let binding: String = match self.bindings.get(&token) {\n                        Some(binding) => binding.to_string(),\n                        None => return Err(Error::InvalidWord),\n                    };\n                    b.push(binding);\n                } else {\n                    b.push(token.to_string());\n                }\n            }\n            b.join(\" \")\n        };\n        match (keyword, binding) {\n            (Some(ref kw), ref b) if !kw.contains(char::is_numeric) && b != \"\" => {\n                self.bindings.insert(kw.to_string(), b.to_string());\n                Ok(())\n            }\n            _ => Err(Error::InvalidWord),\n        }\n    }\n\n    fn binary_op<F>(&mut self, mut f: F) -> ForthResult\n    where\n        F: FnMut(&mut Forth, Value, Value) -> ForthResult,\n    {\n        let b = self.stack.pop();\n        let a = self.stack.pop();\n        match (a, b) {\n            (Some(a), Some(b)) => f(self, a, b),\n            _ => Err(Error::StackUnderflow),\n        }\n    }\n}\n","uri":"file:///Users/miroslav/Exercism/rust/forth/src/lib.rs","version":0}}}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"setbufvar","params":["/Users/miroslav/Exercism/rust/forth/src/lib.rs","LanguageClient_projectRoot","/Users/miroslav/Exercism/rust/forth"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:1805 Begin textDocument/didChange
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:ExecuteAutocmd","params":["LanguageClientTextDocumentDidOpenPost"]}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"LSP#text","params":["/Users/miroslav/Exercism/rust/forth/src/lib.rs"],"id":11}
15:10:18 INFO reader-None src/rpcclient.rs:169 <= None {"id": 11, "jsonrpc": "2.0", "result": ["use std::collections::HashMap;", "", "pub type Value = i32;", "pub type ForthResult = Result<(), Error>;", "", "#[derive(Default, Debug)]", "pub struct Forth {", "    stack: Vec<Value>,", "    bindings: HashMap<String, String>,", "}", "", "#[derive(Debug, PartialEq)]", "pub enum Error {", "    DivisionByZero,", "    StackUnderflow,", "    UnknownWord,", "    InvalidWord,", "}", "", "impl Forth {", "    pub fn new() -> Forth {", "        let mut bindings = HashMap::new();", "        for w in [\"dup\", \"swap\", \"over\", \"drop\", \"*\", \"+\", \"-\", \"/\"].iter() {", "            bindings.insert(w.to_string(), w.to_string());", "        }", "        Forth {", "            stack: vec![],", "            bindings,", "        }", "    }", "", "    pub fn stack(&self) -> Vec<Value> {", "        self.stack.to_owned()", "    }", "", "    pub fn eval(&mut self, input: &str) -> ForthResult {", "        if input.starts_with(':') {", "            self.create_binding(input)", "        } else {", "            self.eval_code(input)", "        }", "    }", "", "    fn eval_code(&mut self, input: &str) -> ForthResult {", "        let tokens = input", "            .split(' ')", "            .map(|s| s.to_lowercase())", "            .flat_map(|t| {", "                let binding = self.bindings.get(&t);", "                match binding {", "                    Some(binding) => binding", "                        .split(' ')", "                        .map(|x| x.to_string())", "                        .collect::<Vec<String>>(),", "                    None => vec![t],", "                }", "            })", "            .collect::<Vec<String>>();", "        for token in tokens {", "            let res = match token.as_ref() {", "                \"+\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a + b);", "                    Ok(())", "                }),", "                \"-\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a - b);", "                    Ok(())", "                }),", "                \"*\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a * b);", "                    Ok(())", "                }),", "                \"/\" => self.binary_op(|forth, a, b| match b {", "                    0 => Err(Error::DivisionByZero),", "                    b => {", "                        forth.stack.push(a / b);", "                        Ok(())", "                    }", "                }),", "                \"swap\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"over\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a);", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"drop\" => match self.stack.pop() {", "                    Some(_) => Ok(()),", "                    None => Err(Error::StackUnderflow),", "                },", "                \"dup\" => match self.stack.pop() {", "                    Some(a) => {", "                        self.stack.push(a);", "                        self.stack.push(a);", "                        Ok(())", "                    }", "                    None => Err(Error::StackUnderflow),", "                },", "                t => match t.parse::<Value>() {", "                    Ok(v) => {", "                        self.stack.push(v);", "                        Ok(())", "                    }", "                    Err(_) => Err(Error::UnknownWord),", "                },", "            };", "            if let Err(e) = res {", "                return Err(e);", "            }", "        }", "        Ok(())", "    }", "", "    fn create_binding(&mut self, input: &str) -> ForthResult {", "        if !input.starts_with(':') || !input.ends_with(';') {", "            return Err(Error::InvalidWord);", "        }", "        let mut tokens = input[1..input.len() - 2]", "            .trim()", "            .split(' ')", "            .map(|s| s.to_lowercase());", "        let keyword = tokens.next();", "        let binding = {", "            let mut b = vec![];", "            for token in tokens {", "                if !token.contains(char::is_numeric) {", "                    let binding: String = match self.bindings.get(&token) {", "                        Some(binding) => binding.to_string(),", "                        None => return Err(Error::InvalidWord),", "                    };", "                    b.push(binding);", "                } else {", "                    b.push(token.to_string());", "                }", "            }", "            b.join(\" \")", "        };", "        match (keyword, binding) {", "            (Some(ref kw), ref b) if !kw.contains(char::is_numeric) && b != \"\" => {", "                self.bindings.insert(kw.to_string(), b.to_string());", "                Ok(())", "            }", "            _ => Err(Error::InvalidWord),", "        }", "    }", "", "    fn binary_op<F>(&mut self, mut f: F) -> ForthResult", "    where", "        F: FnMut(&mut Forth, Value, Value) -> ForthResult,", "    {", "        let b = self.stack.pop();", "        let a = self.stack.pop();", "        match (a, b) {", "            (Some(a), Some(b)) => f(self, a, b),", "            _ => Err(Error::StackUnderflow),", "        }", "    }", "}", ""]}
15:10:18 INFO unnamed src/language_server_protocol.rs:1822 Texts equal. Skipping didChange.
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:ExecuteAutocmd","params":["LanguageClientStarted"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:2289 End languageClient/handleFileType
15:10:18 INFO unnamed src/language_server_protocol.rs:2289 End languageClient/handleFileType
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"client/registerCapability","id":1,"params":{"registrations":[{"id":"rls-watch","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/Users/miroslav/Exercism/rust/forth/Cargo.lock"},{"globPattern":"/Users/miroslav/Exercism/rust/forth/target","kind":4},{"globPattern":"/Users/miroslav/Exercism/rust/forth/Cargo.toml"}]}}]}}
15:10:18 INFO unnamed src/language_server_protocol.rs:2018 Begin client/registerCapability
15:10:18 INFO unnamed src/language_server_protocol.rs:2061 End client/registerCapability
15:10:18 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","result":null,"id":1}
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"forth","percentage":null,"title":"Building"}}
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"forth cfg(test)","percentage":null,"title":"Building"}}
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=1","let g:LanguageClient_serverStatusMessage='LS: Building (forth)'"]}
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=1","let g:LanguageClient_serverStatusMessage='LS: Building (forth cfg(test))'"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"forth cfg(test)","percentage":null,"title":"Building"}}
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=1","let g:LanguageClient_serverStatusMessage='LS: Building (forth cfg(test))'"]}
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}
15:10:18 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_0","message":null,"percentage":null,"title":"Indexing"}}
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=0","let g:LanguageClient_serverStatusMessage='LS: Idle'"]}
15:10:18 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:18 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:18 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=1","let g:LanguageClient_serverStatusMessage='LS: Indexing'"]}
15:10:19 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","message":null,"percentage":null,"title":"Indexing"}}
15:10:19 INFO unnamed src/language_server_protocol.rs:2885 Begin window/progress
15:10:19 INFO unnamed src/language_server_protocol.rs:2916 End window/progress
15:10:19 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:command","params":["let g:LanguageClient_serverStatus=0","let g:LanguageClient_serverStatusMessage='LS: Idle'"]}
15:13:54 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 1}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:54 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 2}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 3}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 4}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 5}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 6}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 7}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:55 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 8}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:55 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 9}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 10}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 11}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 12}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 13}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 14}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 15}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 16}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 17}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 18}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 19}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 20}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:56 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 21}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:56 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 22}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 23}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 24}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 25}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 26}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 27}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 28}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 29}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 30}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 31}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 32}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:57 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 33}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:57 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 34}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 35}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 37, "start": 0}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 36}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 38, "start": 1}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 37}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 39, "start": 2}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 38}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 40, "start": 3}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 39}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 40, "start": 3}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 38}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 40, "start": 3}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 37}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 40, "start": 3}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 36}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:13:58 INFO reader-None src/rpcclient.rs:169 <= None {"method": "languageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "viewport": {"end": 40, "start": 3}, "languageId": "rust", "buftype": "", "position": {"character": 0, "line": 35}, "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:13:58 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved
15:14:00 INFO reader-None src/rpcclient.rs:169 <= None {"id": 1, "jsonrpc": "2.0", "method": "textDocument/hover", "params": {"bufnr": 1, "character": 43, "handle": true, "languageId": "rust", "line": 35, "text": ["use std::collections::HashMap;", "", "pub type Value = i32;", "pub type ForthResult = Result<(), Error>;", "", "#[derive(Default, Debug)]", "pub struct Forth {", "    stack: Vec<Value>,", "    bindings: HashMap<String, String>,", "}", "", "#[derive(Debug, PartialEq)]", "pub enum Error {", "    DivisionByZero,", "    StackUnderflow,", "    UnknownWord,", "    InvalidWord,", "}", "", "impl Forth {", "    pub fn new() -> Forth {", "        let mut bindings = HashMap::new();", "        for w in [\"dup\", \"swap\", \"over\", \"drop\", \"*\", \"+\", \"-\", \"/\"].iter() {", "            bindings.insert(w.to_string(), w.to_string());", "        }", "        Forth {", "            stack: vec![],", "            bindings,", "        }", "    }", "", "    pub fn stack(&self) -> Vec<Value> {", "        self.stack.to_owned()", "    }", "", "    pub fn eval(&mut self, input: &str) -> ForthResult {", "        if input.starts_with(':') {", "            self.create_binding(input)", "        } else {", "            self.eval_code(input)", "        }", "    }", "", "    fn eval_code(&mut self, input: &str) -> ForthResult {", "        let tokens = input", "            .split(' ')", "            .map(|s| s.to_lowercase())", "            .flat_map(|t| {", "                let binding = self.bindings.get(&t);", "                match binding {", "                    Some(binding) => binding", "                        .split(' ')", "                        .map(|x| x.to_string())", "                        .collect::<Vec<String>>(),", "                    None => vec![t],", "                }", "            })", "            .collect::<Vec<String>>();", "        for token in tokens {", "            let res = match token.as_ref() {", "                \"+\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a + b);", "                    Ok(())", "                }),", "                \"-\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a - b);", "                    Ok(())", "                }),", "                \"*\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a * b);", "                    Ok(())", "                }),", "                \"/\" => self.binary_op(|forth, a, b| match b {", "                    0 => Err(Error::DivisionByZero),", "                    b => {", "                        forth.stack.push(a / b);", "                        Ok(())", "                    }", "                }),", "                \"swap\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"over\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a);", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"drop\" => match self.stack.pop() {", "                    Some(_) => Ok(()),", "                    None => Err(Error::StackUnderflow),", "                },", "                \"dup\" => match self.stack.pop() {", "                    Some(a) => {", "                        self.stack.push(a);", "                        self.stack.push(a);", "                        Ok(())", "                    }", "                    None => Err(Error::StackUnderflow),", "                },", "                t => match t.parse::<Value>() {", "                    Ok(v) => {", "                        self.stack.push(v);", "                        Ok(())", "                    }", "                    Err(_) => Err(Error::UnknownWord),", "                },", "            };", "            if let Err(e) = res {", "                return Err(e);", "            }", "        }", "        Ok(())", "    }", "", "    fn create_binding(&mut self, input: &str) -> ForthResult {", "        if !input.starts_with(':') || !input.ends_with(';') {", "            return Err(Error::InvalidWord);", "        }", "        let mut tokens = input[1..input.len() - 2]", "            .trim()", "            .split(' ')", "            .map(|s| s.to_lowercase());", "        let keyword = tokens.next();", "        let binding = {", "            let mut b = vec![];", "            for token in tokens {", "                if !token.contains(char::is_numeric) {", "                    let binding: String = match self.bindings.get(&token) {", "                        Some(binding) => binding.to_string(),", "                        None => return Err(Error::InvalidWord),", "                    };", "                    b.push(binding);", "                } else {", "                    b.push(token.to_string());", "                }", "            }", "            b.join(\" \")", "        };", "        match (keyword, binding) {", "            (Some(ref kw), ref b) if !kw.contains(char::is_numeric) && b != \"\" => {", "                self.bindings.insert(kw.to_string(), b.to_string());", "                Ok(())", "            }", "            _ => Err(Error::InvalidWord),", "        }", "    }", "", "    fn binary_op<F>(&mut self, mut f: F) -> ForthResult", "    where", "        F: FnMut(&mut Forth, Value, Value) -> ForthResult,", "    {", "        let b = self.stack.pop();", "        let a = self.stack.pop();", "        match (a, b) {", "            (Some(a), Some(b)) => f(self, a, b),", "            _ => Err(Error::StackUnderflow),", "        }", "    }", "}", ""], "filename": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}}
15:14:00 INFO unnamed src/language_server_protocol.rs:1805 Begin textDocument/didChange
15:14:00 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"LSP#text","params":["/Users/miroslav/Exercism/rust/forth/src/lib.rs"],"id":12}
15:14:00 INFO reader-None src/rpcclient.rs:169 <= None {"id": 12, "jsonrpc": "2.0", "result": ["use std::collections::HashMap;", "", "pub type Value = i32;", "pub type ForthResult = Result<(), Error>;", "", "#[derive(Default, Debug)]", "pub struct Forth {", "    stack: Vec<Value>,", "    bindings: HashMap<String, String>,", "}", "", "#[derive(Debug, PartialEq)]", "pub enum Error {", "    DivisionByZero,", "    StackUnderflow,", "    UnknownWord,", "    InvalidWord,", "}", "", "impl Forth {", "    pub fn new() -> Forth {", "        let mut bindings = HashMap::new();", "        for w in [\"dup\", \"swap\", \"over\", \"drop\", \"*\", \"+\", \"-\", \"/\"].iter() {", "            bindings.insert(w.to_string(), w.to_string());", "        }", "        Forth {", "            stack: vec![],", "            bindings,", "        }", "    }", "", "    pub fn stack(&self) -> Vec<Value> {", "        self.stack.to_owned()", "    }", "", "    pub fn eval(&mut self, input: &str) -> ForthResult {", "        if input.starts_with(':') {", "            self.create_binding(input)", "        } else {", "            self.eval_code(input)", "        }", "    }", "", "    fn eval_code(&mut self, input: &str) -> ForthResult {", "        let tokens = input", "            .split(' ')", "            .map(|s| s.to_lowercase())", "            .flat_map(|t| {", "                let binding = self.bindings.get(&t);", "                match binding {", "                    Some(binding) => binding", "                        .split(' ')", "                        .map(|x| x.to_string())", "                        .collect::<Vec<String>>(),", "                    None => vec![t],", "                }", "            })", "            .collect::<Vec<String>>();", "        for token in tokens {", "            let res = match token.as_ref() {", "                \"+\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a + b);", "                    Ok(())", "                }),", "                \"-\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a - b);", "                    Ok(())", "                }),", "                \"*\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a * b);", "                    Ok(())", "                }),", "                \"/\" => self.binary_op(|forth, a, b| match b {", "                    0 => Err(Error::DivisionByZero),", "                    b => {", "                        forth.stack.push(a / b);", "                        Ok(())", "                    }", "                }),", "                \"swap\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"over\" => self.binary_op(|forth, a, b| {", "                    forth.stack.push(a);", "                    forth.stack.push(b);", "                    forth.stack.push(a);", "                    Ok(())", "                }),", "                \"drop\" => match self.stack.pop() {", "                    Some(_) => Ok(()),", "                    None => Err(Error::StackUnderflow),", "                },", "                \"dup\" => match self.stack.pop() {", "                    Some(a) => {", "                        self.stack.push(a);", "                        self.stack.push(a);", "                        Ok(())", "                    }", "                    None => Err(Error::StackUnderflow),", "                },", "                t => match t.parse::<Value>() {", "                    Ok(v) => {", "                        self.stack.push(v);", "                        Ok(())", "                    }", "                    Err(_) => Err(Error::UnknownWord),", "                },", "            };", "            if let Err(e) = res {", "                return Err(e);", "            }", "        }", "        Ok(())", "    }", "", "    fn create_binding(&mut self, input: &str) -> ForthResult {", "        if !input.starts_with(':') || !input.ends_with(';') {", "            return Err(Error::InvalidWord);", "        }", "        let mut tokens = input[1..input.len() - 2]", "            .trim()", "            .split(' ')", "            .map(|s| s.to_lowercase());", "        let keyword = tokens.next();", "        let binding = {", "            let mut b = vec![];", "            for token in tokens {", "                if !token.contains(char::is_numeric) {", "                    let binding: String = match self.bindings.get(&token) {", "                        Some(binding) => binding.to_string(),", "                        None => return Err(Error::InvalidWord),", "                    };", "                    b.push(binding);", "                } else {", "                    b.push(token.to_string());", "                }", "            }", "            b.join(\" \")", "        };", "        match (keyword, binding) {", "            (Some(ref kw), ref b) if !kw.contains(char::is_numeric) && b != \"\" => {", "                self.bindings.insert(kw.to_string(), b.to_string());", "                Ok(())", "            }", "            _ => Err(Error::InvalidWord),", "        }", "    }", "", "    fn binary_op<F>(&mut self, mut f: F) -> ForthResult", "    where", "        F: FnMut(&mut Forth, Value, Value) -> ForthResult,", "    {", "        let b = self.stack.pop();", "        let a = self.stack.pop();", "        match (a, b) {", "            (Some(a), Some(b)) => f(self, a, b),", "            _ => Err(Error::StackUnderflow),", "        }", "    }", "}", ""]}
15:14:00 INFO unnamed src/language_server_protocol.rs:1822 Texts equal. Skipping didChange.
15:14:00 INFO unnamed src/language_server_protocol.rs:1055 Begin textDocument/hover
15:14:00 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#position()"],"id":13}
15:14:00 INFO reader-None src/rpcclient.rs:169 <= None {"id": 13, "jsonrpc": "2.0", "result": {"character": 43, "line": 35}}
15:14:00 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":43,"line":35},"textDocument":{"uri":"file:///Users/miroslav/Exercism/rust/forth/src/lib.rs"}},"id":2}
15:14:00 INFO reader-Some("rust") src/rpcclient.rs:169 <= Some("rust") {"jsonrpc":"2.0","id":2,"result":{"contents":[{"language":"rust","value":"pub type ForthResult = Result<(), Error>"}],"range":{"start":{"line":35,"character":43},"end":{"line":35,"character":54}}}}
15:14:00 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"s:EchoEllipsis","params":["pub type ForthResult = Result<(), Error>"]}
15:14:00 INFO unnamed src/language_server_protocol.rs:1089 End textDocument/hover
15:14:00 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","result":{"contents":[{"language":"rust","value":"pub type ForthResult = Result<(), Error>"}],"range":{"end":{"character":54,"line":35},"start":{"character":43,"line":35}}},"id":1}
15:15:52 INFO reader-None src/rpcclient.rs:169 <= None {"method": "exit", "jsonrpc": "2.0", "params": {"bufnr": 1, "languageId": "rust"}}
15:15:52 INFO unnamed src/language_server_protocol.rs:2105 Begin exit
15:15:52 INFO writer-None src/rpcclient.rs:215 => None {"jsonrpc":"2.0","method":"eval","params":["LSP#filename()"],"id":14}
15:15:52 INFO reader-None src/rpcclient.rs:169 <= None {"id": 14, "jsonrpc": "2.0", "result": "/Users/miroslav/Exercism/rust/forth/src/lib.rs"}
15:15:52 INFO reader-None src/rpcclient.rs:202 reader-None terminated
15:15:52 INFO writer-Some("rust") src/rpcclient.rs:215 => Some("rust") {"jsonrpc":"2.0","method":"exit","params":null}
15:15:52 INFO unnamed src/language_server_protocol.rs:860 Begin cleanup
15:15:52 INFO unnamed src/language_server_protocol.rs:2349 Begin languageClient/handleCursorMoved

To Reproduce

  1. Clone any rust project
  2. Place the .vimrc in the local dir
  3. nvim -u .vimrc src/lib.rs
  4. :PlugInstall, restart nvim nvim -u .vimrc src/lib.rs
  5. Navigate to any symbol
  6. Press shift+K
  7. Bottom line shows the symbol description

Current behavior

Symbol hover description is shown on the bottom line of the vim window

Expected behavior

Symbol hover description should be above or below the line with the Symbol hovered

Screenshots

https://imgur.com/yIkNQOF

Additional context

I'm using macOS Catalina (10.15.1 (19B88)). Tmux 2.9, zsh. I'm using Alacritty 0.4, but I've had this problem with older Alacritty and I also have it in macOS Terminal.

Weird thing is that the Language Server works, because all its functions work. The floating window of nvim also works, I checked by creating a minimal coc setup where it worked out of the box.

mirosval commented 4 years ago

Somebody wrote a comment to use

let g:LanguageClient_hoverPreview = 'always'

This works, as in it always forces the floating window, even for one line text.

I would suggest that always is the default, because otherwise its inconsistent and confusing.

theHamsta commented 4 years ago

Sorry, for deleting the comment. I thought it was off-topic because the documentation says it is the default.

So maybe the documentation should be updated or always really be the default.