-
Notifications
You must be signed in to change notification settings - Fork 35
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
code-action: TOC improvements #22
Conversation
Otherwise they're not interpreted as nested lists and not rendered correctly in, say, HTML
For example, after YAML frontmatter, after first title Additionally, correctly render TOCs that start from a heading of size different to 1
@keynmol I checked out locally to try things out. I think something got lost during rebase, as all this insertion logic from CodeActions.fs is not wired into Server.fs and is used only inside tests. |
@artempyanykh This should be ready for review/another manual test |
@keynmol could you rebase on the latest main please? |
Done |
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.
Thanks for pushing this through! I left a few comments, but nothing critical.
>> Log.addContext "text" rendered | ||
) | ||
|
||
let isEmpty lineNumber = document.text.LineContent(lineNumber).Trim().Length.Equals(0) |
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.
nit: Lenth.Equals(0)
-> IsEmpty
?
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 type 'String' does not define the field, constructor or member 'IsEmpty'
Do I need to open anything or bribe someone to get it?
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.
System.String.IsNullOrEmpty
. This is a bit ridiculous though. We should add an extension method to String
at some point.
|
||
let modifiedText = applyDocumentAction doc action | ||
|
||
let expected = |
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.
nit: I'm not sure whether it'll be better in this case, but you could try snapshot tests here to avoid manually typing all these expected doc contents.
I'd rather merge as is (as long as it doesn't lines repeatedly), and then add this case to the tests with some other testing infra improvements |
Closes #19
TODO