-
Notifications
You must be signed in to change notification settings - Fork 97
Fix documentation (or source) link when html file is less specific than module #766
Fix documentation (or source) link when html file is less specific than module #766
Conversation
Thanks for your contribution! I note that this feature lacks a test suite, and therefore it's very hard to tell whether the changes you propose break anything, in any of the supported platforms and build tools. Would you be able to contribute such a test suite? Ideally it would cover projects using both cabal and stack, and our CI system will take care of running both in Windows and LInux |
This approach is not correct, strictly speaking. Instead of stripping out the last part of the module name (which has no relation with the module that actually exports the documentation for the symbol), a better idea would be to look in the |
Should be fine now as a plaster, but it would be nice to do it the proper way at some point as well as what @wz1000 said Lines 2171 to 2177 in 0d7cae9
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@wz1000 This is probably neither the ultimate solution. The "NormalizedFilePath" from the original screenshot is imported from local module "Development.IDE.Types.Location" - not module from the package for which haddock file exists (confirmed it by looking up the import decl in One counter-example is Overall, trying to replicate Haddock's logic feels wrong, it might be better to start from the opposite end e.g. parse doc-index.json to pinpoint exact location and anchor (unless there's any simpler api to parse Haddock index available - I don't know any) |
…an module (haskell#766) * show doc/source link when html file name is less specific than module name * try most qualified file names first, both dash and dot delimited * small cleanup * make hlint happy * hlint again
…an module (haskell/ghcide#766) * show doc/source link when html file name is less specific than module name * try most qualified file names first, both dash and dot delimited * small cleanup * make hlint happy * hlint again
…an module (haskell/ghcide#766) * show doc/source link when html file name is less specific than module name * try most qualified file names first, both dash and dot delimited * small cleanup * make hlint happy * hlint again
…an module (haskell/ghcide#766) * show doc/source link when html file name is less specific than module name * try most qualified file names first, both dash and dot delimited * small cleanup * make hlint happy * hlint again
Below is an example when documentation is available but wasn't located because file name is less specific than module. This PR fixes it
Documentation:
Note the difference in doc file name and module name.
Source:
In this case both src and module name are the same.
Other notes: