Skip to content

Suggested solution to #5730 [tsserver] custom command #6010

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

Closed
wants to merge 7 commits into from
Closed

Suggested solution to #5730 [tsserver] custom command #6010

wants to merge 7 commits into from

Conversation

mihailik
Copy link
Contributor

@mihailik mihailik commented Dec 9, 2015

See discussion (specifically my comment) in #5730 .

To summarise here, the idea is to allow complex hosts (such as Angular-aware editors) to inject extra commands into tsserver, without recompiling tsserver.js.

Instead of all the complexity of a plugin hosting model, I suggest we turn the table and put the burden of hosting on the actual host interested in running tsserver.

The Angular-editing enrichment will load tsserver.js script content, eval() it, then it has a window to update ts.server.Session.prototype to its liking before the server starts up proper.

@mihailik
Copy link
Contributor Author

mihailik commented Dec 9, 2015

To make it even sweeter, the top-level ts can be exported!

That way no eval() cheats are needed, you simply:

require('tsserver').server.Session.prototype // <-- work your magic

@mhegazy
Copy link
Contributor

mhegazy commented Sep 13, 2016

closing in favor of #6508 and the associated PRs (#10163, #10160 and #10159)

@mhegazy mhegazy closed this Sep 13, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants