ts-lit-plugin
Version:
Typescript plugin that adds type checking and code completion to lit-html
39 lines (38 loc) • 1.65 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LitPluginContext = void 0;
var lit_analyzer_1 = require("lit-analyzer");
var logger_1 = require("../logger");
var LitPluginContext = /** @class */ (function (_super) {
__extends(LitPluginContext, _super);
function LitPluginContext() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.logger = logger_1.logger;
return _this;
}
LitPluginContext.prototype.updateConfig = function (config) {
var hasChangedLogging = config.logging !== "off" && (this.config.logging !== config.logging || this.config.cwd !== config.cwd);
// Setup logging
this.logger.cwd = config.cwd;
_super.prototype.updateConfig.call(this, config);
if (hasChangedLogging) {
this.logger.resetLogs();
}
logger_1.logger.debug("Updating the config", config);
};
return LitPluginContext;
}(lit_analyzer_1.DefaultLitAnalyzerContext));
exports.LitPluginContext = LitPluginContext;