void () { if (!supportsCStyleSingleLineComments()) return; testTodos("// [TODO first]\nwords\n<caret>"); Document document = getEditor().getDocument(); FileDocumentManager documentManager = FileDocumentManager.getInstance(); PsiTodoSearchHelper todoSearchHelper = PsiTodoSearchHelper.getInstance(getProject()); assertTodoCountInIndexStorage(0); documentManager.saveDocument(document); assertFalse("saved doc expected", documentManager.isDocumentUnsaved(document)); assertEquals(1, todoSearchHelper.getTodoItemsCount(getFile())); assertSameTodoCountInIndexAndHighlighting(); assertTodoCountInIndexStorage(1); type("// TODO second"); assertTrue("unsaved doc expected", documentManager.isDocumentUnsaved(document)); assertEquals(2, todoSearchHelper.getTodoItemsCount(getFile())); checkTodos(""" // [TODO first] words // [TODO second]"""); assertSameTodoCountInIndexAndHighlighting(); assertTodoCountInIndexStorage(1); }