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 picking default syntax for comments #14725

Merged
merged 1 commit into from Mar 21, 2022

Conversation

pikinier20
Copy link
Contributor

Recently, there was a PR merged that changed -comment-syntax setting in Scaladoc to PathBased. It introduced a small regression in our docs: https://dotty.epfl.ch/api/index.html. The problem was that when we didn't find an entry that matched the path, we were always using default syntax which is Markdown. What we actually need to do is try to find a fallback entry (one without path specified) and use its syntax. Only if there's no such entry, we should fall back to Markdown.

Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for fixing this! My only fear it that I am unsure if the original issue - the fact that despite 'docroot.txt' being in 'scala-library-src' it did not have the 'scala-library-src' syntax applied - was fixed.

@pikinier20
Copy link
Contributor Author

Looks great, thank you for fixing this! My only fear it that I am unsure if the original issue - the fact that despite 'docroot.txt' being in 'scala-library-src' it did not have the 'scala-library-src' syntax applied - was fixed.

The problem that you mentioned is related to different thing. This file is treated differently than other source files. Its content is read and then parsed in context of top-level package. The top-level package doesn't have corresponding source file. Therefore, the default syntax was picked.

@jchyb
Copy link
Contributor

jchyb commented Mar 21, 2022

Ah, makes sense. Thanks

@odersky odersky merged commit 58b59a5 into scala:main Mar 21, 2022
@odersky odersky deleted the scaladoc/comment-syntax-fix branch March 21, 2022 12:53
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants