File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export default class DefinitionAdapter {
74
74
if ( locationResult == null ) {
75
75
return null
76
76
}
77
- if ( this . isLocationLinkArray ( locationResult ) ) {
77
+ if ( isLocationLinkArray ( locationResult ) ) {
78
78
return locationResult . filter ( ( d ) => d . targetRange . start != null )
79
79
}
80
80
return ( Array . isArray ( locationResult ) ? locationResult : [ locationResult ] ) . filter ( ( d ) => d . range . start != null )
@@ -91,7 +91,7 @@ export default class DefinitionAdapter {
91
91
locations : Location [ ] | LocationLink [ ] ,
92
92
languageName : string
93
93
) : atomIde . Definition [ ] {
94
- if ( this . isLocationLinkArray ( locations ) ) {
94
+ if ( isLocationLinkArray ( locations ) ) {
95
95
return locations . map ( ( d ) => ( {
96
96
path : Convert . uriToPath ( d . targetUri ) ,
97
97
position : Convert . positionToPoint ( d . targetRange . start ) ,
@@ -106,7 +106,8 @@ export default class DefinitionAdapter {
106
106
language : languageName ,
107
107
} ) )
108
108
}
109
- private static isLocationLinkArray ( value : any ) : value is LocationLink [ ] {
110
- return Array . isArray ( value ) && value . every ( ( v ) => LocationLink . is ( v ) )
111
- }
109
+ }
110
+
111
+ function isLocationLinkArray ( value : any ) : value is LocationLink [ ] {
112
+ return Array . isArray ( value ) && LocationLink . is ( value [ 0 ] )
112
113
}
You can’t perform that action at this time.
0 commit comments