microsoft / microsoft/monaco-editor

[Bug] debugger; statement in diffAlgorithm.ts

Open
#4,391 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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 Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.46.0#XQAAAALqAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0NV5ZhsAFQjfi1GSTeRDChAtr8RC8jhkfedYn4TxJcJIcii5J3w75DBaWUzZY7JhpoXvJUR_WOC8PUjTJJHARZq1Yvwknih9CKoN8cX52K0IsNBtLsWAS-pNClj345Kw7Obf-TJkCoxNGAe1feBwKEM_zEfs2hqXYosGzEcrts7GBx6xmX5kC3DSKFaUyWT-8ggK3bn1Kgwq8fyVflZBnzqHH7a6CfTk7xzp5I2WObspjo9StazRuvhh6xiLzjVYOH9FGjjODUBwuGK_zD7P_f2Paw

Monaco Editor Playground Code
const originalModel = monaco.editor.createModel(
	'foo bar \n'.repeat(10000),
	"text/plain"
);
const modifiedModel = monaco.editor.createModel(
	'foo foo bar \n'.repeat(10000),
	"text/plain"
);

const diffEditor = monaco.editor.createDiffEditor(
	document.getElementById("container"),
	{
		originalEditable: true,
		automaticLayout: true,
	}
);
diffEditor.setModel({
	original: originalModel,
	modified: modifiedModel,
});
Reproduction Steps
  1. Open dev tools
  2. Load playground with large diff
  3. Will eventually break at debugger statement
Actual (Problematic) Behavior

debugger; :

image

Expected Behavior

No debugger;

Additional Context

Just upgraded monaco from a pretty old version and now keep getting stuck in the debugger statement while navigating in my app (I work with a lot of large diffs).

Bisected to https://github.com/microsoft/vscode/compare/949c8073e29554a897d764dcd05930bcb626e377...061041479c3fc2ad4d813bc87bc62d2b0c95d0b8

https://github.com/microsoft/vscode/blob/05bf957b312e16532c7669004df043e7c580af1d/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts#L188

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

Start at src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts around line 188, then reproduce the issue with the linked Monaco playground and its large diff. Confirm that navigating or loading the diff no longer pauses at a debugger statement, while the diff still works as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.