             self.setup(editorViewController: editorViewController, baseViewController: nil)
             
             // start parcing syntax for highlighting and outline menu
-            document.syntaxParser.invalidateOutline()
+            self.outlineParseTask.perform()
             self.invalidateSyntaxHighlight()
             
             // detect indent style

            viewController.apply(style: syntaxParser.style)
        }
        
        syntaxParser.invalidateOutline()
        self.invalidateSyntaxHighlight()
    }
    

        
        self.document?.analyzer.invalidateEditorInfo()
        self.document?.incompatibleCharacterScanner.invalidate()
        self.outlineParseTask.schedule()
        
        // -> Perform in the next run loop to give layoutManagers time to update their values.
        DispatchQueue.main.async { [weak self] in
