'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import { languages, ExtensionContext, workspace } from 'vscode';
import { CssCompletionItemProvider } from './cssCompletionItemProvider';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: ExtensionContext) {

    let provider = new CssCompletionItemProvider();

    let disposable = languages.registerCompletionItemProvider('html', provider);

    let saveEventDisposable = workspace.onDidSaveTextDocument((e) => {
        if(e.languageId === 'css') {
            provider.refreshCompletionItems();
        }
    })

    context.subscriptions.push(disposable, saveEventDisposable);
}

// this method is called when your extension is deactivated
export function deactivate() {
}

'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import { languages, ExtensionContext } from 'vscode';
import { CssCompletionItemProvider } from './cssCompletionItemProvider';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: ExtensionContext) {

    let disposable = languages.registerCompletionItemProvider('html', new CssCompletionItemProvider());

    context.subscriptions.push(disposable);
}

// this method is called when your extension is deactivated
export function deactivate() {
}

--- 
+++ 
@@ -1,16 +1,24 @@
 'use strict';
 // The module 'vscode' contains the VS Code extensibility API
 // Import the module and reference it with the alias vscode in your code below
-import { languages, ExtensionContext } from 'vscode';
+import { languages, ExtensionContext, workspace } from 'vscode';
 import { CssCompletionItemProvider } from './cssCompletionItemProvider';
 
 // this method is called when your extension is activated
 // your extension is activated the very first time the command is executed
 export function activate(context: ExtensionContext) {
 
-    let disposable = languages.registerCompletionItemProvider('html', new CssCompletionItemProvider());
+    let provider = new CssCompletionItemProvider();
 
-    context.subscriptions.push(disposable);
+    let disposable = languages.registerCompletionItemProvider('html', provider);
+
+    let saveEventDisposable = workspace.onDidSaveTextDocument((e) => {
+        if(e.languageId === 'css') {
+            provider.refreshCompletionItems();
+        }
+    })
+
+    context.subscriptions.push(disposable, saveEventDisposable);
 }
 
 // this method is called when your extension is deactivated
Refresh css classes on changes.

This change adds an event listener on the save event of the workspace that refreshes the list of css classes when a css file has been changed. Fixes issue #4.
