[Bug] maxTokenizationLineLength message does not make sense for JSON tokenizer

Open
#4,272 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with the Monaco Editor Playground configuration in the issue, especially maxTokenizationLineLength and the JSON language setting. Reproduce the mismatch between line highlighting and the hover message, then trace the tokenization status and hover information used by that configuration. Done means the actual tokenization behavior and hover message agree for the reported limit.

Written by the indexing model from the issue text.

Description

bug tokenization
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.44.0#XQAAAAJvAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzeGe2_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKiuHAg9KQ6ZwEgg65_cAgZ7FYyNxeWYeKJhXGybBcv8k5zZE6VqryJsIdUnidc5Y6K1guqADFHgmK9d9buXYFQ8pSvlFJXvdJ4L6uJlIPp7nFL6ntQqL6fMVp4kC38OvU-qP_A-LyF-cEV2uE2yuNQXBBKfqHh9XwBQlHDCGODul-9BOtxsvhIDj4a_YbO2L-A0YBl5yYHm88OQ2GO2Xu40kjYatxjerA4W1iXfRosAkKyLVAK9CelZJVnv73Tuoy

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `{ "test": "this is my custom json" }`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "json",
	automaticLayout: true,
	maxTokenizationLineLength: 4,
});
Reproduction Steps

No response

Actual (Problematic) Behavior

The line gets tokenized and highlighted. When hovering over the line, it actually says that tokenization was skipped.

Expected Behavior

Tokenization should be skipped. Or at least the info on hovering should be consistent with the tokenization.

Additional Context

This already has been reported in https://github.com/microsoft/monaco-editor/issues/3025.

However, I couldn't find a monaco version that works correctly.

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

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.

More from microsoft/monaco-editor

All issues in microsoft/monaco-editor

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.