From b16be2a4a73b2c48f39597f6de84cf3639b9d3e6 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Sun, 7 Jan 2024 10:21:20 -0800 Subject: [PATCH] Get `TextEditorRegistry` specs passing --- spec/text-editor-registry-spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/text-editor-registry-spec.js b/spec/text-editor-registry-spec.js index bc1850f80f..71b921e9d1 100644 --- a/spec/text-editor-registry-spec.js +++ b/spec/text-editor-registry-spec.js @@ -5,6 +5,13 @@ const { Point, Range } = TextBuffer; const dedent = require('dedent'); const NullGrammar = require('../src/null-grammar'); +function setupLanguageMode (editor) { + let languageMode = editor.getBuffer().getLanguageMode(); + languageMode.useAsyncParsing = false; + languageMode.useAsyncIndent = false; + return languageMode; +} + describe('TextEditorRegistry', function() { let registry, editor, initialPackageActivation; @@ -298,8 +305,10 @@ describe('TextEditorRegistry', function() { await initialPackageActivation; await atom.packages.activatePackage('language-javascript'); atom.grammars.assignLanguageMode(editor, 'source.js'); + let languageMode = setupLanguageMode(editor); atom.config.set('editor.tabType', 'auto'); await initialPackageActivation; + await languageMode.ready; editor.setText(dedent` {