silx-kit / vscode-h5web

VSCode extension to explore and visualize HDF5 files
https://marketplace.visualstudio.com/items?itemName=h5web.vscode-h5web
MIT License
33 stars 5 forks source link

Support loading .nc4 extensioned netCDF-4 files #10

Closed mathomp4 closed 2 years ago

mathomp4 commented 2 years ago

Is your feature request related to a problem?

As discussed on the HDF Forum here:

https://forum.hdfgroup.org/t/vscode-extension-for-hdf5/9769

I recently tried to open a netCDF4 file with the extension by renaming the file from test.nc4 to test.h5. The first time I tried that, it didn't work and I thought this would be a bug issue. But today I tried it and it did work!

I then looked around your repo and found https://github.com/silx-kit/vscode-h5web/pull/4 and found that if I rename the file test.nc your extension will open that is well.

So at this point, it's all down to the fact my code and group output .nc4 files.

Requested solution or feature

Support opening .nc4 like you do .nc for netCDF4 files, please.

Alternatives you've considered

Well, I could rename the files to .nc but, well, I'm lazy. 😄

I did check if your extension had settings where I could enable extra file extensions, but I didn't see that.

Additional context

Since you asked in the nice issue template, here is what I see for a .nc4 file:

Screen Shot 2022-07-21 at 3 37 22 PM

but if I rename as .nc:

Screen Shot 2022-07-21 at 3 37 58 PM

Your extension is cool!

axelboc commented 2 years ago

Haha thanks! Glad your file is working after all; maybe you were opening it from outside of your workspace folder (e.g. with drag-and-drop), which it turns out wasn't possible until we fixed it in v0.0.2? :shrug:

Anyway, I'll add the nc4 extension now, no worries :wink:

FYI, @mkitti pointed us to the VS Code setting workbench.editorAssociations to set up custom associations. I'm adding it to the README in: https://github.com/silx-kit/vscode-h5web/pull/9 (will merge now).

mathomp4 commented 2 years ago

@axelboc Just wanted to say that I can confirm it works! Thanks.