vscode-data-preview
vscode-data-preview copied to clipboard
Customise the mappings between filetypes and data format to activate the preview
Hi. Not sure if this is already possible, but I haven't figured out from README yet.
My problem is, for some projects, the data is well formatted but the file is not ended with standard ext such as CSV, JSON, etc. For example, I have many data files in CSV format but they are named by "xxx.log".
It would be great to be able to customise workspace settings to map the files to a visualisation format: something like
{
"data.preview.mappings" : {
"data/*.log" : "CSV",
"data/*.raw" : "JSON"
}
}
I will look into this in fall for the next data preview update.
Might go with your mappings ext. setting solution or other implementation, but in essence the final fix will provide the option to map and load raw log files, etc. since I ran into it myself too.
Thanks for your feedback and suggestion!
@RandomFractals It would be great if it could pick it up from the language of the file. I have a similar issue where I copy paste data into Untitled unsaved documents and when you open preview it seems to assume JSON and reports errors and shows nothing, even though the unsaved document did have a language set to the correct type (e.g. CSV)
@driskell that's a great suggestion. I have not addressed Untitled data docs at all. VSCode does have good api to get language id from the active editor. I think I can use that to map it to the file types and file name extensions.
I'll just need to find the time to add these enhancements. Will keep it open till I get to it.