Giter Site home page Giter Site logo

typescript-tsserver-plugin-template's Introduction

A Template for a TypeScript Language Service Plugin

This repo has two projects:

  • / is a TSServer Plugin
  • /example is a TypeScript project which uses the root TSServer Plugin

The source files for your project

Get Started

Get the plugin working and your TS to JS converted as you save:

git clone https://github.com/orta/TypeScript-TSServer-Plugin-Template
cd TypeScript-TSServer-Plugin-Template

# Install deps and run TypeScript
npm i
npx tsc --watch

Next, get the example project up and running, it will load your TSServer Plugin from the emitted JavaScript.

# Set up the host app to work in
cd example
npm i
cd ..

# Open one VS Code window to work on your plugin
code .

# Or to hook up a debugger, use this command
# to have the TSServer wait till you attach:
TSS_DEBUG_BRK=9559 code example

# or use this to hook in later:
TSS_DEBUG=9559 code example

You can then use the launch options in this root project to connect your debugger to the running TSServer in the other window. To see changes, run the command palette "TypeScript: Reload Project" to restart the TSServer for the project.

Make sure that the TypeScript version on that project runs from your node_modules and not the version which is embedded in vscode. You can see the logs via the vscode command 'TypeScript: Open TS Server Logs." ( search for 'Loading tsserver-plugin' to see whether it loaded correctly. )

What Now?

This project has a debugger statement inside the completions which will trigger on completions, you can get that running and then you have proven the toolset works and get started building your plugin.

You can read up the docs on Language Service Plugins in the TypeScript repo wiki.

typescript-tsserver-plugin-template's People

Contributors

orta avatar amatiasq-heydoc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.