diff --git a/src/vs/editor/common/model/indentationGuesser.ts b/src/vs/editor/common/model/indentationGuesser.ts index dcd244fc0ac75d349ba0934e70715b68d004944a..9cdf6eccee3bf0d702df04ac1839956bff9a4ddd 100644 --- a/src/vs/editor/common/model/indentationGuesser.ts +++ b/src/vs/editor/common/model/indentationGuesser.ts @@ -15,8 +15,8 @@ const __tab = '\t'.charCodeAt(0); function spacesDiff(a:string, aLength:number, b:string, bLength:number): number { // This can go both ways (e.g.): - // - previousLineIndentation: "\t\t" - // - currentLineIndentation: "\t " + // - a: "\t\t" + // - b: "\t " // => This should count 1 tab and 4 spaces let result = 0; @@ -55,11 +55,6 @@ function spacesDiff(a:string, aLength:number, b:string, bLength:number): number } } - // // Ignore space if it occurs exactly once - // if (result === 1) { - // result = 0; - // } - return result; } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index b8e96d5483b41a4fa53aa22f27c6ad2671552cc8..12812d7735962632857d42c194f3a12a41bab5f9 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -25,6 +25,7 @@ import {ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWi import {CONTEXT_SUGGESTION_SUPPORTS_ACCEPT_ON_KEY, SuggestRegistry} from '../common/suggest'; import {CompletionItem, CompletionModel} from './completionModel'; import {ICancelEvent, ISuggestEvent, ITriggerEvent, SuggestModel} from './suggestModel'; +import {alert} from 'vs/base/browser/ui/aria/aria'; interface ISuggestionTemplateData { root: HTMLElement; @@ -75,7 +76,7 @@ class Renderer implements IRenderer { const data = templateData; const suggestion = (element).suggestion; - data.root.setAttribute('aria-label', suggestion.label); + data.root.setAttribute('aria-label', nls.localize('suggestionAriaLabel', "{0}, suggestion", suggestion.label)); if (suggestion.type && suggestion.type.charAt(0) === '#') { data.icon.className = 'icon customcolor'; data.colorspan.style.backgroundColor = suggestion.type.substring(1); @@ -363,6 +364,8 @@ export class SuggestWidget implements IContentWidget, IDisposable { const overwriteAfter = (typeof item.suggestion.overwriteAfter === 'undefined') ? 0 : Math.max(0, item.suggestion.overwriteAfter); this.model.accept(item.suggestion, overwriteBefore, overwriteAfter); + alert(nls.localize('suggestionAriaAccepted', "{0}, suggestion accepted", item.suggestion.label)); + this.editor.focus(); }, 0); }