mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
SuggestContext ignores 'lineContentAfter', fixes #4911
This commit is contained in:
parent
58ab5ecdd9
commit
f115502502
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue