Skip to content

Commit

Permalink
Fix #57380
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Sep 17, 2018
1 parent dde08a9 commit 2f73a6d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
pointer-events: none;
margin-top: 2px;
margin-left: 1px;
}
}

.suggest-input-container .monaco-editor .suggest-widget.no-icons .monaco-list .icon {
display: none;

This comment has been minimized.

Copy link
@ramya-rao-a

ramya-rao-a Sep 17, 2018

Contributor

@roblourens I would suggest to have this in suggest.css instead. The iconsInSuggestions is read by the suggest widget and it adds the no-icons class as well. It follows that the css rule should live in the suggest widget as well

This comment has been minimized.

Copy link
@roblourens

roblourens Sep 17, 2018

Author Member

Did you see my comment in the issue?

This comment has been minimized.

Copy link
@ramya-rao-a

ramya-rao-a Sep 17, 2018

Contributor

Oops, I'll comment there

}
39 changes: 25 additions & 14 deletions src/vs/workbench/parts/codeEditor/browser/suggestEnabledInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,16 @@ export class SuggestEnabledInput extends Widget implements IThemable {
this.stylingContainer = append(parent, $('.suggest-input-container'));
this.placeholderText = append(this.stylingContainer, $('.suggest-input-placeholder', null, options.placeholderText || ''));

const editorOptions: IEditorOptions = {
...getSimpleEditorOptions(),
...getHTMLInputStyleOptions(ariaLabel),
...{
iconsInSuggestions: false

This comment has been minimized.

Copy link
@ramya-rao-a

ramya-rao-a Sep 17, 2018

Contributor

@roblourens Just curious... why set iconsInSuggestions here instead of inside getHTMLInputStyleOptions ?

This comment has been minimized.

Copy link
@roblourens

roblourens Sep 17, 2018

Author Member

It just doesn't seem like an html input style option

This comment has been minimized.

Copy link
@ramya-rao-a

ramya-rao-a Sep 17, 2018

Contributor

Neither does snippetSuggestions or suggest: {filterGraceful}

This comment has been minimized.

Copy link
@roblourens

roblourens Sep 17, 2018

Author Member

True. I refactored it.

}
};

this.inputWidget = instantiationService.createInstance(CodeEditorWidget, this.stylingContainer,
mixinHTMLInputStyleOptions(getSimpleEditorOptions(), ariaLabel),
editorOptions,
{
contributions: [SuggestController, SnippetController2, ContextMenuController, MenuPreventer],
isSimpleWidget: true,
Expand Down Expand Up @@ -244,17 +252,20 @@ export class SuggestEnabledInput extends Widget implements IThemable {
}


function mixinHTMLInputStyleOptions(config: IEditorOptions, ariaLabel?: string): IEditorOptions {
config.fontSize = 13;
config.lineHeight = 22;
config.wordWrap = 'off';
config.scrollbar.vertical = 'hidden';
config.roundedSelection = false;
config.ariaLabel = ariaLabel || '';
config.renderIndentGuides = false;
config.cursorWidth = 1;
config.snippetSuggestions = 'none';
config.suggest = { filterGraceful: false };
config.fontFamily = ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif';
return config;
function getHTMLInputStyleOptions(ariaLabel?: string): IEditorOptions {
return <IEditorOptions>{
fontSize: 13,
lineHeight: 22,
wordWrap: 'off',
scrollbar: {
vertical: 'hidden',
},
roundedSelection: false,
ariaLabel: ariaLabel || '',
renderIndentGuides: false,
cursorWidth: 1,
snippetSuggestions: 'none',
suggest: { filterGraceful: false },
fontFamily: ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif',
};
}

0 comments on commit 2f73a6d

Please sign in to comment.