forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for nested submodules to
forc doc
(FuelLabs#4333)
## Description Sort of hacky, but this PR fixes the support for nested submodules. I've opened FuelLabs#4371 as a follow up to fix this. It also fixes a bug I found while working on this, which was merging modules of the same name, even if they were in different folders. [Screencast from 2023-03-28 17-44-07.webm](https://user-images.githubusercontent.com/57543709/228384162-f94249db-66d8-42dd-9c77-33a31b633a8b.webm) ## Checklist - [x] I have linked to any relevant issues. Closes FuelLabs#3929 Closes FuelLabs#4370 - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
- Loading branch information
1 parent
123c9e7
commit 95cb67d
Showing
9 changed files
with
147 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
forc-plugins/forc-doc/src/tests/data/nested_subdirs/Forc.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[[package]] | ||
name = 'core' | ||
source = 'path+from-root-2E974E96B45CBA16' | ||
|
||
[[package]] | ||
name = 'nested_subdirs' | ||
source = 'member' | ||
dependencies = ['core'] |
8 changes: 8 additions & 0 deletions
8
forc-plugins/forc-doc/src/tests/data/nested_subdirs/Forc.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "lib.sw" | ||
license = "Apache-2.0" | ||
name = "nested_subdirs" | ||
|
||
[dependencies] | ||
core = { path = "../../../../../../sway-lib-core" } |
3 changes: 3 additions & 0 deletions
3
forc-plugins/forc-doc/src/tests/data/nested_subdirs/src/lib.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
library; | ||
|
||
mod sub_dir; |
3 changes: 3 additions & 0 deletions
3
forc-plugins/forc-doc/src/tests/data/nested_subdirs/src/sub_dir.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
library; | ||
|
||
mod folder; |
4 changes: 4 additions & 0 deletions
4
forc-plugins/forc-doc/src/tests/data/nested_subdirs/src/sub_dir/folder.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
library; | ||
|
||
mod lib_one; | ||
mod lib_two; |
5 changes: 5 additions & 0 deletions
5
forc-plugins/forc-doc/src/tests/data/nested_subdirs/src/sub_dir/folder/lib_one.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
library; | ||
|
||
pub struct Foo { | ||
foo: u32, | ||
} |
5 changes: 5 additions & 0 deletions
5
forc-plugins/forc-doc/src/tests/data/nested_subdirs/src/sub_dir/folder/lib_two.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
library; | ||
|
||
pub enum Bar { | ||
bar: u32, | ||
} |