dcasella / monokai-plusplus

A modern Monokai theme for Sublime Text 3 and Visual Studio Code
MIT License
46 stars 10 forks source link

Styling breaks at deeply nested scope #18

Open dsl101 opened 4 years ago

dsl101 commented 4 years ago

Again, I'm unsure if this is a syntax issue or a theme issue, but here's the block of code showing the problem. Highlighting from the permission variable inside the second promise handler starts to go wrong, and never really recovers:

image

The scope data for the first (correct) permission is:

Scope:                         text.html.vue
                               source.js.embedded.html
                               source.js
                               meta.export.js
                               meta.object-literal.js
                               meta.object-literal.js
                               meta.function.js
                               meta.block.js
                               meta.conditional.js
                               meta.block.js
                               meta.for.js
                               meta.block.js
                               meta.switch.js
                               meta.block.js
                               meta.block.js
                               meta.conditional.js
                               meta.block.js
                               meta.function-call.method.js
                               meta.group.js
                               meta.function.declaration.js
                               variable.parameter.function.js
Fg Name:                       Member variables
Fg Scope:                      variable.language, variable.other.member, variable.parameter, variable.other.readwrite.member, entity.other.attribute-name
Bg Name:                       background
Bg Scope:                      background
Syntax File:                   Packages/Vue Syntax Highlight/Vue Component.sublime-syntax
tmTheme File:                  Packages/User/Monokai++.tmTheme

and for the second (incorrect) one it's:

Scope:                         text.html.vue
                               source.js.embedded.html
                               source.js
                               meta.export.js
                               meta.object-literal.js
                               meta.object-literal.js
                               meta.function.js
                               meta.block.js
                               meta.conditional.js
                               meta.block.js
                               meta.for.js
                               meta.block.js
                               meta.switch.js
                               meta.block.js
                               meta.block.js
                               meta.conditional.js
                               meta.block.js
                               meta.conditional.js
                               meta.block.js
                               meta.function-call.method.js
                               meta.group.js
                               meta.function.declaration.js
                               variable.parameter.function.js
Fg Name:                       Normal
Fg Scope:                      keyword.operator.dereference.java, meta.preprocessor.haskell, punctuation.separator.java, variable.parameter.java, variable.parameter.js, meta.group.js, meta.group.go, punctuation.section.class.begin.python, support.variable.dom.js, constant.character.brace, constant.character.end, constant.character.paren, constant.character.quote, support.class.js, punctuation.section.group.begin.js, punctuation.section.group.end.js, meta.template.expression, meta.group.braces, source.groovy.embedded.source, punctuation.section.class.end.groovy
Bg Name:                       background
Bg Scope:                      background
Syntax File:                   Packages/Vue Syntax Highlight/Vue Component.sublime-syntax
tmTheme File:                  Packages/User/Monokai++.tmTheme

Can you tell what's going wrong here?

dsl101 commented 4 years ago

I suspect it is the depth of nested scopes. This example demonstrates. But still, is this the theme or syntax file?

image

// 8 levels OK
if (true) {  // 1
if (true) {  // 2
if (true) {  // 3
if (true) {  // 4
if (true) {  // 5
if (true) {  // 6
if (true) {  // 7
if (true) {  // 8
  p.then(result => { console.log('meh') })
}
}
}
}
}
}
}
}

// 9 levels not OK
if (true) {  // 1
if (true) {  // 2
if (true) {  // 3
if (true) {  // 4
if (true) {  // 5
if (true) {  // 6
if (true) {  // 7
if (true) {  // 8
if (true) {  // 9 Syntax colouring breaks from here
  p.then(result => { console.log('meh') })
}
}
}
}
}
}
}
}
}
Pixel48 commented 3 years ago

Idk, if it's a good pleace but imported types:
On build-in monokai obraz

On Monokai++: obraz