-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Ignore leading whitespace before md comments #16
Comments
Ok, great suggestion. Taking it in the works. |
I started to fix this for you and drop a PR but I ran into an issue where I can't compile locally because of this error:
I think this means I don't have the same version of the SDK that you are using. Can you tell me what versions I need installed locally to compile this extension? |
Looking... |
@MarkEwer Are you using dotnet CLI tool or the VSIX extension? |
I prefer the integrated compiler, but neither are working for me. I'm sure that I am doing something wrong. What version of VS and what version of the VS-SDK are you using? |
Ok. Strange. Checking... |
if you just open the help->about page and tell me what version number of VS and the SDK you are using I can get the same ones and it should fix my issue. |
@MarkEwer I am using the CsToMd as a CLI tool in VSCode. I have installed the VS Community and checking what's happenning there. |
@MarkEwer I have updated the solution and the VSIX extension to the VS 2022+. |
//md
is used
Situation:
When adding markdown comments to unit tests I am adding markdown comments between each of the tests to add documentation context to the output file. If I then use the automatic source code formatter in Visual Studio, it will indent the lines that have markdown comments, and this parser then fails to recognize the line's intention.
Suggestion:
When attempting to parse each line looking for markdown control comments, we should trim any initial whitespace from the line. Considering that whitespace to be non-significant would mean the automatic code formatting features could work as normal.
Example:
Here is a sample unit test that successfully generates a markdown output for documentation. Notice that all of the markdown comments are at the left margin.
The problem arises when you press
CTRL+K,D
in Visual Studio to trigger the automatic code formatting. When this happens, it assumes that all comments should be indented to the same level as the source code it is mixed into. Indention of these comments means that the CsToMd parser does not recognize them.The text was updated successfully, but these errors were encountered: