Fix CSS imports

This commit is contained in:
Pine Wu 2019-01-28 13:55:55 -08:00
parent 2c1040da1f
commit 4c89a268f5
2 changed files with 8 additions and 7 deletions

View file

@ -23,8 +23,7 @@
"outFiles": [
"${workspaceFolder}/client/out/**/*.js"
],
"smartStep": true,
"preLaunchTask": "npm: compile"
"smartStep": true
},
{
"name": "Launch Tests",
@ -39,8 +38,7 @@
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/client/out/test/**/*.js"
],
"preLaunchTask": "npm: compile"
]
},
{
"name": "Attach Language Server",

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { CSSData, ICSSDataProvider } from 'vscode-css-languageservice';
import { CSSDataV1, ICSSDataProvider } from 'vscode-css-languageservice';
import * as fs from 'fs';
export function getDataProviders(dataPaths: string[]): ICSSDataProvider[] {
@ -29,16 +29,19 @@ export function getDataProviders(dataPaths: string[]): ICSSDataProvider[] {
return providers;
}
function parseCSSData(source: string): CSSData {
function parseCSSData(source: string): CSSDataV1 {
let rawData: any;
try {
rawData = JSON.parse(source);
} catch (err) {
return {};
return {
version: 1
};
}
return {
version: 1,
properties: rawData.properties || [],
atDirectives: rawData.atdirectives || [],
pseudoClasses: rawData.pseudoclasses || [],