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 {
38
38
return null ;
39
39
}
40
40
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
-
57
41
const QUERY_METHODS = [ 'aggregate' , 'find' , 'findOne' ] ;
58
42
59
43
export function inferCollectionNameFromFunctionCall (
@@ -126,7 +110,7 @@ export function extractPipelineUptoCaret(
126
110
127
111
function findArrayLiteralExpression (
128
112
node : ts . Node ,
129
- inArray : boolean = false
113
+ inArray = false
130
114
) : ts . ArrayLiteralExpression | undefined {
131
115
if ( ts . isArrayLiteralExpression ( node ) && inArray ) {
132
116
return node ;
@@ -156,7 +140,7 @@ export function extractPipelineUptoCaret(
156
140
return elementsBeforeCaret ;
157
141
}
158
142
159
- return null ;
143
+ return [ ] ;
160
144
}
161
145
162
146
export function extractPipelineFromLastAggregate (
You can’t perform that action at this time.
0 commit comments