monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] Option `bracketPairColorization` does not work

Open FSDRE opened this issue 2 years ago • 10 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

monaco.editor.create(document.getElementById('container'), {
    value: '(((()))){{{{}}}}[[[[]]]]',
    language: 'csharp',
    bracketPairColorization: {
        enabled: true
    }
});

Actual Behavior

Bracket pair colorization does not work, no matter what language is set.

Expected Behavior

Brackets being colorized

Additional Context

I have tried languages: csharp, css, html, javascript

FSDRE avatar Mar 08 '22 13:03 FSDRE

How about 'cpp', have you tried? language: 'cpp',

eric183 avatar Mar 08 '22 15:03 eric183

It does not matter what language you specify, bracket colorization never works as far as I can tell.

ghost avatar Mar 08 '22 15:03 ghost

This works, against the typing:


monaco.editor.create(document.getElementById('container'), {
    value: '(((()))){{{{}}}}[[[[]]]]',
    language: 'csharp',
    'bracketPairColorization.enabled': true,
});

This is definitely a bug though.

hediet avatar Mar 08 '22 15:03 hediet

@hediet Confirmed! Is there a way to make this work via a typing extension for Typescipt? So I don't have to cast to any...

ghost avatar Mar 08 '22 16:03 ghost

This works, against the typing:

What is the typing!?

CetinSert avatar Mar 10 '22 19:03 CetinSert

What is the typing!?

I was referring to the typescript types.

hediet avatar Mar 11 '22 13:03 hediet

When i post it into the playground, the colored braces appear for a second, then they disappear again. Its like its rendered correctly and then immediately rerendered wrong.

caramboleyo avatar Aug 17 '22 21:08 caramboleyo

Also the matchBrackets functionality seems broken.

caramboleyo avatar Sep 03 '22 18:09 caramboleyo

Same for me!

bracketPairColorization and matchBrackets doesn't work at all :(

IT-CASADO avatar Sep 14 '22 19:09 IT-CASADO

Aye, bracketPairColorization and matchBrackets both don't work. Rolling back to 0.31.0 works fine

ColinBradley avatar Sep 14 '22 20:09 ColinBradley

@ColinBradley how did you roll back? git tags are not set for v0.31.0 or even v0.34.0

edit: 0.31.0 exists without the v prefix

edit: i have the same problem with 0.31.0 - the colored braces popup colored for a second, then they go grey again.

caramboleyo avatar Oct 08 '22 15:10 caramboleyo

Also hit this (cc @jeremy-rifkin ). We see this in all languages, and it's easy to repro in the Monaco Editor playground as per the original report).

Seen most recently in 0.36.1

mattgodbolt avatar Mar 12 '23 20:03 mattgodbolt

image

https://microsoft.github.io/monaco-editor/playground.html?source=v0.36.1#XQAAAAL8AAAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscovwBTfVOOo4AuRGzYGy8DBvknaaXft9rWb1w8nFlXgKvv6gQ-8WWRoaJxf4YK1BpWeTgWlwgQ6ptrf92RgJkcqUajbS4XqzFrCLmx5_4QNJ_DBYNOj-yKrNBpQncSILkuwvv_ShU7Ckbk0xmZkfvpI28LzEsC64RngK1a5vZvIZ9fxSJikM-hHPX__94zwAA

Works now

hediet avatar Mar 13 '23 09:03 hediet

Hi @hediet, shouldn't the bracket pairs be colored differently when enabled is false?

image

https://microsoft.github.io/monaco-editor/playground.html?source=v0.36.1#XQAAAAL9AAAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscoyOBTfVOOo4AuRGzYGy8DBvknaaXft9rWb1w8nFlXgKvv6gQ-8WWRoaJxf4YK1BpWeTgWlwgQ6ptrf92RgJkcqUajbS4XqzFrCLmx5_4QNJ_DBYNOj-yKrNBpQncSILkuwvv_ShU7Ckbk0xmZkfvpI28LzEsC634vuMIi_K1lRocBCleP79lIPgCzn_7CNEA

jeremy-rifkin avatar Mar 13 '23 17:03 jeremy-rifkin

see https://github.com/microsoft/monaco-editor/issues/3829

hediet avatar Mar 14 '23 10:03 hediet

Thanks so much

jeremy-rifkin avatar Mar 14 '23 16:03 jeremy-rifkin