APM/EditorConfig case-sensitivity


#1

Hello,

I would like to point that APM seems (need confirmation) to install and name packages preserving case.
However, on my local copy, it is installed with lower-case name, but still loads correctly.
That causes a problem when I need to retrieve config keys, because they are stored with a case-sensitive scope.

Thus, I need the following code, which doesn’t feel neat.

# Test package name, apm is case-sensitive sometimes >> TODO create issue on github
if atom.packages.getLoadedPackage('termrk')?
    name = 'termrk'
else
    name = 'Termrk'

# ... atom.config.get "#{name}.key"

#2

Are you on Windows or Mac? As far as I remember both os’es file systems are case-preserving but not sensitive.


#3

I’m confused. Why does how the package is stored in the file system have anything to do with config keys?


#4

Config keys are probably assigned based on the package’s directory name, so I thought APM’s behavior might have been influenced by the underlying OS’s implementation of casing…


#5

Config keys are chosen completely by the package author. One could name their package “foo” but use the config keys bar.baz and bar.quux if they wanted.

By convention, the namespace for config keys is the same as the package name and typically lowercased. But there is no requirement or enforcement of that.


#6

Ah, I think I see what’s going on. Because the name of the package in package.json is “Termrk”, sometimes it is installed with that casing and other times as lowercase. And because the defaults are stored in the config schema, this affects the package name … which is what determines the config key namespace for that package.

Though I just tried installing the package from the command line using Atom v1.0.3-1b6cab0 on Mac OS X 10.10.4 and it installed as “Termrk”. So I’m not sure under what circumstances it would be installed with a lower-case name.