diff --git a/.scripts/samples.js b/.scripts/samples.js index fe27b5e3..aa321d27 100644 --- a/.scripts/samples.js +++ b/.scripts/samples.js @@ -52,7 +52,7 @@ const samples = [{ path: 'decorator-sample', guide: null, apis: ['TextEditor.setDecorations', 'DecorationOptions', 'DecorationInstanceRenderOptions', 'ThemableDecorationInstanceRenderOptions', 'window.createTextEditorDecorationType', 'TextEditorDecorationType'], - contributions: [] + contributions: [ 'colors'] }, // { description: 'extension-deps-sample', path: 'extension-deps-sample', guide: null, apis: [], contributions: [] }, // { description: 'hellocode-minimal-sample', path: 'hellocode-minimal-sample', guide: null, apis: [], contributions: [] }, diff --git a/decorator-sample/.vscodeignore b/decorator-sample/.vscodeignore index 9ca85fe6..213bfc7a 100644 --- a/decorator-sample/.vscodeignore +++ b/decorator-sample/.vscodeignore @@ -1,7 +1,6 @@ .vscode/** -typings/** **/*.ts **/*.map .gitignore +tslint.json tsconfig.json -vsc-extension-quickstart.md diff --git a/decorator-sample/README.md b/decorator-sample/README.md index d701d6eb..ee700de8 100644 --- a/decorator-sample/README.md +++ b/decorator-sample/README.md @@ -6,7 +6,7 @@ The sample creates a decoration for each number that appears in the active edito demonstrates some of the decorator features such as borders, background colors, cursors and hovers. -The sample also shows the use of a user defined themeable color. This is the recommended way when using cololrs as it allows users (and themes) to configure the color in the user settings. +The sample also shows the use of a user defined themeable color. Instead of hardcoding a color value this allows users (and themes) to redefine the color in the user settings. ![sample](preview.png) diff --git a/decorator-sample/src/extension.ts b/decorator-sample/src/extension.ts index f2142c67..9c573189 100644 --- a/decorator-sample/src/extension.ts +++ b/decorator-sample/src/extension.ts @@ -24,6 +24,7 @@ export function activate(context: vscode.ExtensionContext) { // create a decorator type that we use to decorate large numbers const largeNumberDecorationType = vscode.window.createTextEditorDecorationType({ cursor: 'crosshair', + // use a themable color. See package.json for the declaration and default values. backgroundColor: { id: 'myextension.largeNumberBackground' } }); @@ -45,7 +46,7 @@ export function activate(context: vscode.ExtensionContext) { } }, null, context.subscriptions); - let timeout = null; + let timeout : NodeJS.Timer | null = null; function triggerUpdateDecorations() { if (timeout) { clearTimeout(timeout);