【问题标题】:Issues with modifying the editor document in Intellij Plugin development在 Intellij 插件开发中修改编辑器文档的问题
【发布时间】:2015-07-03 08:30:30
【问题描述】:

当我在 Writecommand 操作中执行此类操作时, editor.getDocument().insertString(offset, "示例文本");

我猜它存储在缓存中并且不会立即更新。 那么可以做些什么来立即获得更新。 我尝试同步和异步刷新虚拟文件,但没有帮助。 那么有什么办法呢?

【问题讨论】:

    标签: intellij-plugin


    【解决方案1】:

    要更新磁盘上的文件,请使用FileDocumentManager.saveDocument()。要更新文档的 PSI,请使用 PsiDocumentManager.commitDocument()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多