VsixCommunity / Community.VisualStudio.Toolkit

Making it easier to write Visual Studio extensions
Other
256 stars 44 forks source link

GetSelectionAsync does not return non-code type document references. #458

Open aesalazar opened 1 year ago

aesalazar commented 1 year ago

I am trying to write an extension that obtains the current active Document Tab using

var solutionExplorer = await VS.Windows.GetSolutionExplorerWindowAsync();
var selections = await solutionExplorer.GetSelectionAsync();

Using this repo as an example: https://github.com/aesalazar/AsteroidsWasm

image

If I have the launchSettings.json file active, the method returns a proper reference to it. However, if I have the favicon.ico active, the call does not return it. It seems to return the last-selected non-image (among others?) file. In the above it, it will continue to return launchSettings.json.

Is this a known limitation of the method?

Thanks! Ernie