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

No intellisense from tsserver for .tsx files #48

Closed
city41 opened this issue Aug 9, 2018 · 3 comments
Closed

No intellisense from tsserver for .tsx files #48

city41 opened this issue Aug 9, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@city41
Copy link

city41 commented Aug 9, 2018

Describe the bug
The typescript language server works for .ts files, but not .tsx

To Reproduce
Steps to reproduce the behavior:

  1. Open a typescript project that has .tsx files
  2. Open a tsx file
  3. attempt to use intellisense such as getting the properties from a type
type MyType = { bar: string };
function foo(a: MyType) {
    return a.b    <----- expecting autocomplete of "bar" here
}

Expected behavior
Expecting the intellisense to autocomplete based on the type using the ts language server

Actual behavior: the intellisense is just based on other sources such as around
Screenshots

screenshot

Desktop (please complete the following information):

  • Terminal: mintty on Windows 10 (ssh'd into Ubuntu 16.04 machine)
  • Version: nvim v0.3.2-188-g821310930

Additional context
Everything works as expected in .ts files. A tsx file has filetype of typescriptreact. When I do set filetype=typescript, I see two messages from coc.nvim indicating it found tsserver and is using it. But despite that, I still don't get the expected behavior in tsx files.

Here is my init.vim: https://github.com/city41/dotfiles/blob/master/config/.config/nvim/init.vim

Thanks for this great plugin!

@city41 city41 changed the title No intellisence from tsserver for .tsx files No intellisense from tsserver for .tsx files Aug 10, 2018
@chemzqm chemzqm added the bug Something isn't working label Aug 11, 2018
@city41
Copy link
Author

city41 commented Aug 11, 2018

Works great! Thanks for the quick fix!

@QuadeMorrison
Copy link
Contributor

This commit seems to have broken the plugin when using the typescript.jsx filetype, which makes sense since you replaced typescript.jsx with typescriptreact. I'm interested in how a tsx file got set to the filetype typescriptreact because vanilla nvim doesn't even recognize typescript files out of the box as of version 0.3.1, meaning that these file types are basically us being at the mercy of what plugins decide is correct.

@chemzqm
Copy link
Member

chemzqm commented Aug 23, 2018

@QuadeMorrison It's not rename b3604e0#diff-375d26229ede96ca813dae07d7bdcf8aR8, it adds support of typescriptreact as filetype.

typescript.tsx is used because https://github.com/ianks/vim-tsx/blob/master/ftdetect/typescript.vim use that as filetype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants