Skip to content

Commit

Permalink
lsp-vertur add default emmet setting (#1088)
Browse files Browse the repository at this point in the history
otherwise vls will throw a error inside style tag "Request
textDocument/completion failed with message: Cannot read property
'showExpandedAbbreviation' of undefined"

This should be handled by vls but until they do we use this work around.
  • Loading branch information
thanhvg authored and yyoncho committed Oct 11, 2019
1 parent a0d5068 commit 5c1378c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lsp-vetur.el
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,15 @@ Code's JavaScript and TypeScript support."
:type 'boolean
:package-version '(lsp-mode . "6.1"))

(defcustom lsp-vetur-emmet "never"
"Controls the Emmet suggestions that show up in the suggestion/completion list."
:type '(choice
(const "never")
(const "inMarkupAndStylesheetFilesOnly")
(const "always" ))
:group 'lsp-vetur
:package-version '(lsp-mode . "6.1"))

(lsp-register-custom-settings
'(("javascript.autoClosingTags" lsp-javascript-auto-closing-tags t)
("javascript.format.enable" lsp-javascript-format-enable t)
Expand Down Expand Up @@ -763,7 +772,8 @@ Code's JavaScript and TypeScript support."
("vetur.completion.tagCasing" lsp-vetur-completion-tag-casing)
("vetur.completion.useScaffoldSnippets" lsp-vetur-completion-use-scaffold-snippets t)
("vetur.completion.autoImport" lsp-vetur-completion-auto-import t)
("vetur.useWorkspaceDependencies" lsp-vetur-use-workspace-dependencies t)))
("vetur.useWorkspaceDependencies" lsp-vetur-use-workspace-dependencies t)
("emmet.showExpandedAbbreviation" lsp-vetur-emmet)))

(define-obsolete-variable-alias
'lsp-vetur-server
Expand Down Expand Up @@ -795,13 +805,15 @@ Code's JavaScript and TypeScript support."
(lsp-configuration-section "html")
(lsp-configuration-section "javascript")
(lsp-configuration-section "typescript")
(lsp-configuration-section "emmet")
(ht ("globalSnippetDir" lsp-vetur-global-snippets-dir))))
:initialized-fn (lambda (workspace)
(with-lsp-workspace workspace
(lsp--set-configuration
(ht-merge (lsp-configuration-section "vetur")
(lsp-configuration-section "html")
(lsp-configuration-section "javascript")
(lsp-configuration-section "emmet")
(lsp-configuration-section "typescript")))))))

(provide 'lsp-vetur)
Expand Down

0 comments on commit 5c1378c

Please sign in to comment.