I'm following the emacs from scratch series from system crafters and I'm on #8 "Build your own ide with lsp-mode"
In it we're walked through setting up typescript for lsp (theia-ide) and the company package for better completions. My setup code block is at the bottom and my lsp log for some reference.
I open a typescript test file to see if lsp is auto loading and if its actually working.
I get some sort of scanning animation on the far right of my bar with no indication of what it is but its only in lsp mode. You can see one frame of animation from this line pulled from my buffer list. Sometimes instead there is no scan line.
My two main issues are
1. i have no clue what the scanning is
2. lsp doesn't seem to autoload when I open a TypeScript File
3. I also tried setting up lsp for html but
1. when i turn on lsp mode in an html file i get completions from my TypeScript file.
2. In my buffer list i have a ts-ls buffer and a ts-ls::stderr but nothing for html.
Granted I'm quite new so maybe this is intended functionality.
​
* test.ts 9 TypeScript| █| ~/Projects/emacsone/OrgFiles/test.ts
​
** Languages
*** Language Server
#+begin_src emacs-lisp
(use-package lsp-mode
:commands (lsp lsp-deffered)
:init
(setq lsp-keymap-prefix "C-c l")
:config
(lsp-enable-which-key-integration t))
#+end_src
#+RESULTS:
*** TypeScript
#+begin_src emacs-lisp
(use-package typescript-mode
:mode "\\.ts\\'"
:hook (typescript-mode . lsp-deferred)
:config
(setq typescript-indent-level 2))
#+end_src
* Better Completions
#+begin_src emacs-lisp
(use-package company
:after lsp-mode
:hook (lsp-mode . company-mode)
:bind (:map company-active-map
( "<tab>" . company-complete-selection))
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
#+end_src
My LSP Log has the following
Command "/home/tyler/.emacs.d/.cache/lsp/npm/typescript-language-server/bin/typescript-language-server --tsserver-path /usr/local/bin/tsserver --stdio" is present on the path.
Command "deno lsp" is not present on the path.
Found the following clients for /home/tyler/Projects/emacsone/OrgFiles/test.ts: (server-id ts-ls, priority -2)
The following clients were selected based on priority: (server-id ts-ls, priority -2)