execjosh / atom-file-types

Specify additional file types for languages.
https://atom.io/packages/file-types
MIT License
52 stars 15 forks source link

Make option for case sensitivity #27

Closed samjgalbraith closed 9 years ago

samjgalbraith commented 9 years ago

My company uses .PRC or .prc to denote SQL stored procedures, but the casing is not consistent. If I put in PRC: "source.sql"

Then it works for .PRC files but not .prc If I put in PRC: "source.sql" prc: "source.sql"

Then it works for neither .PRC or .prc

samjgalbraith commented 9 years ago

I'll have a look to see if I can put together a pull request but I'm new to CoffeeScript so I'll have a see what I can do when I get home to my own computer.

execjosh commented 9 years ago

Thanks for finding this. I am too busy to sit down and confirm it, though. I wonder why it doesn't work...

At any rate, any contributions are welcome :)

I think we need an extra tool that will consume a path string and read the atom config, then spit out what it is doing at each step so that people can debug more easily...

samjgalbraith commented 9 years ago

I think I had some screwy config issues because I got it to work with the two entries now. Sorry. I would offer a pull request with an extra case sensitivity config parameter but it's not going to be neat given that the file extensions themselves are at the top level of the file-types config and I don't want to propose making a config breaking change, so I'll make do with the case-variant entries in the config for now. Thanks for making this package :+1:

execjosh commented 9 years ago

Okay, yay. I'm glad you got it to work :) I'm going to keep this issue open for now.

You're definitely correct that extensions should be case insensitive for some operating systems. I think the next minor version of this package will add a breaking change to separate "matchers" out into their own namespace. But, hey, it's not at v1.0.0 yet... :wink:

execjosh commented 9 years ago

This depends on #28

dander commented 9 years ago

Just curious, are there any examples where you would want case sensitivity? Multiple different languages using the same extension, except distinguished by case? Sounds horrible to me, but I suppose it's possible.

execjosh commented 9 years ago

I can't think of a use case either... It should be case insensitive by default.

samjgalbraith commented 9 years ago

I wouldn't object too strongly to case insensitive being default, but leaving it in as an option might be nice for those strange people that want it. Windows has issues if you try to deal with differently cased versions of the same extension, but Linux will happily treat case variants as entirely different extensions. Up to you. I wouldn't judge you too harshly if, in the first instance, you just made it case insensitive with no config, since it's a bit of a strange thing to do, but it is possible.

execjosh commented 9 years ago

I went with adding an option with default case insensitive :thumbsup: