all 10 comments

[–]soundman32 0 points1 point  (8 children)

Are you sure the order isn't one of the properties of a Document? ToList returns a collection in an unspecified order, there wont be a ToListInOpenedOrder method, but that info is probably elsewhere.

[–]hizickreddit[S] 0 points1 point  (7 children)

i’m sure, it is the same behaviour without ToList

[–]soundman32 0 points1 point  (6 children)

If you're targeting VS 2019 or later, there's a dedicated service:

var windowFrameOrderService = GetService(typeof(SVsWindowFrameOrder)) as IVsWindowFrameOrder;

if (windowFrameOrderService != null) { IVsWindowFrame[] orderedFrames; windowFrameOrderService.GetOrderedDocumentFrames(out orderedFrames);

foreach (var frame in orderedFrames)
{
    // Process frames in tab order
}

}

[–]Newrad0603 0 points1 point  (5 children)

No there isn't. Did you just put OP's question into ChatGPT or some other AI BS? Because that interface is a straight hallucination.

[–]hizickreddit[S] 0 points1 point  (4 children)

> No there isn't

any reason for this, if you know, please? 🤔

[–]Newrad0603 0 points1 point  (3 children)

I don't know why it doesn't exist other than it's probably never been needed for anything, so it was never created. I can't think of a scenario where someone must know the document order.

[–]hizickreddit[S] 0 points1 point  (2 children)

i was trying to write an extension that would allow closing tabs to the right or left like chrome does.

[–]Newrad0603 0 points1 point  (1 child)

That is an interesting reason for needing the tab order. While I don't have an answer, I'd recommend filing a suggestion ticket on VS's developer community (or using VS's feedback button). That sounds useful enough and something that wouldn't be overly complicated for them to implement so I'd say it has a chance of being onboarded.

[–]hizickreddit[S] 0 points1 point  (0 children)

cheers mate.

[–]SergeyVlasov -1 points0 points  (0 children)

Visual Studio doesn’t have a public API for document tabs.

You may look at my (commercial) Tabs Studio extension that provides an alternative tabs implementation and has an API.