question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Matching bracket is not highlighted

See original GitHub issue

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

// The Monaco Editor can be easily created, given an
// empty container and an options literal.
// Two members of the literal are "value" and "language".
// The editor takes the full size of its container.

monaco.editor.create(document.getElementById('container'), {
	value: "function hello() {\n\talert('Hello world!');\n}",
	language: 'javascript'
});

Reproduction Steps

With the code above, when you click on the code on the left panel, the matching bracket is not highlighted properly. See the screenshots below. I’m not 100% sure if this is bug, or if I’m just missing some config. Really appreciate any guidance here. Thank you!

Actual (Problematic) Behavior

Here, you can see the matching bracket of the function is not highlighted

Screen Shot 2022-12-03 at 8 15 32 PM

Expected Behavior

I took this from vscode.dev, and really any VSCode

Screen Shot 2022-12-03 at 8 16 07 PM

Additional Context

What I noticed is in our README

image

and this old Stackoverflow thread this seems to use to work, so I’m somewhat suspicious this could be a bug, hence filing as such

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
hedietcommented, Dec 13, 2022

Will be released soon! Also, check out our nightly release on npm, though monaco-editor is currently broken.

0reactions
akphicommented, Dec 13, 2022

After doing a bit of error-trial and searching Github issues, I think

  1. I have create an instance of editor that uses json as the format, this fix doesn’t seem to work for that particular file, maybe there’s something wrong with json format in particular: I have tried with other languages, such as java, part of src/basic-languages and they all seem to work fine.

Is an issue on its own

  1. I want to disable the bracket pair coloring, but I found that setting this option using editor.create(..., {bracketPairColorization: { enabled: false }}) will not work, but the setting that option in TextModel using model.updateOptions({bracketColorizationOptions: { enabled: false }}) will work, at least that’s what I observed when I debug ColorizedBracketPairsDecorationProvider.

Is duplicated of #3013, the workaround is to set 'bracketPairColorization.enabled': false, in editor option

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Bracket highlighting doesn't work over large distances
The matching bracket is not underlined and my indentation guides stop being highlighted as the correct indentation level.
Read more >
354172 – Matching template brackets are not highlighted - Bugs
I just tried with Helios (CDT 7.0), but nothing is highlighted, so it does not look like a regression. The problem is that...
Read more >
112898 – Missing bracket matching support - Bugzilla
Move the cursor either towards the opening bracket or towards the closing bracket. 3. No animation nor highlighting happens.
Read more >
Highlight matching pairs of parentheses, brackets, and braces
If you bring the cursor near an opening or closing parenthesis, curly brace, square bracket, the matching will start glowing/blinking.
Read more >
Highlight Matching Brace In Visual Studio - Stack Overflow
The Visual Studio 2013 C# editor has brace highlighting. Place the cursor on the outside of the brace, (not the inside) to see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found