Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick suggestion make me into the shadow, later canot see suggestion #1911

Closed
ZhangMingZhao1 opened this issue Apr 8, 2020 · 2 comments
Closed
Assignees
Labels
help wanted Issues identified as good community contribution opportunities *question Issue represents a question, should be posted to StackOverflow (VS Code) suggest

Comments

@ZhangMingZhao1
Copy link

2020-04-08 15 48 30

demo link

// Configures two JSON schemas, with references.

var jsonCode = [
    '{',
    '    "p1": "v3",',
    '    "p2": false',
    "}"
].join('\n');
var modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for our model
var model = monaco.editor.createModel(jsonCode, "json", modelUri);

// configure the JSON language support with schemas and schema associations
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
    validate: true,
    schemas: [{
        uri: "http://myserver/foo-schema.json", // id of the first schema
        fileMatch: [modelUri.toString()], // associate with our model
        schema: { 
            type: "object",
            properties: {
                p1: {
                    enum: ["v1", "v2"]
                },
                p2: {
                    $ref: "http://myserver/bar-schema.json" // reference the second schema
                }
            }
        }
    }, {
        uri: "http://myserver/bar-schema.json", // id of the first schema
        schema: {
            type: "object",
            properties: {
                q1: {
                    enum: ["x1", "x2"]
                }
            }
        }
    }]
});

monaco.editor.create(document.getElementById("container"), {
    model: model
});

When I input p1, and i got schema snippet, but as the same time, i into the shadow, when i input p2, there no suggestion because i into the shadown mode,unless i click up or down or tab key
to escape shadow,then when i input p2, there is suggestion snippet.

2020-04-08 15 58 50

so, what is shadow, It interferes with the user's smart prompt,how to solve it? options?

@alexdima
Copy link
Member

alexdima commented May 4, 2020

I think the grey thing is a snippet stop which grows as you type in it. Since this reproduces in VS Code, I suggest you create an issue with VS Code specific steps (like typing in your keybindings.json file) against the VS Code repository at https://github.com/microsoft/vscode

@alexdima alexdima added the help wanted Issues identified as good community contribution opportunities label Sep 18, 2020
@jrieken
Copy link
Member

jrieken commented Dec 8, 2021

When a snippet is active, IntelliSense as you type (aka quick suggestions) is disabled. That is because there is a conflict between the Tab-key which moves to the next placeholder but also accepts a completion. You wouldn't be able to type in a placeholder and then move to the next placeholder as you would accept a suggestion then. You have the following options

  • change the default via the editor.suggest.snippetsPreventQuickSuggestions-setting
  • in snippets trigger suggestions manually (via Ctrl+Space, Alt+ESC (macOS), or ctrl/cmd+i)

@jrieken jrieken closed this as completed Dec 8, 2021
@jrieken jrieken added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 8, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Issues identified as good community contribution opportunities *question Issue represents a question, should be posted to StackOverflow (VS Code) suggest
Projects
None yet
Development

No branches or pull requests

3 participants