This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tree = CSharpSyntaxTree.ParseText(@" | |
| public class MyClass { | |
| int Method1() { return 0; } | |
| void Method2() | |
| { | |
| int x = Method1(); | |
| } | |
| } | |
| }"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass | |
| { | |
| #region MyRegion | |
| #endregion | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tree = CSharpSyntaxTree.ParseText(@" | |
| public class MyClass{ | |
| #region MyRegion | |
| #endregion | |
| }"); | |
| //Try finding them as nodes. | |
| var regionNodes = tree.GetRoot().DescendantNodes().OfType<RegionDirectiveTriviaSyntax>(); | |
| //Try finding them as trivia? | |
| var regionTrivia = tree.GetRoot().DescendantTrivia().OfType<RegionDirectiveTriviaSyntax>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tree = CSharpSyntaxTree.ParseText(@" | |
| public class MyClass{ | |
| #region MyRegion | |
| #endregion | |
| }"); | |
| //Descend into all node children | |
| //Descend into all trivia children | |
| var regionNodes = tree.GetRoot().DescendantNodes(descendIntoChildren: null, descendIntoTrivia true).OfType<RegionDirectiveTriviaSyntax>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tree = CSharpSyntaxTree.ParseText(@" | |
| public class MyClass{ | |
| #region MyRegion | |
| #endregion | |
| }"); | |
| //Descend into all node children | |
| //Descend into all trivia children | |
| var regionNodes = tree.GetRoot().DescendantNodes(descendIntoChildren: null, descendIntoTrivia: true).OfType<RegionDirectiveTriviaSyntax>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass | |
| { | |
| #region MyRegion | |
| #endregion | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var outWindow = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; | |
| var debugPaneGuid = VSConstants.GUID_OutWindowGeneralPane; | |
| IVsOutputWindowPane pane; | |
| outWindow.GetPane(ref debugPaneGuid, out pane); | |
| IVsTextView view = pane as IVsTextView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass | |
| { | |
| int myField = 0; | |
| public int MyProperty {get; set;} | |
| public void MyMethod() { } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass | |
| { | |
| int myField = 0; | |
| public int MyProperty {get; set;} | |
| public void MyMethod() { } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass | |
| { | |
| int myField = 0; | |
| public int MyProperty {get; set;} | |
| public void MyMethod() { } | |
| } |