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 8176969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:23:12+00:00 2026-06-06T23:23:12+00:00

Eclipse (at least when using Java) has the feature to auto highlight all lines

  • 0

Eclipse (at least when using Java) has the feature to auto highlight all lines in a method where method returns when I place cursor on return type in method definition.
Is there also such a feature for C# in Visual Studio + ReSharper 5.1.3?

Code example

string Do()
{
  if(/**/)
    return ""; // here

  if(/**/)
    return "1"; // here

  if(/**/)
    return "2"; // here

  throw new Exception(""); // here
 }

When I place cursor on word string in first line of this example the lines marked with // here should be highlighted.

  • 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-06-06T23:23:13+00:00Added an answer on June 6, 2026 at 11:23 pm

    It looks like the VS2010 extension called Linguist will do close to what you’d like. It can do customized highlighting for any regular expression. It doesn’t appear to be able to change it based on your cursor location though.

    More information for the extension can be viewed at the github page.

    There is no GUI for the settings. Instead there are settings files %LOCALAPPDATA%\Linguist in that you configure.

    Since I already have my syntax highlighting the way I’d like it to be with Resharper, I removed all the formatting from the Styles.field file in the standard subdirectory. If you do this you need to leave in all the names though, so it will look similar to:

    Styles.field

    # If new elements are added (or old ones removed) then Definitons.cs
    # and Languages.Init have to be updated.
    Name: attribute
    
    Name: command
    
    Name: comment
    
    <<< keep all the names in this file, just remove formatting >>>
    

    You will need to set up one of the named styles to use for highlighting. I did:

    Name: emphasis
    BackColor: Red
    

    And then I made a file called custom.lang (but you can name yours anything with the .lang extension) in the custom subdirectory. and this is what I did for highlighting return statements:

    custom.lang

    Language: csharp
    Globs: *.cs
    
    Emphasis: \breturn\b
    Emphasis: \bthrow\b
    

    That got things working for me. A bit complex, but it’s free. Another way to do it might be to clear out the standard\C#.lang file so you can leave other file formattings in place.

    And finally another option, since it’s on github, you could add a new style definition for highlighted text so we aren’t butchering the rest of the formatting. It’s nice to have options 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some troubles pausing and resuming a method. (Using Java in Eclipse). Basically
I'm trying to write an Eclipse rcp application using only jruby, or at least
I'm using Eclipse 3.5, with Java 6u20, Tomcat 6.0.28, and I have a big
[Java 1.5; Eclipse Galileo] HttpsURLConnection seems to stall when the getInputStream() method is called.
Ubuntu 11.10 ADT 16.01 Java 6 Eclipse Java EE Indigo SR1 - All latest
Using my Java program and Eclipse Helios , I am trying to print a
I'm using Eclipse Indigo on Win XP with Java 6. I have a Maven
I've been using eclipse for java android development for 6 months and I love
i am using Eclipse 3.7.2. I dont know why but the last line leads
is there any way of quick jump to the last modified line? eclipse has

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.