在运行时禁用CDT项目中的语法错误

时间:2019-06-12 09:59:46

标签: eclipse-plugin eclipse-cdt

在C / C ++项目中,我可以通过右键单击项目,然后单击hmOrgan = seaborn.clustermap(NormcountsOrgan, cmap="RdPu", yticklabels=False, xticklabels=False,row_cluster=True, col_cluster=True,row_colors=row_colors, metric="euclidean") for label in Normcountstransposemetadata["Organ"].unique(): hmOrgan.ax_row_dendrogram.bar(0, 0, color=my_palette[label], label=label, linewidth=0) hmOrgan.ax_row_dendrogram.legend(loc="bottom", bbox_to_anchor=(0.47, 0.8),ncol=1) hmOrgan.fig.suptitle("Top genes: Organs", fontsize=32) 来禁用语法错误。

它看起来像这样: Disable Syntax and Semantic Erors in Project Properties

有没有办法在运行时为我的eclipse插件执行此操作?在我的Eclipse插件中,我希望默认情况下禁用语法和语义错误。

1 个答案:

答案 0 :(得分:0)

是的,可以使用CodAn的公共API来完成。我没有充实的代码示例,但是基于屏幕快照中首选项页面所使用的API的快速浏览,这些步骤的大致轮廓如下:

  • 使用org.eclipse.cdt.codan.core.CodanRuntime.getInstance().getCheckersRegistry().getWorkspaceProfile()获取工作区的“问题配置文件”(每种CodAn问题的设置)。
  • 使用IProbemProfile之类的findProblem(String id) API查找感兴趣的检查器。该首选项页面上的每个可检查条目都是一个IProblem
  • IProblem转换为IProblemWorkingCopy,然后使用IProblemWorkingCopy.setEnabled()修改启用。
相关问题