From e4f3ab555b35a0057d22dcc8bb7b7af7e43546d6 Mon Sep 17 00:00:00 2001 From: Duc Nghiem Xuan Date: Thu, 20 Aug 2020 21:17:04 +0900 Subject: [PATCH] Don't include this function types in completeFunctionCall (#195) --- src/server/utils/completionItem.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/utils/completionItem.ts b/src/server/utils/completionItem.ts index b6b3ef3..f12c142 100644 --- a/src/server/utils/completionItem.ts +++ b/src/server/utils/completionItem.ts @@ -211,7 +211,9 @@ export function getParameterListParts( const next = displayParts[i + 1] // Skip optional parameters const nameIsFollowedByOptionalIndicator = next && next.text === '?' - if (!nameIsFollowedByOptionalIndicator) { + // Skip this parameter + const nameIsThis = part.text === 'this' + if (!nameIsFollowedByOptionalIndicator && !nameIsThis) { parts.push(part) } hasOptionalParameters = hasOptionalParameters || nameIsFollowedByOptionalIndicator