【问题标题】:libclang python binding don't return any of fixitslibclang python绑定不返回任何fixits
【发布时间】:2014-03-10 16:15:44
【问题描述】:

我想从翻译单元 (tu) 转储诊断和修复。但是下面的代码不起作用。

def dump_fixits():
    """Return diagnostics with fixits of translation unit."""
    result = []
    for diag in tu.diagnostics:
        diag_fixits = [repr(it) for it in diag.fixits]
        location = diag.location
        file = "" if location.file is None else location.file.name
        result.append((file + ":"
                       + str(location.line) + ":"
                       + str(location.column) + ": "
                       + severity_map[diag.severity] + ": "
                       + diag.spelling,
                       diag_fixits))
    return result

(我使用的是 llvm 3.4)

我注意到conf.lib.clang_getDiagnosticNumFixIts() 每次都返回0

有什么解决办法吗?

【问题讨论】:

    标签: python libclang


    【解决方案1】:

    对不起,我误解了 fixit。我认为 fixit 可能会丢失拼写,但事实并非如此。关闭这个问题。谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-29
      • 1970-01-01
      • 2015-05-06
      • 2018-10-19
      • 2021-09-19
      • 1970-01-01
      相关资源
      最近更新 更多