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.

    到此。分析完成。 

  • 相关阅读:
    Python进阶-----类、对象的属性的增删改查
    SpringCloud(Finchley版) 服务注册与服务发现-Eureka原理深入
    SpringCloud项目之Eureka 配置 application.yml
    sql 获得各科最高分成绩和人数
    mysql主从同步
    Log4j.properties
    JDBC 配置 jdbc.properties
    Java 通过ant打包时给JS/Jsp/css等文件加上版本号 防止有缓存
    Ant 打包 build文件
    Java zip 压缩包下载excel文件
  • 原文地址:https://www.cnblogs.com/zc22/p/1716763.html
Copyright © 2011-2022 走看看