@@ -68,11 +68,15 @@ export default class DefinitionAdapter {
68
68
* @param locationResult Either a single {Location} object or an {Array} of {Locations}.
69
69
* @returns An {Array} of {Location}s or {null} if the locationResult was null.
70
70
*/
71
- public static normalizeLocations ( locationResult : Location | ( Location | LocationLink ) [ ] ) : ( Location | LocationLink ) [ ] | null {
71
+ public static normalizeLocations (
72
+ locationResult : Location | ( Location | LocationLink ) [ ]
73
+ ) : ( Location | LocationLink ) [ ] | null {
72
74
if ( locationResult == null ) {
73
75
return null
74
76
}
75
- return ( Array . isArray ( locationResult ) ? locationResult : [ locationResult ] ) . filter ( ( d ) => ( 'range' in d ?d . range :d . targetRange ) . start != null )
77
+ return ( Array . isArray ( locationResult ) ? locationResult : [ locationResult ] ) . filter (
78
+ ( d ) => ( "range" in d ? d . range : d . targetRange ) . start != null
79
+ )
76
80
}
77
81
78
82
/**
@@ -82,11 +86,14 @@ export default class DefinitionAdapter {
82
86
* @param languageName The name of the language these objects are written in.
83
87
* @returns An {Array} of {Definition}s that represented the converted {Location}s.
84
88
*/
85
- public static convertLocationsToDefinitions ( locations : ( Location | LocationLink ) [ ] , languageName : string ) : atomIde . Definition [ ] {
89
+ public static convertLocationsToDefinitions (
90
+ locations : ( Location | LocationLink ) [ ] ,
91
+ languageName : string
92
+ ) : atomIde . Definition [ ] {
86
93
return locations . map ( ( d ) => ( {
87
- path : Convert . uriToPath ( ' uri' in d ? d . uri : d . targetUri ) ,
88
- position : Convert . positionToPoint ( ( ' range' in d ? d . range : d . targetRange ) . start ) ,
89
- range : Range . fromObject ( Convert . lsRangeToAtomRange ( ' range' in d ? d . range : d . targetRange ) ) ,
94
+ path : Convert . uriToPath ( " uri" in d ? d . uri : d . targetUri ) ,
95
+ position : Convert . positionToPoint ( ( " range" in d ? d . range : d . targetRange ) . start ) ,
96
+ range : Range . fromObject ( Convert . lsRangeToAtomRange ( " range" in d ? d . range : d . targetRange ) ) ,
90
97
language : languageName ,
91
98
} ) )
92
99
}
0 commit comments