使用导出类

时间:2018-12-08 19:10:33

标签: javascript eclipse

如果我有带有代码的标准javascript类:

class MyClass {
   // My functions here
}

然后代码折叠将按预期工作,并且eclipse可以折叠类中的每个方法。

但是如果我想通过添加关键字“ export”来导出类,则为:

export class MyClass {
   // My functions here
}

然后,eclipse删除折叠方法的选项。现在,它只能折叠整个类,而不能折叠。那么,即使使用export关键字,有什么方法可以让日食中的“普通”类折叠?

(我不明白为什么出口应该改变折叠规则)。

1 个答案:

答案 0 :(得分:1)

折叠基于抽象语法树(AST)。正如您在 Outline 视图中看到的那样,关键字 Dim getPrice As Object Set getPrice = ie.Doc.getElementByClassName("final-price")(0) 'While Using Class Name you must indicate an index of that class Dim myValue As String: myValue = getPrice.innerText wks.Cells(i, "C").Value = myValue 错误地将AST类节点转换为“导出声明” 节点

您可以将错误报告给Eclipse或/和从Eclipse JavaScript Development Tools (JSDT)切换到Eclipse Wild Web Developer,这需要安装Node.js,并且将来可能会替换JSDT( Eclipse Wild Web Developer使用Language Server Protocol (LSP),并且开发起来更加积极)。