[Peek] Add support for .ahk, .csv and .tsv previewing as plaintext files #35538
+16
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This replaces the previous #34824 PR. That PR's feature to allow the previewing of arbitrary plaintext files is not available here and is covered by a separate issue.
This change allows for the previewing of AutoHotKey .ahk script files, Comma-Separated Values .csv files and Tab-Separated Values .tsv files with the Monaco renderer in Peek (via the WebBrowserPreviewer).
PR Checklist
.txt
) (Unrelated to Office files preview) #33811Detailed Description of the Pull Request / Additional comments
.ahk, .csv and .tsv file extensions have been added to the relevant Monaco settings files, in a similar manner to the addition of .srt files previously.
A small fix was made to MonacoHelper.cs by placing a
using
for the JsonDocument instantiation there, as it was not Disposed previously.Code has been added to ensure any Shell preview handlers which could render these new file types are not overridden. (This was necessary because
ShellPreviewHandlerPreviewer
is later thanWebBrowserPreviewer
in theIsItemSupported()
checks in PreviewerFactory.cs.) Most notably, if a user has Office installed then CSV files should still be previewed by Excel's previewer and not by the plaintext previewer here in Peek.Validation Steps Performed
Please note: I don't own Microsoft Office / Office 365, so could not confirm that the Excel previewer handler for CSV files still works correctly with this update. Could this please be tested by one of the devs with that software installed? Many thanks.