コード例 #1
0
ファイル: IntegrationTest.cs プロジェクト: sphynx79/dotfiles
        public void Should_find_usages_of_class()
        {
            const string editorText = 
@"public class myclass
{
    public void method() { }

    public void method_calling_method()
    {
        method();        
    }
}
";
            var solution = new FakeSolution();
            var project = new FakeProject();
            project.AddFile(editorText);
            solution.Projects.Add(project);

            var handler = new FindUsagesHandler (new OmniSharp.Parser.BufferParser (solution), solution, new ProjectFinder(solution));
            var usages = handler.FindUsages (new FindUsagesRequest { 
                FileName = "myfile",
                Line = 3,
                Column = 21,
                Buffer = editorText
            }).QuickFixes.ToArray();

            usages.Length.ShouldEqual(2);
            usages[0].Text.Trim().ShouldEqual("public void method() { }");
            usages[1].Text.Trim().ShouldEqual("method();");
        }
コード例 #2
0
 public RenameHandler(ISolution solution, BufferParser bufferParser, OmniSharpConfiguration config, FindUsagesHandler findUsagesHandler)
 {
     _solution = solution;
     _bufferParser = bufferParser;
     _findUsagesHandler = findUsagesHandler;
     _config = config;
 }
コード例 #3
0
 public FindUsagesModule(FindUsagesHandler findUsagesHandler)
 {
     Post["/findusages"] = x =>
     {
         var req    = this.Bind <FindUsagesRequest>();
         var usages = findUsagesHandler.FindUsages(req);
         return(Response.AsJson(usages));
     };
 }
コード例 #4
0
ファイル: FindUsagesModule.cs プロジェクト: Reese-D/my_emacs
 public FindUsagesModule(FindUsagesHandler findUsagesHandler)
 {
     Post["FindUsages", "/findusages"] = x =>
     {
         var req = this.Bind<FindUsagesRequest>();
         var usages = findUsagesHandler.FindUsages(req);
         return Response.AsJson(usages);
     };    
 }
コード例 #5
0
 public RenameHandler(ISolution solution, BufferParser bufferParser)
 {
     _solution = solution;
     _bufferParser = bufferParser;
     _findUsagesHandler = new FindUsagesHandler(bufferParser, solution);
 }