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

[Bug] Cannot disable suggestions for only one editor on page #3378

Open
1 task
abaksha-sc opened this issue Oct 20, 2022 · 2 comments
Open
1 task

[Bug] Cannot disable suggestions for only one editor on page #3378

abaksha-sc opened this issue Oct 20, 2022 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug editor-core
Milestone

Comments

@abaksha-sc
Copy link

abaksha-sc commented Oct 20, 2022

Reproducible in vscode.dev or in VS Code Desktop?

  • [ I don't know ] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

const container1 = document.createElement('div');
const container2 = document.createElement('div');
const style = 'height: 200px; border: 1px solid #000; margin: 10px;';
container1.setAttribute('style', style);
container2.setAttribute('style', style);
document.body.appendChild(container1);
document.body.appendChild(container2);

// basic editor #1
monaco.editor.create(container1, {
	value: '/* suggestions are not working here */\n<Item type="Test1" id="512FF7893DBCD6D1AC1F55B87A480934">\n</Item>',
	language: 'xml'
});

// read only editor #2
monaco.editor.create(container2, {
    value: '/* read only editor */\n<Item type="Read Only Editor">\n\n</Item>',
    language: 'xml',
    readOnly: true,
    suggest: {
        showFields: false,
        showFunctions: false
    },
    quickSuggestions: {
        "other": false,
        "comments": false,
        "strings": false
    },
    parameterHints: {
        enabled: false
    },
    ordBasedSuggestions: false,
    suggestOnTriggerCharacters: false,
    acceptSuggestionOnEnter: "off",
    tabCompletion: "off",
    wordBasedSuggestions: false
});

Reproduction Steps

Call suggestions dialog at first editor

Actual (Problematic) Behavior

There is always "No suggestions"

Expected Behavior

Suggestions dialog works and displays and includes only keywords from current editor.

Additional Context

I have two editors on page and I need to split suggestions for them. Keywords for each editor should be taken separately.

As a workaround I tries to disable editing and all suggestions options for the second editor. But these options also applies for the first editor. It's unexpected.

Do anyone has idea how to split suggestions keywords between each editor? Or maybe to leave only code highlighting for the second one.

P.S. There is a service where user inputs XML request (should be with IntelliSense) in first monaco editor and after request user should see highlighted XML response in second editor (this one can be stupid - without editing, suggestions etc.)

@steinerjakob
Copy link

I think thats the same problem as my initial bug ticket:
#2947
#3084
I still have not found any workaround for this.

@hediet hediet added bug Issue identified by VS Code Team member as probable bug editor-core labels Dec 13, 2022
@hediet hediet added this to the Backlog milestone Dec 13, 2022
@legends-killer
Copy link

same problem for me.
when I create multiple monaco instances and add different suggestions for them, they will be mixed up and some will show up multiple times.
It seems that all monaco instances will interact with each other, any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-core
Projects
None yet
Development

No branches or pull requests

4 participants