UNPKG

ts-lit-plugin

Version:

Typescript plugin that adds type checking and code completion to lit-html

28 lines (27 loc) 941 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.translateCodeFix = exports.translateCodeFixes = void 0; var translate_range_1 = require("./translate-range"); function translateCodeFixes(codeFixes, file) { return codeFixes.map(function (codeFix) { return translateCodeFix(file, codeFix); }); } exports.translateCodeFixes = translateCodeFixes; function translateCodeFix(file, codeFix) { return { fixName: codeFix.name, description: codeFix.message, changes: codeFix.actions.map(function (action) { return translateCodeFixAction(file, action); }) }; } exports.translateCodeFix = translateCodeFix; function translateCodeFixAction(file, action) { return { fileName: file.fileName, textChanges: [ { span: translate_range_1.translateRange(action.range), newText: action.newText } ] }; }