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

[editor] annoying auto-suggestion when writing comments #5227

Closed
vince-fugnitto opened this issue May 23, 2019 · 11 comments
Closed

[editor] annoying auto-suggestion when writing comments #5227

vince-fugnitto opened this issue May 23, 2019 · 11 comments
Assignees
Labels
bug bugs found in the application editor issues related to the editor help wanted issues meant to be picked up, require help monaco issues related to monaco

Comments

@vince-fugnitto
Copy link
Member

Description

There is an annoying auto-suggestion feature when writing comments.
I do not expect suggestions when writing comments as it is intrusive to the experience.

bug

In comparison, here's vscode:

vscode

@vince-fugnitto vince-fugnitto added bug bugs found in the application editor issues related to the editor labels May 23, 2019
@akosyakov akosyakov added the help wanted issues meant to be picked up, require help label May 27, 2019
@sauny
Copy link
Contributor

sauny commented Jun 23, 2019

Have been looking into this and from what I can see the problem is within packages/monaco/src/browser/monaco-snippet-suggest-provider.ts. I can intercept when the snippets are provided but I am having difficulty working out if it is within a comment block. The only feasible way I can see to do this is to the class name of the div what is being written... any other ideas?

@vince-fugnitto
Copy link
Member Author

@sauny I took a look at the hint you provided and saw that provideCompletionItems is the one that provides the snippets from the bug.

https://github.com/theia-ide/theia/blob/c8dc1398fe1c9427f2d28b3c16049eeab8f6cb80/packages/monaco/src/browser/monaco-snippet-suggest-provider.ts#L30

For test purposes updating the code to return [] fixed the bug. I'm not entirely sure what the method is used for, since without it I am still getting proper snippets.

@vince-fugnitto
Copy link
Member Author

@sauny I wonder if we can detect when we have a comment and not provide the snippet help.

@sauny
Copy link
Contributor

sauny commented Jun 28, 2019

@vince-fugnitto I thought that, the comments get registered in the grammar-contribution files but I see nowhere where they get used. If I can work out where theia decides to set the CSS for comments, I should be able to set something to say it is in comment mode... but I can't find a way to do it....

@vince-fugnitto
Copy link
Member Author

@vince-fugnitto I thought that, the comments get registered in the grammar-contribution files but I see nowhere where they get used. If I can work out where theia decides to set the CSS for comments, I should be able to set something to say it is in comment mode... but I can't find a way to do it....

I don't quite understand what you mean about the CSS suggestion.

@sauny
Copy link
Contributor

sauny commented Jul 9, 2019

I meant the Monaco editor sets the css for a comment (it goes green). But I can't work out where that happens.

@BroKun
Copy link
Member

BroKun commented Aug 7, 2019

I noticed this problem, it is caused by the configuration of monaco.

// type in monaco editor
quickSuggestions?: boolean | {
	other: boolean;
	comments: boolean;
	strings: boolean;
};
// editor preference
'editor.quickSuggestions': {
       'type': 'boolean',
       'default': true,
       'description': 'Enable quick suggestions (shadow suggestions)'
},

The value True means you will see suggestions anywhere.
We should not display suggestions by default in string and comment, just like vscode.

@BroKun BroKun added the monaco issues related to monaco label Aug 7, 2019
@akosyakov
Copy link
Member

@BroKun can you handle it please? Please could you also reference a corresponding default configuration in VS Code, just to check that it is so.

@BroKun
Copy link
Member

BroKun commented Aug 7, 2019

@BroKun can you handle it please? Please could you also reference a corresponding default configuration in VS Code, just to check that it is so.

Yes, I am doing this.
And I found that there is another problem, we need to pass the object that can be rewritten to monaco, especially when updating the configuration, but now the preferrenceService provides read-only objects.
I will solve this problem first, but it is better if the preferenceService can support it. Maybe I should open another issue.

@BroKun BroKun self-assigned this Aug 7, 2019
BroKun added a commit to BroKun/theia that referenced this issue Aug 7, 2019
BroKun added a commit to BroKun/theia that referenced this issue Aug 18, 2019
@BroKun
Copy link
Member

BroKun commented Sep 16, 2019

@vince-fugnitto This seems to have been resolved after #5931 and Monaco upgraded to 0.17.0.

@vince-fugnitto
Copy link
Member Author

@vince-fugnitto This seems to have been resolved after #5931 and Monaco upgraded to 0.17.0.

I forgot to close, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application editor issues related to the editor help wanted issues meant to be picked up, require help monaco issues related to monaco
Projects
None yet
Development

No branches or pull requests

4 participants