You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isNewIdentifierLocation is always set to true inside function call #25691
Bug
The completionInfo request seems to always return isNewIdentifierLocation when inside a function call such as:
console.log(c|)
Expected behavior:
I believe that isNewIdentifierLocation should only be returned when the user is starting to write a arrow function with a parenthesized parameter list, such as:
Andy (Andrewkraft) (@Andy-MS) One case we are interested in here is whether to enable accepting completions on , or not. I think , should commit for c| when the user is going to type c => c + 1 but not for (c|) in (c) => c + 1
I think we could do this with the extra information you are proposing
The bug is still present in TypeScript 3.2.2. It's quite annoying, because in all IDEs, the autocomplete match doesn't get inserted in situation where you would expect it to be inserted.
I think the value of isNewIdentifierLocation should depend upon whether an arrow function is valid at the current location. For example:
function demo(a:number, b:(x:number) => void)
{
}
demo(a| // an arrow function isn't valid here, isNewIdentifierLocation should be false
demo(a, b| // an arrow function is valid here, isNewIdentifierLocation should be true
Activity
mjbvz commentedon Jul 16, 2018
Andy (Andrewkraft) (@Andy-MS) One case we are interested in here is whether to enable accepting completions on
,or not. I think,should commit forc|when the user is going to typec => c + 1but not for(c|)in(c) => c + 1I think we could do this with the extra information you are proposing
highco commentedon Jan 14, 2019
The bug is still present in TypeScript 3.2.2. It's quite annoying, because in all IDEs, the autocomplete match doesn't get inserted in situation where you would expect it to be inserted.
I think the value of
isNewIdentifierLocationshould depend upon whether an arrow function is valid at the current location. For example: