예제 #1
0
        private async Task<RenameResponse> SendRequest(OmnisharpWorkspace workspace,
                                                       string renameTo,
                                                       string filename,
                                                       string fileContent,
                                                       bool wantsTextChanges = false,
                                                       bool applyTextChanges = true)
        {
            var lineColumn = TestHelpers.GetLineAndColumnFromDollar(fileContent);
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var request = new RenameRequest
            {
                Line = lineColumn.Line,
                Column = lineColumn.Column,
                RenameTo = renameTo,
                FileName = filename,
                Buffer = fileContent.Replace("$", ""),
                WantsTextChanges = wantsTextChanges,
                ApplyTextChanges = applyTextChanges
            };

            var bufferFilter = new UpdateBufferFilter(workspace);
            bufferFilter.OnActionExecuting(TestHelpers.CreateActionExecutingContext(request, controller));

            return await controller.Rename(request);
        }
예제 #2
0
        private async Task <RenameResponse> SendRequest(OmnisharpWorkspace workspace,
                                                        string renameTo,
                                                        string filename,
                                                        string fileContent,
                                                        bool wantsTextChanges = false,
                                                        bool applyTextChanges = true)
        {
            var lineColumn = TestHelpers.GetLineAndColumnFromDollar(fileContent);
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var request    = new RenameRequest
            {
                Line             = lineColumn.Line,
                Column           = lineColumn.Column,
                RenameTo         = renameTo,
                FileName         = filename,
                Buffer           = fileContent.Replace("$", ""),
                WantsTextChanges = wantsTextChanges,
                ApplyTextChanges = applyTextChanges
            };

            var bufferFilter = new UpdateBufferFilter(workspace);

            bufferFilter.OnActionExecuting(TestHelpers.CreateActionExecutingContext(request, controller));

            return(await controller.Rename(request));
        }