smikitky / vscode-dicom-dump

A vscode extension that dumps DICOM tags
https://marketplace.visualstudio.com/items?itemName=smikitky.vscode-dicom
MIT License
20 stars 2 forks source link

No "Dump DICOM tags" context menu. #5

Closed brenthuisman closed 4 years ago

brenthuisman commented 4 years ago

Although originially my dicom files did not have any extension at all, adding .dcm or .dicom does not result in the context menu options. When I load the files, I get the default warning the file is not displayed because it's binary or has an unsupported encoding. Opening it anyway, or not, both don't result in the context options. Through dicom-parsers online demo it seems like there's nothing wrong with the files (all other tooling we have handles them fine too).

I restarted vsc and reinstalled the plugin a few times, no dice.

I use VSCodium, would that make a difference? It hasn't for any other plugin I use so far...

smikitky commented 4 years ago

Is your DICOM file on your local machine, and are you using an ordinary local workspace? If you're loading your DICOM files via a FileSystemProvider (e.g., SSH FS), this is a known issue. I have a plan to fix it (#4).

I use VSCodium, would that make a difference?

I doubt it makes some difference, but I personally don't use it, so I may be missing something.

brenthuisman commented 4 years ago

All files and software are local.

chafey commented 4 years ago

I have the same issue - the context menu does not appear for files without any extension. Can you make it work with any file regardless of extension? Nice work BTW, I will use this :)

smikitky commented 4 years ago

@chafey Thank you for the suggestion. The visibility of the context menu items is managed by VS Code itself, and, last time I checked, I could control the visibility based only on the language ID (=file type).

https://github.com/smikitky/vscode-dicom-dump/blob/75e0a56409a73ca6b4af31b8949850b4799650f1/package.json#L99-L112

Unfortunately, VS Code was (and still is) terribly bad at inferring the type of a file based on its contents if the file had no extension. I could have removed the when condition altogether, but that meant the "Dump DICOM" will show up even on text files, which was not desirable.

However, I just noticed that the when-clause contexts have been significantly expanded, so what you requested seems totally possible to me now. It's probably even possible to control the visibility of the dump menu according to the user preference.

smikitky commented 4 years ago

Fixed in v1.3.0 (commit: 2bf9ddafc7f4892776ec39e44d09db209b4e4e28). Please set the dicom.alwaysShowMenu option to true.