mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Enable checkJS in media file
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
"module": "commonjs",
|
||||
"target": "es2020",
|
||||
"jsx": "preserve",
|
||||
"checkJs": true,
|
||||
"strict": true,
|
||||
"strictFunctionTypes": true,
|
||||
"lib": [
|
||||
"dom"
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
// This script will be run within the webview itself
|
||||
// It cannot access the main VS Code APIs directly.
|
||||
|
||||
(function () {
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
const oldState = vscode.getState();
|
||||
const oldState = /** @type {{ count: number} | undefined} */ (vscode.getState());
|
||||
|
||||
const counter = document.getElementById('lines-of-code-counter');
|
||||
const counter = /** @type {HTMLElement} */ (document.getElementById('lines-of-code-counter'));
|
||||
console.log('Initial state', oldState);
|
||||
|
||||
let currentCount = (oldState && oldState.count) || 0;
|
||||
counter.textContent = currentCount;
|
||||
counter.textContent = `${currentCount}`;
|
||||
|
||||
setInterval(() => {
|
||||
counter.textContent = currentCount++;
|
||||
counter.textContent = `${currentCount++} `;
|
||||
|
||||
// Update state
|
||||
vscode.setState({ count: currentCount });
|
||||
@ -33,7 +34,7 @@
|
||||
switch (message.command) {
|
||||
case 'refactor':
|
||||
currentCount = Math.ceil(currentCount * 0.5);
|
||||
counter.textContent = currentCount;
|
||||
counter.textContent = `${currentCount}`;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user