File tree Expand file tree Collapse file tree 8 files changed +64
-72
lines changed Expand file tree Collapse file tree 8 files changed +64
-72
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ The following list of source file extensions does not need any customization.
16
16
- Statically parses [ template literals] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals ) . No customization needed
17
17
18
18
> ` cssvar ` has minimal support for parsing JS/TS files.
19
- > __ * If you are facing issues with JS/TS source file parsing try* __
19
+ > __ * This won't be required, but in case you face issues with* __
20
+ > __ * JS/TS source file parsing try* __
20
21
> __ * using [ postcss-css-in-js] [ css-in-js ] parser,* __
21
22
> __ * as described in the [ following section] ( #example-ii ) * __ .
22
23
Original file line number Diff line number Diff line change 8
8
},
9
9
"keywords" : [],
10
10
"author" : " " ,
11
- "license" : " ISC" ,
12
- "dependencies" : {
13
- "postcss" : " 8" ,
14
- "postcss-scss" : " ^4.0.4"
15
- }
11
+ "license" : " ISC"
16
12
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 223
223
"postcss-sass" : {
224
224
"type" : " array" ,
225
225
"description" : " Sass (.sass) source file extensions to parse" ,
226
- "default" : [" sass" ],
227
- "examples" : [[" sass" ]]
226
+ "default" : [
227
+ " sass"
228
+ ],
229
+ "examples" : [
230
+ [
231
+ " sass"
232
+ ]
233
+ ]
228
234
},
229
235
"postcss-html" : {
230
236
"type" : " array" ,
231
237
"description" : " HTML (.html) source file extensions to parse" ,
232
- "default" : [" html" ],
233
- "examples" : [[" html" , " ejs" ]]
238
+ "default" : [
239
+ " html"
240
+ ],
241
+ "examples" : [
242
+ [
243
+ " html" ,
244
+ " ejs"
245
+ ]
246
+ ]
234
247
},
235
248
"sugarss" : {
236
249
"type" : " array" ,
237
250
"description" : " SugarSS (.sss) source file extensions to parse" ,
238
- "default" : [" sss" ],
239
- "examples" : [[" sss" ]]
251
+ "default" : [
252
+ " sss"
253
+ ],
254
+ "examples" : [
255
+ [
256
+ " sss"
257
+ ]
258
+ ]
240
259
},
241
260
"postcss-styl" : {
242
261
"type" : " array" ,
243
262
"description" : " Stylus (.styl) source file extensions to parse. Repo: https://github.com/stylus/postcss-styl" ,
244
- "default" : [" styl" ],
245
- "examples" : [[" styl" ]]
263
+ "default" : [
264
+ " styl"
265
+ ],
266
+ "examples" : [
267
+ [
268
+ " styl"
269
+ ]
270
+ ]
271
+ },
272
+ "postcss-syntax" : {
273
+ "type" : " array" ,
274
+ "description" : " To parse template literals in JS/TS source files. Details: https://github.com/willofindie/vscode-cssvar/tree/main/docs/customize-extension.md" ,
275
+ "default" : [],
276
+ "examples" : [
277
+ [
278
+ " js" ,
279
+ " ts" ,
280
+ " sass"
281
+ ]
282
+ ]
246
283
},
247
284
"postcss-lit" : {
248
285
"type" : " array" ,
249
286
"description" : " To parse Lit templates in JS/TS source files. Repo: https://github.com/43081j/postcss-lit" ,
250
- "default" : [" ts" ],
251
- "examples" : [[" js" , " ts" ]]
287
+ "default" : [
288
+ " ts"
289
+ ],
290
+ "examples" : [
291
+ [
292
+ " js" ,
293
+ " ts"
294
+ ]
295
+ ]
252
296
}
253
297
},
254
298
"additionalProperties" : true ,
307
351
"culori" : " ^2.0.3" ,
308
352
"fast-glob" : " ^3.2.11" ,
309
353
"postcss" : " ^8.4.12" ,
310
- "postcss-less" : " ^6.0.0" ,
311
- "postcss-scss" : " ^4.0.4"
354
+ "postcss-less" : " ^6.0.0"
312
355
},
313
356
"lint-staged" : {
314
357
"*.{ts,tsx}" : [
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { CssDefinitionProvider } from "./definition-provider";
14
14
import { LOGGER } from "./logger" ;
15
15
import { setup } from "./main" ;
16
16
import { parseFiles } from "./parser" ;
17
+ import { isObjectProperty } from "./utils" ;
17
18
18
19
const watchers : FileSystemWatcher [ ] = [ ] ;
19
20
@@ -117,7 +118,7 @@ export function deactivate(): void {
117
118
*/
118
119
function updateStatus ( event : TextEditor | undefined ) {
119
120
if ( event ) {
120
- if ( Object . prototype . hasOwnProperty . call ( event , "document" ) ) {
121
+ if ( isObjectProperty ( event , "document" ) ) {
121
122
const rootPath =
122
123
workspace . getWorkspaceFolder ( ( < TextEditor > event ) . document . uri ) ?. uri
123
124
. fsPath || CACHE . activeRootPath ;
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export async function setup(): Promise<{
94
94
if ( syntaxes ) {
95
95
config [ fsPathKey ] [ key ] = Object . keys ( syntaxes ) . reduce (
96
96
( syntaxMap , key ) => {
97
- if ( Object . prototype . hasOwnProperty . call ( syntaxes , key ) ) {
97
+ if ( isObjectProperty ( syntaxes , key ) ) {
98
98
const exts = syntaxes [ key ] ;
99
99
exts . forEach ( ext => {
100
100
syntaxMap [ ext ] = key ;
Original file line number Diff line number Diff line change @@ -297,9 +297,9 @@ export const getCSSErrorMsg = (
297
297
error : Record < string , any >
298
298
) => {
299
299
if (
300
- Object . prototype . hasOwnProperty . call ( error , "name" ) &&
301
- Object . prototype . hasOwnProperty . call ( error , "reason" ) &&
302
- Object . prototype . hasOwnProperty . call ( error , "line" )
300
+ isObjectProperty ( error , "name" ) &&
301
+ isObjectProperty ( error , "reason" ) &&
302
+ isObjectProperty ( error , "line" )
303
303
) {
304
304
return JSON . stringify (
305
305
{
Original file line number Diff line number Diff line change @@ -4461,11 +4461,6 @@ postcss-less@^6.0.0:
4461
4461
resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-6.0.0.tgz#463b34c60f53b648c237f569aeb2e09149d85af4"
4462
4462
integrity sha512-FPX16mQLyEjLzEuuJtxA8X3ejDLNGGEG503d2YGZR5Ask1SpDN8KmZUMpzCvyalWRywAn1n1VOA5dcqfCLo5rg==
4463
4463
4464
- postcss-scss@^4.0.4 :
4465
- version "4.0.4"
4466
- resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.4.tgz#aa8f60e19ee18259bc193db9e4b96edfce3f3b1f"
4467
- integrity sha512-aBBbVyzA8b3hUL0MGrpydxxXKXFZc5Eqva0Q3V9qsBOLEMsjb6w49WfpsoWzpEgcqJGW4t7Rio8WXVU9Gd8vWg==
4468
-
4469
4464
postcss@^8.1.2, postcss@^8.4.12, postcss@^8.4.4 :
4470
4465
version "8.4.14"
4471
4466
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf"
You can’t perform that action at this time.
0 commit comments