Autodetection of separators not working?
Maybe I am misunderstanding the feature, but Autodetection of separators needs some manual work to enable it.
(Otherwise, me and my colleagues enjoy your extension very much, thank you!!! Can I buy you a coffee?)
Expected
- I open the user settings and put in the separators, like so:
- I open
my_file.csvcontaining that separator - I see colors.
Observed
I do not see colors, like so:
Workaround
The issue seems to be the file association autodetection. Once I click on the file type association in VSC's bottom right corner, coloring works. Note the changed file type association.
Steps taken so far
Rainbow worked only for semicolon out of the box. I currently do not have specific file type associations in either user or workspace setting. I did try that at one point and it worked at described, but did seem to solve the autodetection issue.
For the comma separator, I had to explicitely select csv (no further associations). Before this, no coloring would be done.
Sys info
Rainbow
Name: Rainbow CSV Id: mechatroner.rainbow-csv Description: Highlight CSV and TSV files, Run SQL-like queries Version: 3.9.0 Publisher: mechatroner VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv
VSC
Version: 1.84.2 (user setup) Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e Date: 2023-11-09T10:51:52.184Z Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045
Hello,
thank you for reporting this!
You are right, the extension should automatically switch to TSV filetype.
Yesterday I published a new version of Rainbow CSV (3.9.0) with some changes related to autodetection logic so this could be a reason why it stopped working.
Still, I wasn't able to reproduce this on my laptop (the filetype correctly changes to TSV whey I open you file), so can I ask you to try to temporarily revert to version 3.8.0 (I attached a screenshot on how to do it just in case) and see if the previous version works correctly?
Also could you please share what other extensions you have installed, and maybe try to see if this reproduces if you temporarily disable other extensions? There was another issue reported recently where the root cause was apparently a conflict with another extension (although I am still not sure which one it was).
Thanks for the quick reply. I have not found a solution but maybe I got one step futher.
- Tried it with the previous version, did not help.
- I looked at other extensions. I disabled/uninstalled the other CSV extension I have, Edit csv. Did not help either.
- I tried it on another computer (MacOS, very few extensions installed). I did not have any issue whatsoever, so it is specific to my setup.
I noticed one difference between the working VSC version and the not working version. In the working version, the language is shown as Dynamic CSV. When clicking on it, I can directly configure the separator. In the non-working version, I don't think I have ever seen Dynamic CSV. It only shows CSV or the specific configured subtype, such as CSV (whitespace).
Unforunately I have no idea about potential reasons for that. If you can give me any hint I'll investigate further.
Anyway, these are my installed and active extensions:
- bpruitt-goddard.mermaid-markdown-syntax-highlighting
- coolbear.systemd-unit-file
- GitHub.copilot
- GitHub.copilot-chat
- google.reflowlist
- Gruntfuggly.todo-tree
- Gruntfuggly.triggertaskonsave
- janisdd.vscode-edit-csv
- KevinRose.vsc-python-indent
- marvhen.reflow-markdown
- mechatroner.rainbow-csv
- mhutchie.git-graph
- ms-azuretools.vscode-docker
- ms-python.black-formatter
- ms-python.isort
- ms-python.pylint
- ms-python.python
- ms-python.vscode-pylance
- ms-toolsai.jupyter
- ms-toolsai.jupyter-keymap
- ms-toolsai.jupyter-renderers
- ms-toolsai.vscode-jupyter-cell-tags
- ms-toolsai.vscode-jupyter-slideshow
- ms-vscode-remote.remote-wsl
- qwtel.sqlite-viewer
- redhat.vscode-yaml
- richie5um2.vscode-sort-json
- tamasfe.even-better-toml
- tomoyukim.vscode-mermaid-editor
- YuTengjing.open-in-external-app
Thank you very much, this is very useful for me to know, especially the fact that the previous version had the same issue means that I don't have to roll back the last update just yet.
But also things got even more confusing, especially Dynamic CSV filetype - it shouldn't be enabled at all unless you enable it manually or the file has multiline-fields, so something might be wrong with the extension itself.
I am now working on adding a debugging logging option to the extension - something I should have done a long time ago, so once it is ready and published (by the end of this week I hope) I would really appreciate it if you could repeat the steps again with the logging on.
Also, I just learned that VSCode has the option to use different user profiles and even temporary profiles (a profile is a set of extensions + settings as I understand it) So in the meantime, if you have a few minutes to spare, could please try to do the following (I should have suggested it from the start but as I mentioned I just learned that this option exists):
- run
Profiles: Create a temporary profilecommand - this should create a new temporary profile (or even better create a named profile e.g.rainbow_csv_test_1usingProfiles: Create Profilecommand that is persistent across vscode restarts, but then you would have to switch back to your main/default profile usingProfiles: Swith profilecommand) - Install Rainbow CSV
- Repeat your original steps by opening the file and see if the problem still reproduces (please let me know!)
- If the problem doesn't reproduce you can then optionally try to bisect the configuration that breaks it by installing additional extensions and/or copying settings from the main profile - you can copy the settings by running
Preferences: Open User Settings (JSON)command - it opens a json files which you can use to copy and paste settings between the profiles.
Great, so the file type association seems to be the right direction. I'll try what you suggested as soon as I find the time, probably towards the end of the week.
I tried all your suggestions: created a named new profile and tried to reproduce the issue.
- Good news: Everything works fine now.
- Bad news: I could not reproduce the issue with the new named profile.
- Puzzling: The issue does not exist anymore in the default profile.
Perhaps interesting: When adding separators I had not used before, the file type says Dynamic CSV everytime now. When deleting and re-adding separators I had used before, the file type label shows the specific type, such as CSV (whitespace).
Thanks for the update! I added a debug logging option in version 3.10.0 I also found and fixed a bug causing "Dynamic csv" highlighting to fail altogether with many custom color themes. If you were using a custom color theme this could have caused the problem.
Thanks for the fix and the debug logging option. I have used a one of the dark default themes but made some changes in the settings, so that's perhaps really the root cause.