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

[Regression] - Language Server fails to call into plugin from v5.0-20221108 onwards #51713

Closed
jasonwilliams opened this issue Dec 1, 2022 · 11 comments
Assignees
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@jasonwilliams
Copy link

jasonwilliams commented Dec 1, 2022

Bug Report

🔎 Search Terms

"language server", "language service plugin"

🕗 Version & Regression Information

  • This changed between versions v5.0.20221103 and v5.0.20221108

This originated from: microsoft/vscode-typescript-next#61 please see here for more context.

It has been reported that the VSCode Styled Components extension stops working when also being used with TypeScript Nightly.

Our typescript plugin does use the latest version of typescript (4.9.3) and I have tested it with "next" (5.x) and it still happens so I think this bug is on the TypeScript Language Server side.

Version 20221103 successfully calls into the language server and receives completions
working-20221103

Version 20221108 fails to call into the language server, so we don't get anything at all.
notworking

Reproducing

  • You can install the VSCode Styled Components extension
  • Hover over some styled components, there are some here
  • You should get some hover information for the CSS styles
  • Add the TypeScript Nightly extension, reload VSCode, then try again
@sheetalkamat
Copy link
Member

sheetalkamat commented Dec 1, 2022

The root cause seems to be https://github.com/microsoft/typescript-template-language-service-decorator/blob/a2e4d6b4cf04bedd7498b449c65f48dceb662d9b/src/template-language-service-decorator.ts#L199 here. This fails after we converted our code to modules

@mjbvz fyi seems like you maintain that repo
@jakebailey who knows more about how to handle this.

@sheetalkamat
Copy link
Member

with typescript's export * set using getter and non cofigurable or writable i am not sure how to fix this. The getSupportedCodeFixes has multiple issues open against the API and inconvenience it causes.. #28966 #29051 #46249 for context

@jakebailey
Copy link
Member

I'm out of the country and can't look at this until next week, but in general I don't see a way to fix this other than to get everyone off of assigning to the TS library; this isn't even an esbuild thing, it's just how modules work (rollup would produce the same errors).

We "fixed" this for sys by adding setSys. But that shouldn't really be even in our API. We could do something like that for this function, but I am really wondering if we can fix the API such that this kind of thing is not needed.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Dec 5, 2022
@jakebailey
Copy link
Member

jakebailey commented Dec 6, 2022

I am back and looking at this; just to be clear, is the offending code solely in the VS Code extension, and not replicated in any other place? Or is this a problem with any and all plugins?

If it's just VS Code, then we can just use #51769 and be fine; we can get VS Code updated long before 5.0 makes it out.

@sheetalkamat
Copy link
Member

sheetalkamat commented Dec 6, 2022

any plugin would have a problem who is trying to do this but i think #51769 should be good enough for this.

@jasonwilliams
Copy link
Author

jasonwilliams commented Apr 1, 2023

Hey @sheetalkamat & @jakebailey we're still having issues with this, now that the VSCode March 2023 release went out (with TypeScript 5.0.0 set by default) we now have many users noticing auto completion has broken.

This seems to be due to the language service decorator failing. It seems some fixes were made by @mjbvz but not released.

I've pulled the latest commit from https://github.com/microsoft/typescript-template-language-service-decorator and tested it and I can see auto complete works. (i needed to bump typescript to 5.0.3).

Any help you can offer would be appreciated!

@jakebailey
Copy link
Member

I don't know what work there is to do on our end; I'm surprised we didn't close this issue after #51769 was merged.

Given the upstream problem has been fixed, it seems like this is just a matter of whatever plugins which depend on typescript-template-language-service-decorator needing to update? That's still not something we (the TS team) has any control over besides bringing things to others' attention.

Are you saying @mjbvz just needs to bump something?

@jasonwilliams
Copy link
Author

jasonwilliams commented Apr 2, 2023

Given the upstream problem has been fixed, it seems like this is just a matter of whatever plugins which depend on typescript-template-language-service-decorator needing to update?

it was fixed on the repo but no release was made, meaning plugins have nothing to update to. Also the dev-version of typescript that repo was using is now out of date.

You’re correct that it’s not directly a “TypeScript team” problem, but it is a project that falls under the Microsoft organisation for language servers.

@mjbvz
Copy link
Contributor

mjbvz commented Apr 3, 2023

@jasonwilliams Try picking up typescript-template-language-service-decorator 2.3.2 which should have the fix

@jakebailey jakebailey added External Relates to another program, environment, or user action which we cannot control. and removed Needs Investigation This issue needs a team member to investigate its status. labels Apr 3, 2023
@jasonwilliams
Copy link
Author

Hey @mjbvz thanks that works, although most of the e2e tests you wrote no longer work. The TS Server sends an empty response: styled-components/typescript-styled-plugin#9 (comment)

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

6 participants