JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 128
  • Score
    100M100P100Q73277F
  • License MIT

Utilities for developing TypeScript Language Server Plugins

Package Exports

  • typescript-plugin-util

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typescript-plugin-util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

typescript-plugin-util

Utilities for developing TypeScript Language Server Plugins

Install a Language Service Plugin easily:

Easy plugin installation

const serviceLanguageImplementation = { getApplicableRefactors, getEditsForRefactor }
export = pluginDefaultInitialize(pluginDefinition, (modules, info)=>{
 info.project.projectService.logger.info(`${PLUGIN_NAME} created!`) 
})

Instead of:

function init(modules: { typescript: typeof ts_module }) {
  function create(anInfo: ts_module.server.PluginCreateInfo) {
    info.project.projectService.logger.info(`${PLUGIN_NAME} created`)
    const proxy: ts.LanguageService = Object.create(null)
    for (let k of Object.keys(info.languageService) as Array<keyof ts.LanguageService>) {
      const x = info.languageService[k]
      proxy[k] = (...args: Array<{}>) => x.apply(info.languageService, args)
    }
    proxy.getApplicableRefactors = getApplicableRefactors
    proxy.getEditsForRefactor = getEditsForRefactor
    return proxy
  }
  return { create }
}
export = init

API docs

See apidocs

TODO