UNPKG

ts-lit-plugin

Version:

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

28 lines (27 loc) 955 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.translateCodeFix = exports.translateCodeFixes = void 0; var translate_range_js_1 = require("./translate-range.js"); 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: (0, translate_range_js_1.translateRange)(action.range), newText: action.newText } ] }; }