File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
packages/mongodb-ts-autocomplete/src/cdt-analyser Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -38,22 +38,6 @@ function evaluateNode(node: ts.Node): any {
3838 return null ;
3939}
4040
41- function findMethodCallNodeAtPosition (
42- node : ts . Node ,
43- caret : number
44- ) : ts . CallExpression | undefined {
45- if ( ts . isCallExpression ( node ) ) {
46- const methodName = node . expression ;
47- if ( ts . isPropertyAccessExpression ( methodName ) && node . getEnd ( ) >= caret ) {
48- return node ;
49- }
50- }
51-
52- return node . forEachChild ( ( child ) =>
53- findMethodCallNodeAtPosition ( child , caret )
54- ) ;
55- }
56-
5741const QUERY_METHODS = [ 'aggregate' , 'find' , 'findOne' ] ;
5842
5943export function inferCollectionNameFromFunctionCall (
@@ -126,7 +110,7 @@ export function extractPipelineUptoCaret(
126110
127111 function findArrayLiteralExpression (
128112 node : ts . Node ,
129- inArray : boolean = false
113+ inArray = false
130114 ) : ts . ArrayLiteralExpression | undefined {
131115 if ( ts . isArrayLiteralExpression ( node ) && inArray ) {
132116 return node ;
@@ -156,7 +140,7 @@ export function extractPipelineUptoCaret(
156140 return elementsBeforeCaret ;
157141 }
158142
159- return null ;
143+ return [ ] ;
160144}
161145
162146export function extractPipelineFromLastAggregate (
You can’t perform that action at this time.
0 commit comments