@@ -15,31 +15,34 @@ import io.github.rosemoe.sora.widget.SymbolPairMatch
15
15
import org.cosmicide.common.Prefs
16
16
import org.cosmicide.editor.language.IdeFormatter
17
17
import org.eclipse.tm4e.core.grammar.IGrammar
18
+ import org.eclipse.tm4e.languageconfiguration.model.LanguageConfiguration
18
19
19
20
/* *
20
21
* A language implementation for the IDE.
21
22
*
22
23
* @param grammar The grammar for the language.
24
+ * @param langConfiguration The language configuration.
23
25
* @param grammarRegistry The grammar registry.
24
26
* @param themeRegistry The theme registry.
25
27
* @param createIdentifiers Whether to create identifiers or not.
26
28
*/
27
29
open class IdeLanguage (
28
30
private val grammar : IGrammar ? ,
31
+ private val langConfiguration : LanguageConfiguration ? ,
29
32
private val grammarRegistry : GrammarRegistry ,
30
33
private val themeRegistry : ThemeRegistry ,
31
34
private val createIdentifiers : Boolean = false
32
35
) : TextMateLanguage(
33
36
grammar,
34
- grammarRegistry.findLanguageConfiguration(grammar?.scopeName) ,
37
+ langConfiguration ,
35
38
grammarRegistry,
36
39
themeRegistry,
37
40
createIdentifiers
38
41
) {
39
42
40
43
private val _symbolPairs : SymbolPairMatch by lazy {
41
44
val symbolPair = SymbolPairMatch ()
42
- languageConfiguration .autoClosingPairs!! .forEach { autoClosingPair ->
45
+ langConfiguration? .autoClosingPairs? .forEach { autoClosingPair ->
43
46
symbolPair.putPair(
44
47
autoClosingPair.open,
45
48
SymbolPairMatch .SymbolPair (
0 commit comments