Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Map filename to language in case of dotfiles #11560

Closed
wants to merge 1 commit into from

Conversation

sprintr
Copy link
Contributor

@sprintr sprintr commented Aug 7, 2015

LanguageManager.getCompoundFileExtension returns an empty string for dotfiles and extension-less files because of which the Language menu shows Set as Default for . Files. Clicking which adds an empty string as an extension in "language.fileExtensions".

This PR will add dotfiles and extension-less files to "language.fileNames" instead of "language.fileExtensions". The dot in extension is added dynamically now, will update it in rest of the locales once this gets reviewed.

@abose
Copy link
Contributor

abose commented Nov 2, 2015

All unit integration and extension tests are passing.
Can you make the changes to all other locales?
What would be the behavior if the file does not have any exetsnion?

@sprintr
Copy link
Contributor Author

sprintr commented Nov 2, 2015

For a file named foobar it should show Set as default for foobar files. Will add the following lines to preferences

"language.fileNames": {
     "foobar": "c"
}

Update: Made changes to all the locales available.

@abose
Copy link
Contributor

abose commented Nov 3, 2015

I meant what would happen for files without extensions? like just the filename foobar

@sprintr
Copy link
Contributor Author

sprintr commented Nov 3, 2015

@abose I am not sure if I understand your concern here. Files named foobar will also get the syntax highlighting of the language they are mapped to. You might wanna checkout out this branch to check it.

@abose
Copy link
Contributor

abose commented Nov 4, 2015

got it! misunderstood the PR before.
Could you modify the locale strings?

@sprintr
Copy link
Contributor Author

sprintr commented Nov 4, 2015

@abose No worries. The strings have been modified.

@abose
Copy link
Contributor

abose commented Nov 4, 2015

could you add a unit test for this?

@efmeeks
Copy link

efmeeks commented Jan 14, 2016

@sprintr With this I'm able to specify a default language for a specific file, but not able to specify a default language for dotfiles or extensionless files. Also I'm new to Brackets and GitHub, so I apologize in advance for lacking knowledge.

I want 'bash' to be the default language for .bash_profile and similar files.

@sprintr
Copy link
Contributor Author

sprintr commented Jan 14, 2016

@meeksdoteric for your particular case #11558 should be fine, this one applies to all the extension-less files and dotfiles.

@efmeeks
Copy link

efmeeks commented Jan 14, 2016

Thanks!
On Thu, Jan 14, 2016 at 3:23 PM Amin Ullah Khan notifications@github.com
wrote:

@meeksdoteric https://github.com/meeksdoteric for your particular case
#11558 #11558 should be fine,
this one applies to all the extension-less files and dotfiles.


Reply to this email directly or view it on GitHub
#11560 (comment).

E

@zaggino
Copy link
Contributor

zaggino commented Aug 27, 2016

This requires some unit tests, I still don't understand what it should do :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants