Vscode: Allow to set a file association for files with no extension

Created on 5 Sep 2018  路  9Comments  路  Source: microsoft/vscode

{
    "files.associations": {
        "*": "mydefaulttype"
    }
}

This changes the file association for absolutely all files. Should be possible to set a file association only for files that have no extension. So it would match somefilename but not somefilename.txt and not even .somefilename.

feature-request languages-guessing

Most helpful comment

Yes, that works fine on the files named exactly somefilename. But can't figure out any way to set a default file type for files with no extension to work.

All 9 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@rightaway does it not work when you set:

{
    "files.associations": {
        "somefilename": "mydefaulttype"
    }
}

Yes, that works fine on the files named exactly somefilename. But can't figure out any way to set a default file type for files with no extension to work.

still open?

Is it not possible to have a special syntax instead of that "*" which actually matches every extensions?

/[^.]+/ maybe allow regular expressions?

Or how about reading the header, shell scripts often don't have an extension but they do have a header e.g. #!/bin/sh or #!/usr/bin/env bash

According to VSCode Programming Languages Documentation the glob pattern should be supported, right?

But I wonder why these don't work:

"files.associations": {
  "**/!(*.*)": "markdown",
  "**/+([^.])": "markdown"
}

You can test them on Digital Ocean | Glob Tool


This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!


:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omidgolparvar picture omidgolparvar  路  3Comments

biij5698 picture biij5698  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

vsccarl picture vsccarl  路  3Comments

ryan-wong picture ryan-wong  路  3Comments