mechatroner / vscode_rainbow_csv

🌈Rainbow CSV - VS Code extension: Highlight CSV and TSV files in different rainbow colors to make them more readable
MIT License
428 stars 52 forks source link

Erroneously reports quoting error. #18

Closed gregiare closed 4 years ago

gregiare commented 6 years ago

In a csv file like the following;

Name,Number,Description John Doe,="00000000000023456",Whatever

It says it has a quoting error and when hovering over the third column it reports it as the second column. It can't hand a preceding equals sign outside of the quotes. This is a common practice to prevent Excel from removing leading zeros.

mechatroner commented 6 years ago

Thanks for bug report, I've never heard about this practice before, it is interesting to learn something new :) One way to fix this is to alter tooltip logic: instead of showing an error on incorrect quoting it should fall back to simple double-quote agnostic csv dialect for the current field, like the syntax highlighting does. For more pedantic check there is still CSVLint which will catch and report the incorrectly quoted line.

mechatroner commented 6 years ago

I've altered the error handling logic in version 0.6.0: Instead of immediately failing on quoting error, the parser would try to recover from it using the same algorithm as the syntax highlighting. So now Rainbow CSV will correctly report header for the third column, but would still generate the parsing warning.