Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 491871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T02:03:18+00:00 2026-05-13T02:03:18+00:00

In case my initial approach is wrong, here’s what I’m trying to accomplish. I

  • 0

In case my initial approach is wrong, here’s what I’m trying to accomplish. I want to be able to recognize snippets of text in my code editor (I’m using C#, but that shouldn’t matter) and change the way they are formatted. Perhaps use different colors or fonts, etc. I started off thinking this would be as easy as popping a regular expression into a config file somewhere and setting some defaults… not so much.

I’ve so far identified two potential ways to do this, the first is by creating a new Language Service for Visual Studio. I don’t think this makes sense because I’m really only augmenting the default C# lex & parse.

The second is by How to: Create Custom Text Markers. This seems better, because if I’m reading it correctly this will allow me to create my own rules for recognizing sections of text (regex, etc) in the IDE and add Text Markers based on that. Those will then be exposed in the Options -> Environment -> Fonts and Colors area in Visual Studio Options (similar to ReSharper Overrides, ReSharper DeadCode, etc.).

Assuming the Custom Text Markers route is the way to go, and I’m open to other ideas, I need to implement the IVsPackageDefinedTextMarkerType interface and implement the GetTextMarkerType method. Sounds pretty straight forward…

I then need to “proffer [my] marker type as a service”, this is where I get a little lost. There is an example of creating a custom service in the Visual Studio SDK, but I can’t figure out how to tie the two together. I’ve still got a lot of research to do on this topic, so I may answer my own question, but it’d be nice if someone could save me some time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T02:03:19+00:00Added an answer on May 13, 2026 at 2:03 am

    I believe that the following projects use custom text markers. They might give you some ideas:

    • http://snippetdesigner.codeplex.com/
    • http://clonedetectivevs.codeplex.com
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Case i'm trying to write a GWTTestCase for a certain class, used as a
Case with bootstrap: Example code function( $ ){ }( window.jQuery );
Simple case of trying to prove I can convert NSString to NSDate . Create
I want to set my WPF window's initial client size. I'm not seeing a
Assume that I want to draw samples from some probability distribution. In the case
According to Initial POCO Design 1-Pager Persistence Ignorance refers to being able to allow
I have a simple use case where I want to grab a session variable
I want to know the best way to implement this (approach). I will bee
Case in point : I've got a handle to a window (for instance, using
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.