zoukankan      html  css  js  c++  java
  • GhostDoc 源码分析。


    核心代码在  

    Weigelt.GhostDoc.Addin

    Weigelt.DhostDoc.Configufation

    入口点在:

     command = this.m_dteApplication.Commands.Item("Weigelt.GhostDoc.AddIn.DocumentThis", -1);

    绑定了快捷点。绑定位置在:AssignHotkeyDialog。CreateKeyboardBindings

    这个command的激活位置在: 

    AddIn.cs: 

     this.m_objDocumentThisCommandImplementation.Execute(this.m_dteApplication);

    private DocumentThisCommandImplementation m_objDocumentThisCommandImplementation; 

    所以整个关键在:DocumentThisCommandImplementation

    获取当前代码片段:

    CodeElement: element = selection.ActivePoint.get_CodeElement(vsCMElement.vsCMElementFunction);

    this.DocumentFunction(selection, (CodeFunction) element, unknown);

    codeFunction.DocComment = DocCommentBuilder.GetDocComment(rule, args); 

    备注的关键在:

    DocCommentBuilder

    我C 你 nn 个X。终于找到了词法分析的地方了。

    1. 在 DocumentThisCommandImplementation。DocumentFunction

    解析得到:  Label_0085: 得到

                    MethodRuleArgs args2 = new MethodRuleArgs(this.m_objConfiguration, typeName, MemberModifiers.None, this.GetFullTypeName(codeFunction.Type), codeFunction.Name, argsArray, existingDocumentationXml, processedDocComment, codeLanguage);

    关键就是这个args。里面构造函数: 

                this.m_objReturnTypeName = new TypeName(returnTypeName);

                this.m_objMethodName = new Weigelt.GhostDoc.MethodName(configuration, methodName);

                this.m_lstParameters = new ParameterRuleArgsList(configuration, parameters);

     名字解析在:MethodName

     this.m_objWords = new MethodNameWords(base.Configuration, base.ActualName);

    又继承了Word.

    到此。分析完成。 

  • 相关阅读:
    龟兔赛跑(动态规划)
    Dividing (多重背包 搜索)
    第k大值01背包问题
    FATE(完全背包)
    01背包 和 完全背包 详解
    放苹果(动态规划)
    max Sum(简单动态规划)
    连连看 优先对列 应用2
    尺取法
    Square(强大的剪枝)
  • 原文地址:https://www.cnblogs.com/zc22/p/1716763.html
Copyright © 2011-2022 走看看