Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //var topPanel = panel.clear().add_Panel();
- var topPanel = "Simple AstTester".popupWindow(700,300);
- var codeViewer = topPanel.title("Code").add_SourceCodeViewer();
- var errorsList = topPanel.insert_Right(300,"AstTree Errors").add_TextArea();
- Action<string> showErrors =
- (newCode)=>{
- codeViewer.editor().clearBookmarksAndMarkers();
- var astTree = newCode.tree();
- var errors = astTree.errors();
- foreach(var error in errors)
- {
- var startLinePosition = error.Location
- .GetLineSpan(true)
- .StartLinePosition;
- codeViewer.editor().setSelectedText(startLinePosition.Line +1,
- startLinePosition.Character,
- true);
- }
- errorsList.set_Text(astTree.errors_Details());
- };
- var code =
- @"var a = 12;
- this is an error
- string b = 333;
- aaaaaa-
- class test
- {
- public methodWithNoReturnType()
- {}
- }";
- codeViewer.onTextChange(showErrors)
- .set_Text(code,".cs");
- return "ok";
- //O2Ref:O2_FluentSharp_Roslyn.dll
- //O2Ref:Roslyn.Compilers.CSharp.dll
- //O2Ref:Roslyn.Compilers.dll
Add Comment
Please, Sign In to add comment