{"action":"created","issue":{"url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/10795","repository_url":"https://api.github.com/repos/syl20bnr/spacemacs","labels_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/10795/labels{/name}","comments_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/10795/comments","events_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/10795/events","html_url":"https://github.com/syl20bnr/spacemacs/pull/10795","id":328781910,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjIwNTg1","number":10795,"title":"Only use lsp-javascript-typescript","user":{"login":"ztlevi","id":16655096,"node_id":"MDQ6VXNlcjE2NjU1MDk2","avatar_url":"https://avatars0.githubusercontent.com/u/16655096?v=4","gravatar_id":"","url":"https://api.github.com/users/ztlevi","html_url":"https://github.com/ztlevi","followers_url":"https://api.github.com/users/ztlevi/followers","following_url":"https://api.github.com/users/ztlevi/following{/other_user}","gists_url":"https://api.github.com/users/ztlevi/gists{/gist_id}","starred_url":"https://api.github.com/users/ztlevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztlevi/subscriptions","organizations_url":"https://api.github.com/users/ztlevi/orgs","repos_url":"https://api.github.com/users/ztlevi/repos","events_url":"https://api.github.com/users/ztlevi/events{/privacy}","received_events_url":"https://api.github.com/users/ztlevi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2018-06-02T22:24:03Z","updated_at":"2018-07-12T16:04:33Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/syl20bnr/spacemacs/pulls/10795","html_url":"https://github.com/syl20bnr/spacemacs/pull/10795","diff_url":"https://github.com/syl20bnr/spacemacs/pull/10795.diff","patch_url":"https://github.com/syl20bnr/spacemacs/pull/10795.patch"},"body":"Mentioned [here](https://github.com/syl20bnr/spacemacs/issues/10670#issuecomment-388653121), the import completion is not properly enabled and it needs to enable lsp backend for `js-mode`. Not sure why is that but I tested and it should be enabled for that. You can take look at the following screenshot about the discussion. So as the `lsp-typescript`, we have to install the npm package and enable it for the related modes.\r\n\r\n![image](https://user-images.githubusercontent.com/16655096/40881311-fed96c02-6677-11e8-983e-76a6ac96f6da.png)\r\n\r\nAlso, I created a method called `spacemacs//lsp-js-setup-backend` and try to hook it with `js-mode`. \r\n```\r\n(defun spacemacs//lsp-js-setup-backend ()\r\n  \"Setup lsp backend for js-mode\"\r\n  (if (configuration-layer/layer-used-p 'lsp)\r\n      (progn\r\n        (lsp-javascript-typescript-enable)\r\n        (lsp-javascript-flow-enable)\r\n        (lsp-typescript-enable))\r\n    (message (concat \"`lsp' layer is not installed, \"\r\n                     \"please add `lsp' layer to your dotfile.\"))))\r\n```\r\nBut it doesn't have the proper completion if I did so. But it works if I hook the methods like this \r\n```\r\n(add-hook 'js-mode-hook #'lsp-javascript-typescript-enable)\r\n(add-hook 'js-mode-hook #'lsp-javascript-flow-enable)\r\n(add-hook 'js-mode-hook #'lsp-typescript-enable)\r\n```\r\nI am really confuesd with this behavior. Do you guys have any idea on this one? @fiveNinePlusR @sdwolfz\r\n"},"comment":{"url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/comments/404564276","html_url":"https://github.com/syl20bnr/spacemacs/pull/10795#issuecomment-404564276","issue_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/10795","id":404564276,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDU2NDI3Ng==","user":{"login":"njunxuan","id":5763900,"node_id":"MDQ6VXNlcjU3NjM5MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/5763900?v=4","gravatar_id":"","url":"https://api.github.com/users/njunxuan","html_url":"https://github.com/njunxuan","followers_url":"https://api.github.com/users/njunxuan/followers","following_url":"https://api.github.com/users/njunxuan/following{/other_user}","gists_url":"https://api.github.com/users/njunxuan/gists{/gist_id}","starred_url":"https://api.github.com/users/njunxuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njunxuan/subscriptions","organizations_url":"https://api.github.com/users/njunxuan/orgs","repos_url":"https://api.github.com/users/njunxuan/repos","events_url":"https://api.github.com/users/njunxuan/events{/privacy}","received_events_url":"https://api.github.com/users/njunxuan/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T16:04:32Z","updated_at":"2018-07-12T16:04:32Z","author_association":"NONE","body":"Thank you for the hard work @ztlevi! This fixes a host of other issues such as the lsp-mode starting even though tide is the selected backend, breaking things such as flycheck. The same applies to the python pull-request."}}
{"actor":{"display_login":"njunxuan"}}