windicss / windicss-intellisense

Intelligent WindiCSS tooling for VS Code
https://marketplace.visualstudio.com/items?itemName=voorjaar.windicss-intellisense
MIT License
194 stars 16 forks source link

Windicss intellisense doesn't allow custom patterns #495

Closed numfin closed 1 year ago

numfin commented 1 year ago

From source code:

    Object.entries(config).map(([key, value]) => {
      if (typeof value === 'string') {
        fileTypes[key] = { type: value in patterns ? value : 'css' };
      } else {
        const pattern = (value.patterns === undefined || value.patterns.length === 0) ? undefined : value.patterns;
        if (key in fileTypes) {
          fileTypes[key] = { type: value.type || fileTypes[key].type, pattern: fileTypes[key].pattern ? pattern ? connect([(fileTypes[key].pattern as RegExp).source, ...pattern]) : fileTypes[key].pattern : pattern ? connect([...pattern]) : undefined };
        } else if (value.type && value.type in fileTypes) {
          fileTypes[key] = {
            type: value.type || fileTypes[value.type].type,
            pattern: fileTypes[value.type].pattern ? pattern ? connect([(fileTypes[value.type].pattern as RegExp).source, ...pattern]) : fileTypes[value.type].pattern : pattern ? connect([...pattern]) : undefined };
        }
      }
    });

Here basically 3 conditions:

Why i cannot just use my own pattern without predefined one (omit type field)?