示例#1
0
        public static async Task <(IWpfTextView WpfTextView, CaretPosition CaretPosition)> OpenCodeFileAndNavigateByLineAndCharAsync(
            this Shell.IAsyncServiceProvider serviceProvider,
            Solution solution, string filePath,
            int lineNumber, int character)
        {
            serviceProvider.ThrowOnNull(nameof(serviceProvider));

            if (lineNumber < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(lineNumber));
            }
            else if (character < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(character));
            }

            IWpfTextView wpfTextView = await OpenCodeWindowAsync(serviceProvider, solution, filePath);

            if (wpfTextView == null)
            {
                var(window, textDocument) = await OpenCodeFileNotInSolutionWithDTEAsync(serviceProvider, filePath);

                if (window == null)
                {
                    return(default);