certinia / debug-log-analyzer

Salesforce Apex debug log analyzer for Visual Studio Code - Visualize code execution via a Flame chart and identify performance and SOQL/DML problems via Method and Database analysis
https://marketplace.visualstudio.com/items?itemName=financialforce.lana
BSD 3-Clause "New" or "Revised" License
82 stars 18 forks source link

feat: Copy to clipboard doesn't work #504

Open JCripe-AuthorSolutions opened 5 months ago

JCripe-AuthorSolutions commented 5 months ago

Summary

Right clicking on a log analysis line shows "Copy Ctrl+C, ...," but using "Copy" doesn't work. No log contents are put in the clipboard. Also, the "Cut" and "Paste" options are shown improperly, as they won't function in this context.

Steps To Reproduce

  1. Run the Apex Log Analyzer on a debug log file.
  2. Click on a line in the log analyzer output to select it, and right click on the selection, and choose "Copy Ctrl+C" or do Ctrl-C directly.
  3. Try to paste the clipboard contents to another document, only to find the contents pasted aren't from the log analysis, so the copy operation failed silently.

Expected result

The clipboard should have been loaded with the selected text for pasting.

Actual result

The clipboard contents are old, not replaced with the selected log analyzer line text.

Additional information

Feel free to attach a screenshot.

VS Code Version: v1.14.1

Log Analyzer Extension Version: v1.14.1

OS and version: Windows 10 Enterprise, version 10.0.19045 Build 19045

lcottercertinia commented 5 months ago

Thanks for the report. The cut, copy, paste context menu is provided by vscode and has default behaviour. We have limited control over it but we can remove the context menu altogether or hide it in certain situations. But it does have default behaviour and copies selected text so can be useful in some limited situations.

This is not really a bug but it is a feature gap, we need to handle copy and paste application wide, so I will turn this in a feature and get it targeted to a release.

There is a slight work around for copying text from the grids. You can selected some text with mouse down and then use CMD/ CTRL + C to copy BEFORE releasing mouse down.

If any of the tables have focus CTRL/ CMD+C will copy the full table content to the clipboard, but honestly it is a bit clunky.

Changes I would suggest a bunch of changes to make copy nicer to use, feedback would be appreciated.

  1. Copy should generally work like the browser (right click will select the highlight word).
  2. Move the Export to CSV from table header menu to dedicated button .
  3. Add a copy to clipboard button for the whole table content.
  4. Allowing copying from the cells in the table (maybe similar to excel, right click will select the whole cel , double click to enter and edit state to select sub set of the text)

Let me know if you have other ideas and thought and I will add them to this 👍🏻