Skip to content

Commit 7213157

Browse files
author
Ilya Golovin
committed
feat: add 'disableMethodSnippets.functionArguments'
fixes #142
1 parent a92972a commit 7213157

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/configurationType.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ export type Configuration = {
440440
* @default true
441441
*/
442442
'disableMethodSnippets.jsxAttributes': boolean
443+
/**
444+
* disable method snippets at function arguments
445+
* @default true
446+
*/
447+
'disableMethodSnippets.functionArguments': boolean
443448
/**
444449
* Support `@ts-diagnostic-disable` top-level comment for disabling specific semantic diagnostics
445450
* Example: `// @ts-diagnostic-disable

typescript/src/completions/isGoodPositionMethodCompletion.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const isGoodPositionMethodCompletion = (sourceFile: ts.SourceFile, positi
2626
if (ts.isObjectBindingPattern(currentNode) || ts.isObjectLiteralExpression(currentNode)) return false
2727
if (ts.isJsxAttributes(currentNode) || ts.isJsxAttribute(currentNode)) return false
2828
if (c('disableMethodSnippets.jsxAttributes') && ts.isJsxExpression(currentNode)) return false
29+
if (c('disableMethodSnippets.functionArguments') && ts.isCallExpression(currentNode) && position > currentNode.expression.end) return false
2930
}
3031
return true
3132
}

0 commit comments

Comments
 (0)