-
Notifications
You must be signed in to change notification settings - Fork 55
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
Ignoring comment lines #14
Comments
Hello, @Kazzz-S ! I think "comment_line_regexp" option is a a reasonable solution to this problem. We don't even need "ignore_comment_line" variable because the presence of "comment_line_regexp" already indicates that user wants to ignore comment lines. I was thinking about a different way to do this, which has some pros and cons:
so if this option is set to true, the parser would just skip all lines at the beginning which don't have the same number of fields as the majority of lines in the file. Anyway a PR that implements either yours or mine approach would be very welcome. |
BTW, why "SetVirtualHeader" is not suitable for you? |
Hello @mechatroner
Thank you for your suggestion. I agree with you :-)
"SetVirtualHeader" works fine to see info about a column on mouse hover. However, in my use case, I need nicely colored images of CSV files for writing operation manuals of different tools (software and hardware). With best regards, |
Oh, I see. I thought that the main reason is that it is annoying to use "SetVirtualHeader" for each new file. So, I think it could be possible to "undo" syntax highlighting for pre-header lines using |
Please make this option available not only for pre-header lines. |
Workaround: using Highlight extension with setting {
"highlight.regexes": {
"(^#.*)": {
"decorations": [
{
"color": "#546e7a" // Your comment color
}
],
"filterLanguageRegex": "csv"
}
}
} |
It's not just the question of highlighting. |
Comment lines support is now available with version 1.1.1 thanks to @larsonmars ! There is still no special coloring of comment lines though, so the issue will remain open. |
…s": decoration techonology is not suitable for large CSV files This reverts commit f6de7fd.
Not sure if this is a good place for this - but I cannot get the Rainbow_csv:Comment_prefix to work. I love the idea of a regex I mostly just need to skip comments in the header - but currently - setting Comment_prefix to '#' doesn't quite do enough:
I'm running VSCode if that matters? If there's a better place for support - please point me to it!!! Love the extension overall!!! |
@lucky-wolf You can check if it is working or not by hovering your cursor over the comment line: instead of the column info it will show "Comment" or something like this. Setting Comment_prefix also allows Rainbow CSV to efficiently run separator autodetection, affects Align/Shrink and Multi-cursor edit logic. I am also planning to add support of Comment prefix to RBQL. Unfortunately it is not possible to change color of lines with the comment prefix to the comment color because of some VSCode limitations ( I know about the "decorations" feature but it didn't work well in my tests ). I hope this will change in the future and comment lines would be correctly highlighted. |
that's a bummer that VSCode makes it hard/impossible to do that! Yeah, I originally thought it wasn't detecting a comment at all - but later realized that it was mis-coloring it - and the error I was seeing in the tooltip - which mentioned "header" and "wrong number of columns" actually was referring to the blank line in between the comment and the real header line.
Basically, it was that blank that was generating an error and the fact that the coloring was as-if it were a regular line confused me into thinking it was upset and not detecting the # properly. Thanks for the response - I hope my explanation aids you going forward - and handling blanks & comments throughout this extension would / will be a huge boon! Thank you for the extension! It's a great tool! |
Can you not change the comment colour using semantic highlighting? |
@Timmmm, I can! And I actually already implemented this in the "rfc" branch along with many other changes. I am planning to publish a new version in about 2 weeks. |
I just published a new release 3.0.0 which should highlight the comments with the "comment" syntax. |
Works like a charm, thanks! |
Hello,
Thank you for providing a useful extension, which improves my productivity.
This is related to #13.
In Python world, I'm regularly working with CSV-like files containing multiple comment (header) lines as below.
It will be nice if I can ignore (and see in one color) those comment lines with additional options like:
Thank you and best regards,
Kazzz
The text was updated successfully, but these errors were encountered: