# Unable to verify if kak-lsp is working - mac

**URL:** <https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051>\
**Category:** Help\
**Tags:** lsp\
**Created:** [April 20, 2022, 5:56am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051 "2022-04-20T05:56:48Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 20, 2022, 5:56am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/1 "2022-04-20T05:56:49Z")

</div>

I am on a MacBook. I have added all the required config files, but the LSP doesn’t seem to work. I can see all the options listed in the command area but can’t see the completions as I type. I see completions for only the code that is already available in the file. I have copied the default `kak-lsp.toml` to `~/.config/kak-lsp/kak-lsp.toml` and have also installed kak-lsp using brew. I initially tried installing it via plug.kak but I got an Error 101, so I reverted to installing it via brew.

Any help on this would be highly appreciated.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 9:13am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/2 "2022-04-20T09:13:21Z")

</div>

Did you run `lsp-enable`? Which server are you using, and what is the input file?

[This command](https://github.com/kak-lsp/kak-lsp#default-configuration) should give you a kakoune instance with working LSP support, plus a log file (which could point out any errors).

(Unfortunately, kak-lsp is a bit hard to set up but I’m sure it will be worth it. We should try to show the last few thousand log lines inside the editor.)

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 9:20am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/3 "2022-04-20T09:20:56Z")

</div>

Also, check the `*debug*` buffer for suspicious messages

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 20, 2022, 9:27am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/4 "2022-04-20T09:27:33Z")

</div>

I don’t see the command `lsp-enable` in my command completion. I see `lsp-enable-window` though. If I add that to the kakrc, the `debug` buffer says that it is already loaded. Apart from that, I don’t get any error message in debug buffer. I suspect some silly issue with path in mac?

**`kak-lsp.toml`**

 ![Screenshot 2022-04-20 at 2.54.25 PM](https://discuss.kakoune.com/uploads/default/original/2X/f/f3570bee53715fdbbccdd6259b8ec995ad15a74e.png)

I have a config for other languages too. But, I am getting it to work for JS or TS at least for now. I have copied the default config from the plugin to config directory, but with some modifications.

PS: I will soon try to replace pics with code.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 9:34am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/5 "2022-04-20T09:34:25Z")

</div>

typescript-language-server on a simple JS file works for me:  
 ![image](https://discuss.kakoune.com/uploads/default/original/2X/0/06a0035a7f0a14e540bafb451d2017da346f3b97.png)

Make sure kak-lsp and typescript-language-server are in your $PATH

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 20, 2022, 9:34am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/6 "2022-04-20T09:34:25Z")

</div>

Please find the error message from log:

 ![Screenshot 2022-04-20 at 3.03.37 PM](https://discuss.kakoune.com/uploads/default/original/2X/c/c82cfb9c3bcc59cdca0a73791d6e7105acb60c62.jpeg)

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 9:37am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/7 "2022-04-20T09:37:04Z")

</div>

The error shows that kak-lsp tries to run the `flow` server for javascript, which is the server in the default config.  
This means that kak-lsp didn’t pick up your kak-lsp.toml. Refer to [Configuring kak-lsp](https://github.com/kak-lsp/kak-lsp#configuring-kak-lsp) for how to find the location. In particular, on macOS it’s _not_ `~/.config/kak-lsp/kak-lsp.toml` but `~/Library/Preferences/kak-lsp/kak-lsp.toml`

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 9:38am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/8 "2022-04-20T09:38:55Z")

</div>

(FWIW recent versions of the `dirs` library have changed to `$HOME/Library/Application Support` but kak-lsp does not use that yet. Probably it should, while still falling back to the old path.)

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 20, 2022, 11:32am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/9 "2022-04-20T11:32:59Z")

</div>

Are you sure `~/Library/Preferences/kak-lsp` is where we need to house the `kak-lsp.toml`? When I `ls` into this directory, all I can see is a bunch of plist files.

Edit: You were right, it seems to be picking the config file from `Preferences`. However, I don’t see the required auto-completions yet.

 ![Screenshot 2022-04-20 at 5.05.25 PM](https://discuss.kakoune.com/uploads/default/original/2X/6/665f905c9d8ada7b1a5e81df38d252fe8a3bdaf2.png)

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 20, 2022, 11:39am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/10 "2022-04-20T11:39:33Z")

</div>

Here’s what VS Code shows:

 ![Screenshot 2022-04-20 at 5.06.23 PM](https://discuss.kakoune.com/uploads/default/original/2X/0/080db7e104587c664a5851f7fb06625b24d2ff31.png)

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 20, 2022, 2:23pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/11 "2022-04-20T14:23:10Z")

</div>

works for me, can you post a full log (where `lsp_cmd` has `-vvvv`)

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 23, 2022, 4:11pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/12 "2022-04-23T16:11:43Z")

</div>

Here is the log file with `-vvvv` like you asked. Everything seems to be normal from what I can see within the editor. Even the `lsp-capabilities` return some options except that they’re not shown in the completion. Really confused what might be happening here.

```auto
Apr 23 21:35:21.890 INFO Starting main event loop, module: kak_lsp::session:28
Apr 23 21:36:33.042 DEBG From editor: 
session = "foobar"
client = "client0"
buffile = "/Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js"
filetype = "javascript"
version = 31
method = "capabilities"
[params]
, module: kak_lsp::editor_transport:129
Apr 23 21:36:33.042 DEBG Searching for vars starting with KAK_LSP_PROJECT_ROOT_JAVASCRIPT, module: kak_lsp::project_root:58
Apr 23 21:36:33.042 INFO Found project root "/Users/sebastia/personal/interview-prep-js" because it contains "package.json", module: kak_lsp::project_root:41
Apr 23 21:36:33.042 DEBG Routing editor request to Route { session: "foobar", language: "javascript", root: "/Users/sebastia/personal/interview-prep-js" }, module: kak_lsp::session:94
Apr 23 21:36:33.042 DEBG Spawning a new controller for Route { session: "foobar", language: "javascript", root: "/Users/sebastia/personal/interview-prep-js" }, module: kak_lsp::session:114
Apr 23 21:36:33.043 INFO Starting Language server `typescript-language-server --stdio`, module: kak_lsp::language_server_transport:20
Apr 23 21:36:33.044 DEBG To server: {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"markdown":{"parser":"kak-lsp","version":"12.1.0"}},"offsetEncoding":["utf-8","utf-16"],"textDocument":{"callHierarchy":{"dynamicRegistration":false},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false,"isPreferredSupport":false},"codeLens":{"dynamicRegistration":false},"colorProvider":{"dynamicRegistration":false},"completion":{"completionItem":{"commitCharactersSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"],"preselectSupport":false,"resolveSupport":{"properties":["additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"contextSupport":false,"dynamicRegistration":false},"declaration":{"dynamicRegistration":false,"linkSupport":false},"definition":{"dynamicRegistration":false,"linkSupport":false},"documentHighlight":{"dynamicRegistration":false},"documentLink":{"dynamicRegistration":false,"tooltipSupport":false},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"formatting":{"dynamicRegistration":false},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":false},"onTypeFormatting":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false},"rangeFormatting":{"dynamicRegistration":false},"references":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false,"prepareSupport":false},"selectionRange":{},"semanticTokens":{"dynamicRegistration":false,"formats":["relative"],"requests":{"full":true,"range":false},"tokenModifiers":["documentation","readonly","constant"],"tokenTypes":["comment","namespace","operator","keyword","string","type","variable","function"]},"signatureHelp":{"contextSupport":false,"dynamicRegistration":false,"signatureInformation":{"documentationFormat":["plaintext"],"parameterInformation":{"labelOffsetSupport":false}}},"synchronization":{"didSave":true,"dynamicRegistration":false,"willSave":false,"willSaveWaitUntil":false},"typeDefinition":{"dynamicRegistration":false,"linkSupport":false}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":false,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"workspaceEdit":{"changeAnnotationSupport":{},"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","delete","rename"]},"workspaceFolders":false}},"clientInfo":{"name":"kak-lsp","version":"12.1.0"},"processId":91968,"rootPath":"/Users/sebastia/personal/interview-prep-js","rootUri":"file:///Users/sebastia/personal/interview-prep-js","trace":"off"},"id":0}, module: kak_lsp::language_server_transport:177
Apr 23 21:36:33.215 DEBG From server: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"triggerCharacters":[".","\"","'","/","@","<"],"resolveProvider":true},"codeActionProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.organizeImports","_typescript.applyRenameFile"]},"hoverProvider":true,"renameProvider":true,"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","<"]},"workspaceSymbolProvider":true,"implementationProvider":true,"typeDefinitionProvider":true,"foldingRangeProvider":true,"callsProvider":true}}}, module: kak_lsp::language_server_transport:151
Apr 23 21:36:33.216 DEBG To server: {"jsonrpc":"2.0","method":"initialized","params":{}}, module: kak_lsp::language_server_transport:177
Apr 23 21:36:33.216 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"javascript","text":"function addTwoNums(n) {\n var nums = ('' + n).split('');\n return parseInt(nums[0]) + parseInt(nums[1]);\n}\nconsole.log(addTwoNums(29));\n","uri":"file:///Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js","version":31}}}, module: kak_lsp::language_server_transport:177
Apr 23 21:36:33.217 DEBG To editor `foobar`: eval -client client0 -verbatim -- info 'kak-lsp commands supported by javascript language server:

lsp-hover
lsp-completion (hooked on InsertIdle)
lsp-definition (mapped to `gd` by default)
lsp-implementation
lsp-references (mapped to `gr` by default)
lsp-workspace-symbol
lsp-formatting
lsp-range-formatting
lsp-rename
lsp-code-actions
lsp-diagnostics', module: kak_lsp::editor_transport:80
Apr 23 21:36:34.995 DEBG From server: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js","diagnostics":[]}}, module: kak_lsp::language_server_transport:151
Apr 23 21:36:34.998 DEBG To editor `foobar`: eval -buffer '/Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js' %¬ßset buffer lsp_diagnostic_error_count 0; set buffer lsp_diagnostic_hint_count 0; set buffer lsp_diagnostic_info_count 0; set buffer lsp_diagnostic_warning_count 0; set buffer lsp_errors 31 ; eval "set buffer lsp_error_lines 31 '0|%opt[lsp_diagnostic_line_error_sign]'"; set buffer lsp_diagnostics 31 ¬ß, module: kak_lsp::editor_transport:84
Apr 23 21:36:37.608 DEBG From server: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js","diagnostics":[]}}, module: kak_lsp::language_server_transport:151
Apr 23 21:36:37.611 DEBG To editor `foobar`: eval -buffer '/Users/sebastia/personal/interview-prep-js/addTwoDigits/addNums.js' %¬ßset buffer lsp_diagnostic_error_count 0; set buffer lsp_diagnostic_hint_count 0; set buffer lsp_diagnostic_info_count 0; set buffer lsp_diagnostic_warning_count 0; set buffer lsp_errors 31 ; eval "set buffer lsp_error_lines 31 '0|%opt[lsp_diagnostic_line_error_sign]'"; set buffer lsp_diagnostics 31 ¬ß, module: kak_lsp::editor_transport:84
Apr 23 21:36:40.926 DEBG From editor: 
session = "foobar"
client = ""
buffile = ""
filetype = ""
version = 0
method = "stop"
[params]
, module: kak_lsp::editor_transport:129
Apr 23 21:36:40.926 INFO Shutting down language servers and exiting, module: kak_lsp::session:171
Apr 23 21:36:40.926 INFO Exit javascript in project /Users/sebastia/personal/interview-prep-js, module: kak_lsp::session:176
Apr 23 21:36:40.926 INFO Waiting for Controller to finish..., module: kak_lsp::thread_worker:19
Apr 23 21:36:40.926 DEBG To server: {"jsonrpc":"2.0","method":"exit","params":null}, module: kak_lsp::language_server_transport:177
Apr 23 21:36:40.926 INFO Waiting for Messages to language server to finish..., module: kak_lsp::thread_worker:19
Apr 23 21:36:40.926 DEBG Received signal to stop language server, closing pipe, module: kak_lsp::language_server_transport:188
Apr 23 21:36:40.926 DEBG Waiting for language server process end, module: kak_lsp::language_server_transport:87
Apr 23 21:36:40.934 DEBG Language server closed pipe, stopping reading, module: kak_lsp::language_server_transport:129
Apr 23 21:36:41.931 INFO ... Messages to language server terminated with ok, module: kak_lsp::thread_worker:21
Apr 23 21:36:41.932 INFO Waiting for Messages from language server to finish..., module: kak_lsp::thread_worker:19
Apr 23 21:36:41.932 INFO ... Messages from language server terminated with ok, module: kak_lsp::thread_worker:21
Apr 23 21:36:41.932 INFO Waiting for Language server errors to finish..., module: kak_lsp::thread_worker:19
Apr 23 21:36:41.932 INFO ... Language server errors terminated with ok, module: kak_lsp::thread_worker:21
Apr 23 21:36:41.932 INFO ... Controller terminated with ok, module: kak_lsp::thread_worker:21
Apr 23 21:36:41.932 INFO Waiting for Messages to editor to finish..., module: kak_lsp::thread_worker:19
Apr 23 21:36:41.932 INFO ... Messages to editor terminated with ok, module: kak_lsp::thread_worker:21

```

Sorry about the large log. I didn’t have an option to attach a file.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 23, 2022, 4:24pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/13 "2022-04-23T16:24:27Z")

</div>

when you enter insert mode, the editor should send a completion request with log entries like the three lines below (here my cursor is just after `arr.`). If you don’t get them, can you check the `*debug*` buffer for error messages?

```auto
Apr 23 16:20:45.716 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":5,"line":5},"textDocument":{"uri":"file:///home/johannes/git/kak-lsp/t/js/test.js"}},"id":1}, module: kak_lsp::language_server_transport:182
Apr 23 16:20:45.774 DEBG From server: {"jsonrpc":"2.0","id":1,"result":{"items":[{"label":"concat","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["concat"]},"insertTextFormat":2},{"label":"copyWithin","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["copyWithin"]},"insertTextFormat":2},{"label":"entries","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["entries"]},"insertTextFormat":2},{"label":"every","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["every"]},"insertTextFormat":2},{"label":"fill","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["fill"]},"insertTextFormat":2},{"label":"filter","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["filter"]},"insertTextFormat":2},{"label":"find","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["find"]},"insertTextFormat":2},{"label":"findIndex","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["findIndex"]},"insertTextFormat":2},{"label":"forEach","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["forEach"]},"insertTextFormat":2},{"label":"includes","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["includes"]},"insertTextFormat":2},{"label":"indexOf","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["indexOf"]},"insertTextFormat":2},{"label":"join","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["join"]},"insertTextFormat":2},{"label":"keys","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["keys"]},"insertTextFormat":2},{"label":"lastIndexOf","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["lastIndexOf"]},"insertTextFormat":2},{"label":"length","kind":5,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["length"]}},{"label":"map","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["map"]},"insertTextFormat":2},{"label":"pop","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["pop"]},"insertTextFormat":2},{"label":"push","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["push"]},"insertTextFormat":2},{"label":"reduce","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["reduce"]},"insertTextFormat":2},{"label":"reduceRight","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["reduceRight"]},"insertTextFormat":2},{"label":"reverse","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["reverse"]},"insertTextFormat":2},{"label":"shift","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["shift"]},"insertTextFormat":2},{"label":"slice","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["slice"]},"insertTextFormat":2},{"label":"some","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["some"]},"insertTextFormat":2},{"label":"sort","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["sort"]},"insertTextFormat":2},{"label":"splice","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["splice"]},"insertTextFormat":2},{"label":"toLocaleString","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["toLocaleString"]},"insertTextFormat":2},{"label":"toString","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["toString"]},"insertTextFormat":2},{"label":"unshift","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["unshift"]},"insertTextFormat":2},{"label":"values","kind":2,"sortText":"11","commitCharacters":[".",",","("],"data":{"file":"/home/johannes/git/kak-lsp/t/js/test.js","line":6,"offset":6,"entryNames":["values"]},"insertTextFormat":2}],"isIncomplete":false}}, module: kak_lsp::language_server_transport:156
Apr 23 16:20:45.777 DEBG To editor `kak-lsp`: evaluate-commands -client client0 -verbatim -- set window lsp_completions 6.6@1 'concat|set-option window lsp_completions_selected_item 0; info -style menu ''''|concat {MenuInfo}Method' 'copyWithin|set-option window lsp_completions_selected_item 1; info -style menu ''''|copyWithin {MenuInfo}Method' 'entries|set-option window lsp_completions_selected_item 2; info -style menu ''''|entries {MenuInfo}Method' 'every|set-option window lsp_completions_selected_item 3; info -style menu ''''|every {MenuInfo}Method' 'fill|set-option window lsp_completions_selected_item 4; info -style menu ''''|fill {MenuInfo}Method' 'filter|set-option window lsp_completions_selected_item 5; info -style menu ''''|filter {MenuInfo}Method' 'find|set-option window lsp_completions_selected_item 6; info -style menu ''''|find {MenuInfo}Method' 'findIndex|set-option window lsp_completions_selected_item 7; info -style menu ''''|findIndex {MenuInfo}Method' 'forEach|set-option window lsp_completions_selected_item 8; info -style menu ''''|forEach {MenuInfo}Method' 'includes|set-option window lsp_completions_selected_item 9; info -style menu ''''|includes {MenuInfo}Method' 'indexOf|set-option window lsp_completions_selected_item 10; info -style menu ''''|indexOf {MenuInfo}Method' 'join|set-option window lsp_completions_selected_item 11; info -style menu ''''|join {MenuInfo}Method' 'keys|set-option window lsp_completions_selected_item 12; info -style menu ''''|keys {MenuInfo}Method' 'lastIndexOf|set-option window lsp_completions_selected_item 13; info -style menu ''''|lastIndexOf {MenuInfo}Method' 'length|set-option window lsp_completions_selected_item 14; info -style menu ''''|length {MenuInfo}Field' 'map|set-option window lsp_completions_selected_item 15; info -style menu ''''|map {MenuInfo}Method' 'pop|set-option window lsp_completions_selected_item 16; info -style menu ''''|pop {MenuInfo}Method' 'push|set-option window lsp_completions_selected_item 17; info -style menu ''''|push {MenuInfo}Method' 'reduce|set-option window lsp_completions_selected_item 18; info -style menu ''''|reduce {MenuInfo}Method' 'reduceRight|set-option window lsp_completions_selected_item 19; info -style menu ''''|reduceRight {MenuInfo}Method' 'reverse|set-option window lsp_completions_selected_item 20; info -style menu ''''|reverse {MenuInfo}Method' 'shift|set-option window lsp_completions_selected_item 21; info -style menu ''''|shift {MenuInfo}Method' 'slice|set-option window lsp_completions_selected_item 22; info -style menu ''''|slice {MenuInfo}Method' 'some|set-option window lsp_completions_selected_item 23; info -style menu ''''|some {MenuInfo}Method' 'sort|set-option window lsp_completions_selected_item 24; info -style menu ''''|sort {MenuInfo}Method' 'splice|set-option window lsp_completions_selected_item 25; info -style menu ''''|splice {MenuInfo}Method' 'toLocaleString|set-option window lsp_completions_selected_item 26; info -style menu ''''|toLocaleString {MenuInfo}Method' 'toString|set-option window lsp_completions_selected_item 27; info -style menu ''''|toString {MenuInfo}Method' 'unshift|set-option window lsp_completions_selected_item 28; info -style menu ''''|unshift {MenuInfo}Method' 'values|set-option window lsp_completions_selected_item 29; info -style menu ''''|values {MenuInfo}Method'

```

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 23, 2022, 5:33pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/14 "2022-04-23T17:33:11Z")

</div>

Here is the new log:

```auto
Apr 23 22:57:42.411 INFO Starting main event loop, module: kak_lsp::session:28
Apr 23 22:58:39.055 DEBG From editor: 
session = "foobar"
client = ""
buffile = ""
filetype = ""
version = 0
method = "stop"
[params]
, module: kak_lsp::editor_transport:129
Apr 23 22:58:39.055 INFO Shutting down language servers and exiting, module: kak_lsp::session:171
Apr 23 22:58:39.055 INFO Waiting for Messages to editor to finish..., module: kak_lsp::thread_worker:19
Apr 23 22:58:39.055 INFO ... Messages to editor terminated with ok, module: kak_lsp::thread_worker:21

```

and here is the message from **\*\*debug** \*\* buffer.

```auto
recursive call of hook InsertChar/', not executing.

```

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 23, 2022, 6:10pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/15 "2022-04-23T18:10:16Z")

</div>

> recursive call of hook InsertChar/', not executing.

kak-lsp does not add InsertChar hooks. This is likely some bad InsertChar hook in your config.

It’s often a great idea to try with a _minimal_ config, to isolate root causes.  
This shell script should work for you. Since it uses a temporary $HOME, it won’t read your `~/.config/kak/kakrc`.

```shell
tmp=$(mktemp -d)

echo > "$tmp"/kak-lsp.toml '
[language.javascript]
filetypes = ["javascript"]
roots = ["*.js"]
command = "typescript-language-server"
args = ["--stdio"]
'

echo > "$tmp"/test.js "
function addTwoNums(n) {
	var nums = ('' + n).split('')
	var arr = ['a'];
	arr.
	return 1
}
"

HOME=$tmp kak -e "
    eval %sh{kak-lsp --kakoune -s \$kak_session}
    set global lsp_cmd \"kak-lsp -s %val{session} -vvvv --log /tmp/kak-lsp.log -c $tmp/kak-lsp.toml\"
    lsp-enable" "$tmp/test.js"

```

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 24, 2022, 8:04am UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/16 "2022-04-24T08:04:30Z")

</div>

Yes!! It was some error in the config stopping rest of the commands from executing properly. Tried commenting a few lines and was finally able to find the section that was causing the issue. One curious question though, it shows the suggestions properly now (`methods, vars.. etc`), but, is there a way to get an explanation for each like the above screenshot of vs code? For a method, I would like to know what args it accepts and what it returns… signature sort of.

and thank you so much for the helping hand. It would’ve been difficult without you guiding me in the right direction. Having a forum like this is really a boon.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [April 24, 2022, 4:23pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/17 "2022-04-24T16:23:43Z")

</div>

> is there a way to get an explanation for each like the above screenshot of vs code?

That was a bug in kak-lsp (sadly LSP allows servers and clients to do many weird things). Fixed as of [Support resolving completion items' "detail" and "documentation" fields · kak-lsp/kak-lsp@6bee0a1 · GitHub](https://github.com/kak-lsp/kak-lsp/commit/6bee0a132ea7efd1d3b37be7676c2b84bec74382)  
Thanks for reporting!  
I wonder if we should switch the default language server for javascript from “flow” to typescript-language-server, since that’s what VSCode uses. I rarely use javascript so I dunno

---

<div class="post-metadata">

**Author:** ![theMars](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@theMars](https://discuss.kakoune.com/u/theMars)\
**Post date:** [April 24, 2022, 5:31pm UTC](https://discuss.kakoune.com/t/unable-to-verify-if-kak-lsp-is-working-mac/2051/18 "2022-04-24T17:31:01Z")

</div>

> [@krobelus](#):
>
> I wonder if we should switch the default language server for javascript from “flow” to typescript-language-server, since that’s what VSCode uses.

Most of the editors I used and projects I worked on uses the `typescript-language-server`. I think it’ll be a good idea to change to that for the benefit of new users. If it’s possible to leave the config for `flow` under a comment, that’d be good too. But, ts-server being default makes sense.
