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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
The sample given at for Writing-a-Language-Service-Plugin
doesn't compile.
#45915
Comments
Looks like the code samples assume |
I'm still hitting a bunch of roadblocks as I work through this. I'd be happy to update the documentation if someone wants to be available for me to check in with as I work my way through this. It's a side project at work so I don't have a ton of time to go digging around myself 馃槵 |
Cool! I've updated the code on the wiki page (and you're welcome to update it too, https://github.com/microsoft/TypeScript-wiki/blob/main/Writing-a-Language-Service-Plugin.md ) to handle The system is very simple - you give the |
Thanks for such a quick response! This documentation may be easy to follow if you have some familiarity with this environment but it's all pretty new to me. Questions that came up for me: I put breakpoints in my plugin but it says they're unbound. Then I found this and am walking through it now, but am not sure if this is overkilll: I've just cloned the repo and built it. Am I on the right path? |
Not sure what鈥檚 going on with the plugin, but debugging could help you figure it out. Here are some more resources for debugging TS Server: |
Thanks! I'll give these a shot =) |
Hey @andrewbranch, I got the logging working, specified the directory to my plugin and it says this: (When following the Testing Locally directions). I am using VS Code, so following the first approach; I don't understand how the alternate suggestion (choosing the typescript version) would load my extension? |
It sounds like you're hitting the security checks from #42713 - which means you need to have the project which has the tsserver plugin use your plugin via a module name reference ( e.g. |
I'm not sure what you mean here. I ran the |
That code sample goes in your |
This isn't a full template, I don't have much time this week because of the 4.5 beta, but here is a working TS Server plugin template which has source maps and the debugger set up: https://github.com/orta/TypeScript-TSServer-Plugin-Template |
Thanks for doing this and no worries. I'm not sure I have much time either! |
Is there a better way to chat about this? Do you guys have a slack channel? For the last step, do I need to be running a development version of typescript? |
There鈥檚 a link to a Discord community and a few other resources here: https://www.typescriptlang.org/community
If you want source mapped debugging, yes. If you are ok with debugging the bazillion-line tsserver.js, no. |
Bug Report
馃攷 Search Terms
plugin
language-service
compile
馃捇 Code
This is copied from the guide at
https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin
馃檨 Actual behavior
I am entering the code sample from
https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin
and I am getting compile errors while setting up the decorator:馃檪 Expected behavior
I was hoping I could copy/paste the sample and it would work.
NOTE: It's also possible the documentation around this just needs to be clearer. How do you go about starting the plugin? Do you run
yo code
? Do you runnpm init
? Do you just create a single fileindex.js
? I am very unclear how to begin development of this plugin.The text was updated successfully, but these errors were encountered: