Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tools): get docstrings from module file #878

Merged
merged 4 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions analysis/src/DocExtraction.ml
Original file line number Diff line number Diff line change
Expand Up @@ -294,25 +294,25 @@ let extractDocs ~path ~debug =
let id =
(modulePath |> List.rev |> List.hd) ^ "." ^ item.name
in
let items =
let items, internalDocstrings =
match
ProcessCmt.fileForModule ~package:full.package
aliasToModule
with
| None -> []
| None -> ([], [])
| Some file ->
let docs =
extractDocsForModule ~modulePath:[id] file.structure
in
docs.items
(docs.items, docs.docstring)
in
Some
(ModuleAlias
{
id;
name = item.name;
items;
docstring = item.docstring |> List.map String.trim;
docstring = item.docstring @ internalDocstrings |> List.map String.trim;
})
| Module (Structure m) ->
(* module Whatever = {} in res or module Whatever: {} in resi. *)
Expand Down
4 changes: 4 additions & 0 deletions tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

## master

#### :bug: Bug Fix

- Fix docstrings for module alias. Get internal docstrings of module file. https://github.com/rescript-lang/rescript-vscode/pull/878

## 0.3.0

#### :rocket: New Feature
Expand Down