Comments (3)
Hello @mechatroner, I've started looking into this issue and have two questions.
1 - As you've mentioned, we can enable arbitrary separators by removing this check:
Line 464 in e2fa752
However, from what I could tell, the policy will usually be defaulted to simple
by the following lines:
Lines 459 to 463 in e2fa752
So unless the user takes explicit action to enable the
quoted
policy together with their non-standard separator (either by using the enable_quoted
sublime-command, or through the configuration), the feature will still not appear to work as expected.
Does this analysis seem correct to you? If yes, can we consider removing this check as well (and therefore always defaulting auto
to quoted
), to change the behaviour to be more intuitive for users?
2 - I've seen that this same check on the standard separators [';', ',']
also appears here (and as a side note, also in several locations in the RBQL dependency, but I have not delved into that):
Lines 61 to 62 in e2fa752
I'm not so familiar with python and couldn't easily determine the impact of leaving this check here while removing it from other locations. Would you be able to indicate whether this part of the code must be aligned as well in order to more cleanly resolve this issue?
Thanks!
from sublime_rainbow_csv.
Your analysis is correct! I think that is the only place where changes should be made.
can we consider removing this check as well (and therefore always defaulting auto to quoted), to change the behaviour to be more intuitive for users?
I am not sure if this would be more intuitive, for example, tab-separated dialects are doublequote-agnostic in 100% of cases and I always thought that pipe-separated files also mostly use "simple" dialect (e.g. use case here: mechatroner/vscode_rainbow_csv#1 (comment) ). I admit that I don't have any statistics about pipe-separated file usage in different domains but I would prefer not to change the default behavior without strong supportive evidence. My impression was that choosing |
as a separator allows to avoid double quotes because unlike ,
and ;
characters it is much less likely to see it in the actual text, so quoting is not needed, and the advantage over tab is at it won't get lost/replaced with spaces during copy/paste operations.
We can add another setting though - like a list of separators that should use "quoted" dialect by default, or even a boolean setting like "quote all separators by default" as you suggest and handle it the main.py.
from sublime_rainbow_csv.
Hi @mechatroner, sorry for the late response.
I think that is the only place where changes should be made.
Thanks for confirming this π
choosing | as a separator allows to avoid double quotes because [β¦] it is much less likely to see it in the actual text, so quoting is not needed
My use case was actually not about escaping |
in the text, but rather enabling the handling of line breaks in the text. So I would have needed quoted fields regardless of what separator was in use.
I would prefer not to change the default behavior without strong supportive evidence
But if nobody else has complained, then you're right, there's no need to modify the behaviour for an edge case such as mine. I don't think there's a real need to add any new configuration options, since the existing commands (after this fix) can be used to make this work. Maybe all that's needed is to make sure that the documentation helps users to achieve this if they need?
With this I'm all set to work on getting you a pull request, then :) Thanks for your feedback so far!
from sublime_rainbow_csv.
Related Issues (20)
- RBQL: Support monocolumn policy HOT 6
- Does this plugin support multiline column? HOT 5
- Plugin breaks when line is > 16383 characters long HOT 1
- Issue with importing uuid class? HOT 3
- A way to save query HOT 1
- Cannot run query on temporary buffer (i.e. unsaved file) HOT 2
- CSV auto-detection does not work when "A File Icon" package is enabled HOT 5
- The settings file "res://Packages/rainbow_csv/RainbowCSV.sublime-settings" could not be opened HOT 5
- Package disappeared after update HOT 20
- Align columns with spaces adds trailing spaces HOT 2
- Add slice support to the python backend
- The order of colors and a bug with a comma HOT 5
- Improve support for East Asian languages ββwhen using the βalignβ function
- Keybinding HOT 2
- Make generated syntaxes a sub-flavor of `text.csv` HOT 1
- Option to start columns at 0 HOT 5
- referencing by column name not working..? HOT 4
- use_custom_rainbow_colors has no effect
- Custom colors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublime_rainbow_csv.