locked
C# syntax highlighter and parsing RRS feed

  • Question

  • Hello,

    I'm currently trying to create my first extension and I wonder if I need to create a parser to highlight parts of the code or there's already something that I can use ?

    Here is a simple example, now I can build up and create a parser that parses the text in the same way but I wonder if it's the right thing to do ?

    foreach (var span in spans)
    			{
    				if (span.GetText().Contains("class"))
    				{
    					yield return new TagSpan<ClassificationTag>(span, new ClassificationTag(_classificationType));
    				}
    			}

    Any kind of guidance is well appreciated.


    Eyal, Regards.

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler.

    Visual Studio Command Browser 2.0 CodeVolume.Presenters
    Thursday, December 16, 2010 7:28 PM

Answers

  • Well, I guess I found the answer.

    http://blogs.msdn.com/b/noahric/archive/2010/07/13/q-amp-a-itextsnapshot-gettext.aspx


    Eyal, Regards.

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler.

    Visual Studio Command Browser 2.0 CodeVolume.Presenters
    • Marked as answer by Victor_Chen Monday, December 20, 2010 6:39 AM
    Friday, December 17, 2010 8:47 AM

All replies

  • Well, I guess I found the answer.

    http://blogs.msdn.com/b/noahric/archive/2010/07/13/q-amp-a-itextsnapshot-gettext.aspx


    Eyal, Regards.

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler.

    Visual Studio Command Browser 2.0 CodeVolume.Presenters
    • Marked as answer by Victor_Chen Monday, December 20, 2010 6:39 AM
    Friday, December 17, 2010 8:47 AM
  •  Hi Eyal,

     

    I'm glad to know it is resolved.

    Thanks for sharing.

     

    Best Regards,

    Ziwei Chen


    Ziwei Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 20, 2010 6:32 AM