Notepad ++使FunctionList与.js一起使用

com*_*ble 1 notepad++

我已经在Win7上安装了Notepad ++,版本7.3.3和7.4.2,两个版本我打开一个javascript文件,navitage到View> FunctionList

功能列表显示为空白.

我在sourcefourge上发现了另一个函数列表,插件版本2.1有点工作,但是,我必须更新语言规则并按"try!" 每个JS代码文件的按钮,然后出现功能.

请问,有人知道如何安装Notepad ++并让FunctionList适用于.js吗?

我没有使用AppData,我将所有notepad ++文件安装到notepad ++目录中.

Pet*_*ter 5

你想要这个<parser>用于javascript.它位于文件functionlist.xml中,可以在NPP的安装目录中,也可以在AppData中的某个位置进行修改.这不处理所有情况(函数头中的注释),但大多数情况下.

另外,javascript 的langID数是19,而不是58.您的问题看起来像langID,但在修复之后,您将检测到您需要适应的<parser>.

关联ID在这里,并且必须同时在文件functionlist.xml中:

<association id=  "javascript_function"   langID="58"                          />
<association id=  "javascript_function"   langID="19"                          />
Run Code Online (Sandbox Code Playgroud)

解析器在这里,改编我:

<parser
    displayName="JavaScript"
    id         ="javascript_function"
    XcommentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"


    bemerkung1="für Kommentar zwischen function header und {. [\n\s]*\{ am Ende gelöscht."
    bemerkung2="für new Function(...)  (?:new\s*)? eingefügt."
    bemerkung3="für function (a,b,c) ohne Funktionsname ein \s* eingefügt."
    bemerkung4="Kommentar im Funktionsheader wird nicht behandelt, z.B. function /*returns real*/ a(b) { } "
    bemerkung5="commentExpr überhaupt X-ed."
    bemerkung99="Es muss etwas falsch sein mit commentExpr durch nichts ersetzen."

    comment1="Comment between function header and function body {: removed [\n\s]*\{ "
    comment2="new Function(): inserted (?:new\s*)? "
    comment3="function (a,b,c) without function name: inserted \s*" 
    comment4="Comment within function header still not handled. e.g. function /*returns real*/ a(b) { } "
    comment5="commentExpr disabled: X-ed."
    comment99="There must be something wrong with replacing commentExpr by nothing."

>
<function
    mainExpr="((^|\s+|[;\}\.])([A-Za-z_]\w*\.)*[A-Za-z_]\w*\s*[=:]|^|[\s;\}]+)\s*(?:new\s*)?function(\s+[A-Za-z_]?\w*\s*\([^\)\(]*\)|s*\([^\)\(]*\))"
>
    <functionName>
        <nameExpr expr="[A-Za-z_]\w*\s*[=:]|[A-Za-z_]?\w*\s*\(" />
        <nameExpr expr="[A-Za-z_]?\w*" />
    </functionName>
    <className>
        <nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*\." />
        <nameExpr expr="([A-Za-z_]\w*\.)*[A-Za-z_]\w*" />
    </className>
</function>
</parser>
Run Code Online (Sandbox Code Playgroud)