Skip to content
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

Only work for the first javascript buffer. #311

Open
Clloz opened this issue Apr 13, 2019 · 3 comments
Open

Only work for the first javascript buffer. #311

Clloz opened this issue Apr 13, 2019 · 3 comments

Comments

@Clloz
Copy link

Clloz commented Apr 13, 2019

The first js file work well,but if I kill the buffer or open other js files,it doesn't work.
I use spacemacs, so I add the configuration(from readme) on dotspacemacs/user-config.

  ;;tide
  ;;use package
  (use-package tide
    :ensure t
    :after (typescript-mode company flycheck)
    ;;:hook ((typescript-mode . tide-setup)
      ;;     (typescript-mode . tide-hl-identifier-mode)
        ;;   (before-save . tide-format-before-save))
    )
  ;;typescript
  (require 'flycheck)
  (defun setup-tide-mode ()
  (interactive)
  (tide-setup)
  (flycheck-mode +1)
  (setq flycheck-check-syntax-automatically '(save mode-enabled))
  (eldoc-mode +1)
  (tide-hl-identifier-mode +1)
  ;; company is an optional dependency. You have to
  ;; install it separately via package-install
  ;; `M-x package-install [ret] company`
  (company-mode +1))

  ;; aligns annotation to the right hand side
  (setq company-tooltip-align-annotations t)

  ;; formats the buffer before saving
  (add-hook 'before-save-hook 'tide-format-before-save)

  (add-hook 'typescript-mode-hook #'setup-tide-mode)
  (add-hook 'js2-mode-hook #'setup-tide-mode)
  ;;tsx
  (require 'web-mode)
  (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "tsx" (file-name-extension buffer-file-name))
                (setup-tide-mode))))
  ;; enable typescript-tslint checker
  (flycheck-add-mode 'typescript-tslint 'web-mode)
  ;;javascript
  (setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil))
  ;; configure javascript-tide checker to run after your default javascript checker
  ;;(flycheck-add-next-checker 'javascript-eslint 'javascript-tide 'append)
  ;;jsx
  (require 'web-mode)
  (add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "jsx" (file-name-extension buffer-file-name))
                (setup-tide-mode))))
  ;; configure jsx-tide checker to run after your default jsx checker
  (flycheck-add-mode 'javascript-eslint 'web-mode)
  ;;(flycheck-add-next-checker 'javascript-eslint 'jsx-tide 'append)
  ;;tide

tide-mode is enabled,and tsserver looks well,I don't know how to fix this problem.

@bananaoomarang
Copy link

Think I am experiencing the same thing. Haven't looked too deeply into it but in the logs I see an error saying TS can't find the file:

  "seq": 0,
  "type": "response",
  "command": "documentHighlights",
  "request_seq": "101",
  "success": false,
  "message": "Error processing request.
Could not find sourceFile: '/home/milo/scite/client/pages/HomeApp.js' in [\"/home/milo/.emacs.d/elpa/tide-20190321.1611/tsserver/lib.es6.d.ts\",
\"/home/milo/.emacs.d/elpa/tide-20190321.1611/tsserver/lib.es5.d.ts\"

...truncated
}
```

@ananthakumaran
Copy link
Owner

A minimal project which reproduces this issue would help us with identifying the problem. With the current description, there aren't any clues as to where the issue might be.

@DrMeers
Copy link

DrMeers commented May 18, 2021

Is this the same issue as #211?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants