microsoft / microsoft/monaco-editor

[Bug] The editor doesn‘t show suggestion in typescript union type?

Open
#4,713 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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.52.0#XQAAAAKDAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzlSNRgmSaumWUF-TBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKi2HE8Ay7rYVRaT2AP-CadfxsBdokdahIviAi93MvwDF8b8XzkHuPNdCeZ5V8z9Em0IF7Ime8PbjsLEXQErPNjSpZry7LzgeDlhlOBzl4ty_FzgYQpdDDexChD9jt-N3JctaRk3fPHTikfdD41FBQwZv96MeWPJbJ0ItHH7JAo3i-SjpeQMt8qlzXXQjBhclh4OjmfxWs9d4FcDHVX-x5MG4bRkcPpTadr1IRLutJ0t46xl9dA64wQTU5TApHEzSf_6gt5LA

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `type CarBrand = "Toyota" | "BMW" | "Mercedes" | "Audi";

const car: CarBrand = ""`;

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

Open playground url, and input const car: CarBrand = ""

Actual (Problematic) Behavior

After input double quotes, the editor doesn't show suggestion like vscode.dev

Image

Expected Behavior

I want that the editor can show suggestion like vscode.dev after input double quotes.

Additional Context

No response

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 with the linked Monaco Editor Playground and its TypeScript example, then compare completion behavior there with vscode.dev after entering the union-typed string. The issue names no repository file or test entry point, so trace the playground's suggestion path and identify how the expected suggestions are produced. Done means suggestions appear after entering the opening double quote for the shown CarBrand union.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.