Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"files.exclude" does not match double-extension files with "when": "$(basename).ext" #3760

Closed
nickspoons opened this issue Mar 7, 2016 · 2 comments
Assignees

Comments

@nickspoons
Copy link

It is not possible to match files with a double-extension using "$(basename).ext", i.e. ".js.map" or ".min.css".
You can currently workaround matching ".js.map" files by excluding the extention in the "when":

{
   "files.exclude": {
      "**/*.js": { "when": "$(basename).ts"},
      "**/*.js.map": { "when": "$(basename).ts"},   // Does nothing
      "**/*.js.map": { "when": "$(basename)"},      // Works
      "**/*.css": { "when": "$(basename).scss"},
      "**/*.min.css": { "when": "$(basename).scss"} // Does nothing
   }
}

Ideally I would like to use "when": "$(basename).ext" to exclude ".js" and ".js.map" transpiled Typescript files, and ".css" and ".min.css" transpiled and minified Sass or Less files:

{
   "files.exclude": {
      "**/*.js": { "when": "$(basename).ts"},
      "**/*.js.map": { "when": "$(basename).ts"},
      "**/*.css": { "when": "$(basename).scss"},
      "**/*.min.css": { "when": "$(basename).scss"}
   }
}

This issue could possibly be resolved by allowing regex expressions, as described in #1214

@isidorn isidorn added the feature-request Request for new features or functionality label Mar 7, 2016
@bpasero bpasero added this to the Backlog milestone Mar 7, 2016
@bpasero bpasero added file-explorer Explorer widget issues bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Mar 7, 2016
@bpasero
Copy link
Member

bpasero commented Mar 7, 2016

@nickspoons I am not sure how this would work even if #1214 gets implemented. You have a file something.min.css so the $(basename) will resolve to something.min. What you actually want to use is a $(filename) that would resolve to something so that you can type something. scss, e.g.:

{
   "files.exclude": {
      "**/*.min.css": { "when": "$(filename).scss"}
   }
}

Would you agree?

@bpasero bpasero removed the file-explorer Explorer widget issues label Mar 14, 2016
@bpasero
Copy link
Member

bpasero commented Mar 24, 2016

marking as duplicate of #4642

@bpasero bpasero closed this as completed Mar 24, 2016
@bpasero bpasero removed this from the Backlog milestone Mar 24, 2016
@bpasero bpasero removed the bug Issue identified by VS Code Team member as probable bug label Mar 29, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants