Yotam Salmon
Yotam Salmon

Reputation: 2411

Visual Studio intellisense and debug only in certain areas

I wrote a simple web-server that interprets c# inside HTML in real time (Like Razor, but it looks more like PHP style tags, just written in C#). Every C# code snippet is wrapped with <@ and @>.

Now, I want to start writing a simple web application using it. Working with Notepad++ is painfully annoying, due to the fact it cannot really autocomplete C# well, and C# is a strict language (unlike PHP, Javascript or Python, in which developing in Atom or NP++ is extremely easy and natural).

So, the question:
I wanted to know if there is any way that I can edit those pages in Visual Studio, have all the autocomplete functionality, and in the same time let VS know that I want it to notice (colorize, syntax-check, etc) only code snippets wrapped in <@ and @>.

How do I do that?

Thanks!

Upvotes: 1

Views: 88

Answers (1)

Timo Salom&#228;ki
Timo Salom&#228;ki

Reputation: 7189

Visual Studio has a very powerful extension SDK, so you can achieve what you want by developing one or more extensions. If you're new to extension development, I'd suggest you take a look at this getting started guide first.

Microsoft has quite a few samples available on GitHub. At least the following two samples should be of interest to you.

Syntax coloring: Diff Classifier Sample

Custom programming language support: Ook Language Integration Sample

The Ook sample goes a bit further than what you actually need, but it has some elements that are usable to you.

Upvotes: 1

Related Questions