Adopt new css provider interface

This commit is contained in:
Pine Wu
2019-01-27 19:03:09 -08:00
parent 74e267efdd
commit aad260bc7d
6 changed files with 63 additions and 45 deletions

View File

@@ -1,23 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { CSSData } from 'vscode-css-languageservice';
export function parseCSSData(source: string): CSSData {
let rawData: any;
try {
rawData = JSON.parse(source);
} catch (err) {
return {};
}
return {
properties: rawData.properties || [],
atDirectives: rawData.atdirectives || [],
pseudoClasses: rawData.pseudoclasses || [],
pseudoElements: rawData.pseudoelements || []
};
}