SuggestContext ignores 'lineContentAfter', fixes #4911

This commit is contained in:
Johannes Rieken 2016-12-28 10:31:58 +01:00
parent 58ab5ecdd9
commit f115502502

View file

@ -37,7 +37,6 @@ export class Context {
readonly isInEditableRange: boolean;
readonly lineContentBefore: string;
readonly lineContentAfter: string;
readonly wordBefore: string;
readonly wordAfter: string;
@ -57,10 +56,8 @@ export class Context {
this.lineNumber = position.lineNumber;
this.column = position.column;
this.lineContentBefore = lineContent.substr(0, position.column - 1);
this.lineContentAfter = lineContent.substr(position.column - 1);
this.isInEditableRange = true;
if (model.hasEditableRange()) {
const editableRange = model.getEditableRange();
@ -101,7 +98,7 @@ export class Context {
return true;
}
if (!startsWith(context.lineContentBefore, this.lineContentBefore) || this.lineContentAfter !== context.lineContentAfter) {
if (!startsWith(context.lineContentBefore, this.lineContentBefore)) {
// Line has changed before position
return true;
}
@ -115,7 +112,7 @@ export class Context {
}
shouldRetrigger(context: Context): boolean {
if (!startsWith(this.lineContentBefore, context.lineContentBefore) || this.lineContentAfter !== context.lineContentAfter) {
if (!startsWith(this.lineContentBefore, context.lineContentBefore)) {
// Doesn't look like the same line
return false;
}