intellij-emberjs icon indicating copy to clipboard operation
intellij-emberjs copied to clipboard

Folding of Ember18n key doesn't work if the translations object isn't exported at declaration

Open cristi-badila opened this issue 7 years ago • 0 comments
trafficstars

Given that I have a translations file with the following content:

// project-root/app/locales/en/translations.js
const Translations = {
    'some-key': 'some-value'
}

export default Translations;

and the following hbs template:

// project-root/app/templates/components/my-comp.hbs
<span>{{t 'some-key'}}</span>

when I collapse {{t 'some-key'}} I expect to see some-value

Currently this is not happening. However, if I drop the usage of the Translations const as bellow,

// project-root/app/locales/en/translations.js
export default {
    'some-key': 'some-value'
}

everything works as expected.

I'm using version 2018.1.2 of both intellij-emberjs and WebStorm. I noticed this bug after I turned on the no-anonymous-default-export eslint rule and subsequently running a code-mod on my codebase which "named" all my anonymous default exports.

Just as a mention, if this isn't a too big of an issue (and as such not time-critical), I'd like to take a stab at fixing it myself; however this might take some time until I get setup and try to understand how to fix it.

cristi-badila avatar May 09 '18 07:05 cristi-badila