-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I use lsp completion without lsp--cur-workspace? #58
Comments
company-lsp doesn't work if you cannot run language server on the code. IMO there can be solution to this - create a temporary buffer for the source block and run language server over the temporary file, pipe the result to the original buffer. However, this is beyond the scope of company-lsp. Maybe open a feature request to lsp-mode? |
This is already fixed in lsp-mode emacs-lsp/lsp-mode#377 (comment) |
This is fixed in
|
To setup lsp-javascript-typescript you should have package.json in the root(similar to the java project where you have pom.xml somewhere in the root). Here it is the relevant code https://github.com/emacs-lsp/lsp-javascript/blob/ab62826962887e82f0bc968817be4fc89a6953e4/lsp-typescript.el#L54 . You should first setup the language server without org-mode and then configure org-mode to point to one of the files in the project. |
I decide to write a small package specially for handling this. I found Org Mode has a built-in header argument |
Sounds good to me. Make sure you do a reddit post after it is ready. |
The
(use-package lsp-javascript-typescript
:ensure t
:ensure-system-package (javascript-typescript-stdio . "npm i -g javascript-typescript-langserver")
:init (require 'lsp-javascript-typescript)
(add-hook 'js-mode-hook #'lsp-mode)
(add-hook 'js-mode-hook #'lsp-javascript-typescript-enable)
(add-hook 'js2-mode-hook #'lsp-mode)
(add-hook 'js2-mode-hook #'lsp-javascript-typescript-enable)
(add-hook 'js3-mode-hook #'lsp-mode)
(add-hook 'js3-mode-hook #'lsp-javascript-typescript-enable) ;; for js3-mode support
(add-hook 'typescript-mode-hook #'lsp-javascript-typescript-enable)
(add-hook 'rjsx-mode #'lsp-javascript-typescript-enable) ;; for rjsx-mode support
;; Org Babel source block support
;; TODO:
) |
This bug is no longer relevant. |
I want to get code completion in Org Mode source block. But lsp-mode/company-lsp requires
lsp--cur-workspace
. Is it possible to code completion without it?The text was updated successfully, but these errors were encountered: