Do not retry on Clipboard API for StackTraceExplorer#59658
Do not retry on Clipboard API for StackTraceExplorer#59658ryzngard merged 5 commits intodotnet:mainfrom
Conversation
| /// </summary> | ||
| public static bool CanGetText() | ||
| { | ||
| const uint TextFormatId = 1; // ID for clipboard text format (CF_TEXT) |
There was a problem hiding this comment.
MSDN says this is the format to use for ANSI text, there is also a CF_UNICODETEXT, do we need to accept unicode text that can't be expressed via CF_TEXT with the (also MSDN stated) rule that a single null terminator ends the datastream?
There was a problem hiding this comment.
I think you're looking at an older commit? This was changed to use IDataObject
jasonmalinowski
left a comment
There was a problem hiding this comment.
This'll work, but still very worried about the UI thread being blocked if the clipboard is owned by another process and it's going to take it's time. Would love to see us just transition the fetch to the clipboard to our OOP process as an asynchronous request where we can then avoid blocking a VS thread entirely.
| IntPtr ptr; | ||
| object handleRefObj = new(); | ||
|
|
||
| ptr = Win32GlobalLock(new HandleRef(handleRefObj, handle)); |
There was a problem hiding this comment.
Is there a reason to be using HandleRef here versus just GlobalLock directly being an IntPtr? It looks like the clipboard code you're copying from was trying to use that to keep some other object alive, but it's not doing anything here?
There was a problem hiding this comment.
Would that just be putting a global lock on the handle at that point instead of associating a ref object with it?
…ures/required-members * upstream/main: (187 commits) Add GlobalOptions.SetBackgroundAnalysisScope and PythiaGlobalOptions External Access API (#59794) Update source-build dependency to source-build-externals (#59549) Do not retry on Clipboard API for StackTraceExplorer (#59658) Remove unnecessary accesses on XML end tag (#59771) Threading lint Improve PDB source document project handling (#59643) Disable Auto-Open behavior for Stack Trace Explorer (#59785) REmove comment Push async up Simplify Remove stale remarks Update src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs Remove unnecessary code Simplify threading Update tests Make the IDocumentNavigationSerivice entirely async. Disable additional text comparer in generator driver (#59776) [LSP] Cache parsed xml snippets for razor (#59605) Make static ...
Fixes AB#1467909
Removes usage of Clipboard APIs for StackTrace Explorer in cases where we are looking at the clipboard data on VS activation