Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV auto-detection does not work when "A File Icon" package is enabled #25

Closed
jeremyfourna opened this issue May 19, 2020 · 5 comments
Closed

Comments

@jeremyfourna
Copy link

Hello,

I have CSV file like this

aaaa,bbbb,cccc
super,1234,mega
pokemon,456,awesome

But when I open the CSV in sublime text, there is not an auto highlight, which value should I put inside rainbow_csv_autodetect_dialects to have it highlighted?

@mechatroner
Copy link
Owner

Hello,

This could happen because your file doesn't have ".csv" extension AND is very small ( < 5 lines ) - I decided to add this threshold to avoid false-positive auto-detection. I will try to make this value adjustable in the next version so you can set it to 3 lines.

Also it could be that the number of fields in the file is not consistent and extension is not ".csv", in this case autodetection will also fail: you can manually enable highlighting, and then run CSVLint to check if there is anything wrong with the file.

@jeremyfourna
Copy link
Author

I recorded my sublime text 3 with the CSV example above, those files are CSV files and they have more than 5 lines.

https://drive.google.com/open?id=1cMCb33xryoLgoPdB_L8wecmMfCjVesoS

@mechatroner
Copy link
Owner

Thank you very much for providing the recording! I've noticed that the filetype in the bottom lower corner is "Plain Text (CSV)" and not "Rainbow CSV". I searched github for name: Plain Text (CSV) and found "A File Icon" plugin. I had no idea that it declares it's own "Plain Text (CSV)" filetype. I will try to adjust Rainbow CSV code to correctly work together with "A File Icon" plugin, at the first glance it shouldn't be hard. Or maybe I will contact "A File Icon" authors.

I am afraid that until this filetype conflict is resolved there is no way to use Rainbow ".csv" auto-detection feature together with "A File Icon" plugin. Ironically auto-detection would have worked if your files had some other non '.csv' extension e.g. '.txt' because in that case "A File Icon" would not assign it's own "Plain Text (CSV)"

@mechatroner mechatroner changed the title rainbow_csv_autodetect_dialects when the column have no quotes CSV auto-detection does not work when "A File Icon" package is enabled May 21, 2020
@jeremyfourna
Copy link
Author

Ok thank you for the investigation. I will wait for the fix because I really like your package!

mechatroner pushed a commit that referenced this issue Jul 18, 2020
…Icon" package as plain text for autodetection purposes
@mechatroner
Copy link
Owner

@jeremyfourna I fixed interop with "A File Icon" in version 2.2.0.
If you find any other problems - please let me know!

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

No branches or pull requests

2 participants