Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Issues with TS 2.0? #15

Closed
faceleg opened this issue Aug 3, 2016 · 8 comments
Closed

Issues with TS 2.0? #15

faceleg opened this issue Aug 3, 2016 · 8 comments
Assignees

Comments

@faceleg
Copy link
Collaborator

faceleg commented Aug 3, 2016

Getting this in :messages when using with TypeScript@2:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/sources/typescript.py", line 139, in gather_candidates
[deoplete]     if (entry["kind"] != "warning"):
[deoplete] TypeError: string indices must be integers
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results
[deoplete]     context['candidates'] = source.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/sources/typescript.py", line 139, in gather_candidates
[deoplete]     if (entry["kind"] != "warning"):
[deoplete] TypeError: string indices must be integers
[deoplete] An error has occurred. Please execute :messages command.
[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 47, in completion_begin
[deoplete]     complete_position, candidates = self.gather_candidates(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 73, in gather_candidates
[deoplete]     results = self.gather_results(context)
[deoplete]   File "/Users/faceleg/.cache/nvim/dein/.dein/rplugin/python3/deoplete/deoplete.py", line 124, in gather_results

Haven't had a chance to start debugging.

@mhartington
Copy link
Owner

Hmm just about to start my day, but looks like https://github.com/mhartington/deoplete-typescript/blob/master/rplugin/python3/deoplete/sources/typescript.py#L139

is causing the issues. @DonnieWest added this.

@DonnieWest
Copy link
Collaborator

@mhartington I can look into it tonight. It looks like after removing that check, it still fails everywhere else that uses string indices.

@DonnieWest
Copy link
Collaborator

DonnieWest commented Aug 4, 2016

Reverting back to before my changes still errors out with a similar error here https://github.com/mhartington/deoplete-typescript/blob/dd582eaa74e275c7ec630b4d1b70056cd4ea82e5/rplugin/python3/deoplete/sources/typescript.py#L153

Even fixing some of the errors, it looks like the response from Typescript 2.0 is different enough to display wrong completions. I can push up some of these fixes, but I think I'd prefer to error out on 2.0 instead of giving out the wrong information.

I don't know enough about tsserver to be able to debug this. I'd suggest someone else head this up, but if I get some time I might give it a shot

@faceleg
Copy link
Collaborator Author

faceleg commented Aug 4, 2016

@mhartington
Copy link
Owner

I'll poke around and see what up. I personally don't use 2.0 since it's still beta.

Might be worth just grabbing our own copy of the tsserver code and bundling it with the code base for future releases.

@faceleg
Copy link
Collaborator Author

faceleg commented Aug 5, 2016

I started using 2.0 because @types are much less horrible (no more ///).

In an ideal world where we all got paid to work on OSS projects, I'd suggest the plugin sniffs for the available TSS version and adjusts it's response handling based on that.

Bundling the server would make it break for code written for a different compiler, only in new and interesting ways

@mhartington
Copy link
Owner

Hmm, this should be do-able. Hopefully.... we'll just drop support for 1x version of tss once 2.0 is stable and is no longer in beta.

Will try to look into this tonight!

@mhartington mhartington self-assigned this Aug 8, 2016
@faceleg
Copy link
Collaborator Author

faceleg commented Aug 10, 2016

Yeah, TS seems to move rather fast, and the improvements are often worth the upgrade pain.

@faceleg faceleg mentioned this issue Aug 11, 2016
HerringtonDarkholme added a commit to HerringtonDarkholme/deoplete-typescript that referenced this issue Aug 27, 2016
If request_seq is the same as seq, return result
If request_seq is greater than seq, return None
otherwise waiting for correct response
mhartington pushed a commit that referenced this issue Aug 29, 2016
* throttle reload in gather_candidates

* fix #15, await correct response

If request_seq is the same as seq, return result
If request_seq is greater than seq, return None
otherwise waiting for correct response

* fix break
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants