microsoft / microsoft/monaco-editor

using linesDecorationsClassName we able to show vertical bar with some color, is posible to show on right side of the editor?

Open
#4,887 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

How to show vertical bar on the right hand side of the editor with some background color?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAKqAwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw1opXLRiS2N9aGkduDPa_npiUhFZYzDsd-RvVGRY6r9dEzEL7CkVjXYfXEqCOPATLbFEW071fq2LLkY3j_GIwxB8diu32atWGIyNp79zpmSP1QyvMXFCv9xv-1Hw0nDakYpkRwC2mV9j5c9qMh28Vv3TwQVndbf9Kya_HJNzzfhPrCDCYKQ7HKkiBGhVY_1A1SBvtvwECV1zotJRAVUSIs0ala79yya4u3jtKcx0e_ZxLBM9x-ELPy3KqCzqoczYiJ_WQriOV--DHnzv0IEccFkyPfprWPM-jCoY3nHszMoRil1hm_Utj3ai_7oEad5T3nY2f6h9oiVrNzDcrtaCmZkF7NvAj-9uaTtb5BLba7Nt1Fq5nKieRbkyS2lUypIJrzFao6w3I7EbROnnSUUq1oRDhZ9YoAZZZpUCzyL7V5_cLMHydk5-HFGSGP93unFhglHvrgNINf-8GDNPAfeA2Drl-O9OprOTz6Oe9TFgeHn2zgpa-4_dOisdtsRqs-vSLGUpwfegNTsKdNH2joAQYHkJmX5MCw_884cn210P5Boec1c3-2dHNavv7FSN-WbRGUr1cChB11X0t679GFDOPVgHDH5eZkhj7H2luxdYeB3nEEZ8xZrqGVJGovcfEY0ESisb7CJ7xpn7n_Ulp_4gEiUheDBrmZmkxDiyYQ2MPl07EvsN5vev_89CWig

Monaco Editor Playground Code

``var jsCode = [
'"use strict";',
"function Person(age) {",
" if (age) {",
" this.age = age;",
" }",
"}",
"Person.prototype.getAge = function () {",
" return this.age;",
"};",
].join("\n");

var editor = monaco.editor.create(document.getElementById("container"), {
value: jsCode,
language: "javascript",
});

var decorations = editor.createDecorationsCollection([
{
range: new monaco.Range(1, 0, 9, 0),
options: {
isWholeLine: true,
linesDecorationsClassName: "myLineDecoration",
},
},

]);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides a Monaco Editor Playground link and sample JavaScript using createDecorationsCollection and linesDecorationsClassName. Start by reproducing the example in the playground and checking the decoration API and related documentation. Done means establishing whether a right-side colored vertical bar is supported and documenting or implementing the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.