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

TSX highlighting some generic types as error #59

Closed
chitoku-k opened this issue Jan 5, 2019 · 12 comments
Closed

TSX highlighting some generic types as error #59

chitoku-k opened this issue Jan 5, 2019 · 12 comments

Comments

@chitoku-k
Copy link

Possibly related to #40.

Some complicated generic types that even compile seem to be highlighted error using this plugin.

let union: Array<string & number>
let props: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>

image

My environment is Neovim v0.3.2 and the vim-jsx-pretty is f40cbf3.

I appreciate any efforts made for this great plugin, thanks in advance!

@chitoku-k
Copy link
Author

Very sorry, this was not because of this plugin: vim-jsx-pretty works pretty fine in this case.

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

How did you manage to fix this? Are you using typescript-vim or vim-polygot? I've been struggling with the same problem.

@yuezk
Copy link
Collaborator

yuezk commented Jun 8, 2019

@fr3fou Disable vim-polygot and try again.

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

Now I can't get syntax highlighting to appear at all / it appears but disappears after I get out of insert mode:
image

@chitoku-k
Copy link
Author

It appears that your screenshot has a conflict with https://github.com/styled-components/vim-styled-components.

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

hmm, disabling it seems to have fixed it, but I have yet to fix another issue -
image

I don't know what filetype I should be using for typescript and tsx, right now it's set as typescript but both it and typescript.jsx / typescript.tsx give me this error smh

@chitoku-k
Copy link
Author

I don't think any problems are remaining, except that your code has some compilation errors.

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

But it compiles fine :/ it's not giving me that error in vscode

@chitoku-k
Copy link
Author

It's not because of this syntax plugin but of your plugin that runs tsserver in background. Does your project have tsconfig.json?

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

Yep, it also has jsx enabled. This error only occurs in some files, not all.

@chitoku-k
Copy link
Author

That's weird... I can't guess which plugin you are using, but assuming it's coc-tsserver, how about this issue: neoclide/coc-tsserver#35?

@fr3fou
Copy link

fr3fou commented Jun 8, 2019

autocmd BufNewFile,BufRead *.tsx set filetype=typescript.tsx
adding this may have just fixed it

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

3 participants