-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maciek, I asked you on Discord to create missing issues and link them here as a reply to Adam, it is not done yet, so I'm requesting changes.
Sorry for not doing that, here it comes: |
…bump # Conflicts: # src/js/package-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see still one not-working case in the workaround provided by this PR:
## A function foo doing foo like this:
foo
Here the doc writer meant the second line to be intended, but we align the first line to the second.
I could accept this PR, as it is not a regression, but first confirm with @wdanilo that fixing that properly in the parser is impossible or too costly.
/// Fixes indentation in the first line of documentation by looking at next line, as documentation | ||
/// doesn't know what was its indentation in the Enso source file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extend this description. What does "looking at next line" mean? Do we adjust the first line to the second? What if there is only one line? What if documentation author meant the second line to be indented?
If we really need to put a workaround here (not in parser), then I'd rather put three spaces to the first line (an equivalent of ##
. Or maybe shall we put two spaces for ##
instead? I'm not sure, I don't know how parser works).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, putting fixed amount of spaces wont fix the issue.
Take a look at some enso code:
type foo
type bar
## docs here
docs there
type baz
We need to add the indentation of whole block plus the indent of 2 hashes - that is in this case 10 additional spaces, otherwise doc parser will get code like this:
docs here
docs there
and will create a synopsis with raw text "docs here" and code block of "docs there".
As we talked on dm, if there is only one line, there is no problem, it just wont do anything, and will work. If the next line is empty, there is still no problem, as what is in the next box will just become new paragraph, just as intended, in "body" section.
The only corner case is when the user specifically intends to make second line a code block, but that must be a really rare case, as i havent seen such in any doc in stdlib.
To sum up, this thing is really not a trivial fix as the doc code we get doesnt know anything about its origin, what was its indentation etc, hence the need to write such a hack. To be further discussed with @wdanilo but I dont see any other reasonable solution currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talk I've removed hack method, this PR wont fix indent in first line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix a changelog entry before merge. I would rather not mention that our fixes are "hot".
Co-authored-by: Adam Obuchowicz <[email protected]>
CHANGELOG.md
Outdated
@@ -16,6 +16,7 @@ read the notes of the `Enso 2.0.0-alpha.1` release. | |||
now on all supported platforms. | |||
- [You can now see data frames in the table visualisation][1181]. Big tables get truncated to 2000 | |||
entries. | |||
- [Fixing documentation layout in Searcher][1098]. Includes misinterpreted tags and unknown characters that are commonly used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changelog entries should be understandable to the end-users. Not all are perfect now, but this description "fixing documentation layout in Searcher" is not very understandable. Also, "fixing" means that it is being done, not done already, so its not a good form for a changelog. Can we describe here what was fixed and what kind of docs will be displayed better now ?
Original commit: enso-org/ide@4f82dcf
Pull Request Description
This PR bumps scala parser version to include latest commit to parser from engine repository, which fixes documentation tags, adds new tags according to specs as well as adds some of unavailable character, so that every doc in stdlib parses.
Important Notes
This PR wont solve issue with indent in first line, it will be fixed after updating AST.
Checklist
Please include the following checklist in your PR: