From 6ea532fd11056399220d138011b27fc886688fe6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 10 Dec 2023 11:05:34 +0000 Subject: [PATCH] Add example --- .github/CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 287a8ed5d..db6e55e0e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -34,12 +34,19 @@ See the main 3 visitors containing a method for each bit of syntax (e.g. for an * https://github.com/icsharpcode/CodeConverter/blob/master/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs * https://github.com/icsharpcode/CodeConverter/blob/master/CodeConverter/CSharp/ExpressionNodeVisitor.cs - There are some surrounding visitors which keep cross-cutting details out of the way of the main body of code. After conversion, the roslyn simplifier runs to tidy up the code, removing redundant qualification etc. Always try to understand the root problem and find the general place to apply a fix that covers or helps with related cases. Example here: https://github.com/icsharpcode/CodeConverter/issues/557 +### Example of finding where to put a breakpoint + +If you look at the syntax tree of the input code you can see the names of the problematic part. There will be a "Visit..." method for most syntax types. If one doesn't exist, just pick the next one up the tree, and step in from that point. +![image](https://github.com/icsharpcode/CodeConverter/assets/2490482/5ff25972-b795-447b-861f-1fe955ca4d3c) +(source: https://sharplab.io/#v2:DYLgbgRgNALiCGBnGUAmIDUAfACgVwmAEsBjAAgGFglEyBpAUwE8B3AewCdUA5eAWwYBYAFBkxZAMoFJACgCUI8UrIBxNgBU2ZANoAzIgDt4wYEwC6IvYeOmzIRcrFrNOiTAYAHC8O1vPdhzEAUQNUSQIRELCqGiA===) + +https://github.com/icsharpcode/CodeConverter/blob/0647b8d2056b1a7d0fc110290caff50b55cdc3f3/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs#L728-L737 + ## For documentation, prefer: * Anything process/project related to be visible on GitHub (e.g. these bullet points) * Anything code-related (i.e. why things are done a certain way, or broad overviews) to be xmldoc in the relevant part of code @@ -75,4 +82,4 @@ At the moment there's just a very small amount of first draft documentation. Con ## Roslyn versions -The core library and Visual Studio extension target the Roslyn version matching the oldest supported version of VS. This avoids introducing compatibility issues. If there are newer APIs needed though, we'll weigh up the pros and cons. \ No newline at end of file +The core library and Visual Studio extension target the Roslyn version matching the oldest supported version of VS. This avoids introducing compatibility issues. If there are newer APIs needed though, we'll weigh up the pros and cons.