@@ -722,7 +722,8 @@ fileModuleSpec:
722722 | opt_attributes opt_declVisibility moduleIntro moduleSpfnsPossiblyEmptyBlock
723723 { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2))
724724 let m2 = rhs parseState 3
725- let m = (rhs2 parseState 1 4)
725+ let mDeclsAndAttrs = (List.map (fun (a: SynAttributeList) -> a.Range) $1) @ (List.map (fun (d: SynModuleSigDecl) -> d.Range) $4)
726+ let m = (m2, mDeclsAndAttrs) ||> unionRangeWithListBy id
726727 let isRec, path2, xml, vis = $3
727728 (fun (isRec2, path, _) ->
728729 if not (isNil path) then errorR(Error(FSComp.SR.parsNamespaceOrModuleNotBoth(), m2))
@@ -1156,7 +1157,8 @@ fileModuleImpl:
11561157 | opt_attributes opt_declVisibility moduleIntro moduleDefnsOrExprPossiblyEmptyOrBlock
11571158 { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2))
11581159 let m2 = rhs parseState 3
1159- let m = (m2, $4) ||> unionRangeWithListBy (fun modu -> modu.Range)
1160+ let mDeclsAndAttrs = (List.map (fun (a: SynAttributeList) -> a.Range) $1) @ (List.map (fun (d: SynModuleDecl) -> d.Range) $4)
1161+ let m = (m2, mDeclsAndAttrs) ||> unionRangeWithListBy id
11601162 let isRec2, path2, xml, vis = $3
11611163 (fun (isRec, path, _) ->
11621164 if not (isNil path) then errorR(Error(FSComp.SR.parsNamespaceOrModuleNotBoth(), m2))
0 commit comments