Skip to content

Commit 6b38b93

Browse files
committed
fix: type of normalizeLocations and convertLocationsToDefinitions
1 parent e45d0f2 commit 6b38b93

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/adapters/definition-adapter.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ export default class DefinitionAdapter {
6969
* @returns An {Array} of {Location}s or {null} if the locationResult was null.
7070
*/
7171
public static normalizeLocations(
72-
locationResult: Location | (Location | LocationLink)[]
73-
): (Location | LocationLink)[] | null {
72+
locationResult: Location | Location[] | LocationLink[] | null
73+
): Location[] | LocationLink[] | null {
7474
if (locationResult == null) {
7575
return null
7676
}
77-
return (Array.isArray(locationResult) ? locationResult : [locationResult]).filter(
78-
(d) => ("range" in d ? d.range : d.targetRange).start != null
77+
return (Array.isArray(locationResult) ? locationResult as any[] : [locationResult]).filter(
78+
(d: Location | LocationLink) => ("range" in d ? d.range : d.targetRange).start != null
7979
)
8080
}
8181

@@ -87,10 +87,10 @@ export default class DefinitionAdapter {
8787
* @returns An {Array} of {Definition}s that represented the converted {Location}s.
8888
*/
8989
public static convertLocationsToDefinitions(
90-
locations: (Location | LocationLink)[],
90+
locations: Location[] | LocationLink[],
9191
languageName: string
9292
): atomIde.Definition[] {
93-
return locations.map((d) => ({
93+
return (locations as any[]).map((d: Location | LocationLink) => ({
9494
path: Convert.uriToPath("uri" in d ? d.uri : d.targetUri),
9595
position: Convert.positionToPoint(("range" in d ? d.range : d.targetRange).start),
9696
range: Range.fromObject(Convert.lsRangeToAtomRange("range" in d ? d.range : d.targetRange)),

0 commit comments

Comments
 (0)