microsoft / vscode-html-languageservice

Language services for HTML
MIT License
229 stars 110 forks source link

Please add a `my-lsp-server --help` option or methodically document any configuration & files #176

Closed dcunited001 closed 8 months ago

dcunited001 commented 10 months ago

could microsoft be bothered to document LSP server configuration and any config files I can use.

why is microsoft's documentation on their LSP servers so sparse? i wasted a ton of amount of time trying to get their CSS LSP configured.

i thought i was clever, using the lsp-mode files as a reference ... just to find out there's a config file I can use instead

and then it turns out that ... if i was doing none of that vanilla emacs itself has a better understanding of CSS out of the box

vscode-html-language-server --stdio is not formatting.

can we all just admit that LSP is over and move to treesitter, like microsoft already has with github/semantic?

dcunited001 commented 10 months ago

a my-lsp-server --stdio --HELP option would be a good start, so i don't have to open tabs.

i know microsoft has never taken a CLI-first approach to designing applications, but there's a clue

dcunited001 commented 10 months ago

like this is the best way I know how to find a configuration for a Microsoft LSP: emacs-lsp/lsp-mode/clients/lsp-html.el#L149-L166)

it's definitive and it's always there.

i recently learned: I can open vscode and pretend to edit user preferences and then browse to the system defaults.

dcunited001 commented 10 months ago

if vscode was written in clojurescript, i would probably use it. it's too bad there's nowhere you can use lisp. Paul Graham got away with it in the 1990's and Rich Hickey also worked on similar projects... coincidence?

(defvar dc/lsp-url-pattern "https://raw.githubusercontent.com/emacs-lsp/lsp-mode/master/clients/lsp-%s.el")

(defun dc/read-lisp-into-list (file)
  (with-temp-buffer
    (save-excursion
      (insert "'(\n")
      (insert-file-contents file)                         
      (goto-char (point-max))
      (insert "\n)\n"))
    ;; (pp (current-buffer))
    (read (current-buffer))))                             

(require 'url)
(defun dc/download-lsp-into-temp (mode)                   
  (let* ((url (format dc/lsp-url-pattern mode))           
         (tmp (make-temp-file "emacs-lsp-download"))
         (tmpfile (url-copy-file url tmp t))              
         (lsp-mode-list (dc/read-lisp-into-list tmp))) 
    (cl-loop for list in (cadr lsp-mode-list)          
             until (eq (car list) 'lsp-register-custom-settings)
             finally return list)))                         

(setq tmp-lisp (dc/download-lsp-into-temp "html"))
aeschli commented 8 months ago

This repo is not for the HTML language server. The service is just a library that can be used in a language server, but also in other projects. The HTML language server used in VS Code is implemented here: https://github.com/Microsoft/vscode/tree/main/extensions/html-language-features/server

Language servers configuration and APIs are defined by the LSP protocol: https://microsoft.github.io/language-server-protocol/