editorconfig / editorconfig-jetbrains

A JetBrains IDE plugin supporting the EditorConfig standard
MIT License
291 stars 21 forks source link

File cache conflict when using git or anything else changes a file #19

Closed dylang closed 10 years ago

dylang commented 11 years ago

I'm using Webstorm 7 EAP.

When this extension is enabled any change to a file from a plugin (such as git change branch) or an external tool (such as test code that writes a file) causes this dialog to come up for every file changed:

screen shot 2013-08-28 at 11 12 16 am

It's so frequent and annoying we've had to just stop using the extension but we are looking forward to trying again when this is resolved.

bellkev commented 11 years ago

Hi Dylan, thanks for trying the plugin. This is almost certainly due to the plugin's way of enforcing the correct newline characters (LF/CRLF). JetBrains represents everything internally as LF, and only converts to the correct newlines on save, so it's hard to hook into. My workaround involved re-writing files, which is probably causing the conflicts you see. However, the folks at JetBrains pointed me to a new, high-level "changelineseparators" API, which should give me a better way to implement the handling of newlines, and hopefully take care of your issue. I'll try to look into it within a week or so. Using the new API will break the plugin on old JetBrains versions, but you'll be fine if you're using WS7.

dylang commented 11 years ago

Does this mean that if my files are all LF this shouldn't happen?

I'm pretty sure every file we touch is LF and we never do any editing on Windows.

This too: screen shot 2013-09-02 at 5 18 56 pm

bellkev commented 11 years ago

I believe I may be overwriting (effectively "touching" in your case, since the content won't change) all files after save even if the newlines are already correct, so you may still be affected. All these issues should go away, however, when I use the improved method to change line separators.

opensaurusrex commented 11 years ago

I am also seeing this when I am using the Atlassian integration plugin, it keeps telling me that my file is being changed from LF to CRLF.

jednano commented 11 years ago

@deth4uall what does your .gitattributes file look like?

opensaurusrex commented 11 years ago

@jedhunsaker I actually don't have one set at the moment.

williamkapke commented 10 years ago

This is a few months old now- anyone have an update or a workaround?

KOTRET commented 10 years ago

referencing the related IDEA-Issue: http://youtrack.jetbrains.com/issue/IDEA-117137

pmowrer commented 10 years ago

+1 This is a shame, makes the plugin completely unusable.

bellkev commented 10 years ago

This should be fixed in 0.2.0. I'm just waiting until the new version is available in the plugin repo to close these issues.

bellkev commented 10 years ago

Okay, 0.2.0 is now available in the plugin repo. The issue should be fixed, as I am no longer writing to files or doing anything with newlines. See the release notes for more info. Please reopen if the issue persists.

dylang commented 10 years ago

Awesome, thanks @bellkev. The plugin is still waiting for approval, I look forward to using it once it's live to use.

bellkev commented 10 years ago

Aah, whoops, looks like I jumped the gun on saying it was available. You can also follow the manual install steps on the README.md if you want to try it early.

KOTRET commented 10 years ago

thanks, works for me!