Skip to content

Commit

Permalink
[Rust] Add support for module comments (#4028)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncave authored Feb 5, 2025
1 parent e381f0a commit ffc6ee9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Fable.AST/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

* [All] Add support for module comments (by @ncave)

## 4.6.0 - 2025-01-28

* Stable release
Expand Down
1 change: 1 addition & 0 deletions src/Fable.AST/Fable.fs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ type ModuleDecl =
Name: string
Entity: EntityRef
Members: Declaration list
XmlDoc: string option
}

and Declaration =
Expand Down
1 change: 1 addition & 0 deletions src/Fable.Cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* [Python] - Print root module and module function comments (by @alfonsogarciacaro)
* [Rust] Add support for module comments (by @ncave)
* [Rust] Add support for null strings (by @ncave)

## 5.0.0-alpha.9 - 2025-01-28
Expand Down
1 change: 1 addition & 0 deletions src/Fable.Compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* [Python] - Print root module and module function comments (by @alfonsogarciacaro)
* [Rust] Add support for module comments (by @ncave)
* [Rust] Add support for null strings (by @ncave)

## 5.0.0-alpha.9 - 2025-01-28
Expand Down
1 change: 1 addition & 0 deletions src/Fable.Transforms/FSharp2Fable.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,7 @@ let rec private transformDeclarations (com: FableCompiler) ctx fsDecls =
Name = fsEnt.CompiledName
Entity = entRef
Members = members
XmlDoc = tryGetXmlDoc fsEnt.XmlDoc
}
]
| sub -> transformDeclarations com ctx sub
Expand Down
2 changes: 1 addition & 1 deletion src/Fable.Transforms/Rust/Fable2Rust.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5095,7 +5095,7 @@ module Util =
com.ClearAllImports(ctx)
useItem :: importItems

let outerAttrs = transformAttributes com ctx ent.Attributes None
let outerAttrs = transformAttributes com ctx ent.Attributes decl.XmlDoc
let innerAttrs = getInnerAttributes com ctx decl.Members
let attrs = innerAttrs @ outerAttrs
let modDecls = useDecls @ memberDecls
Expand Down

0 comments on commit ffc6ee9

Please sign in to comment.