0

Title says everything. Is it possible to hook a program between the vs2010 editor and the background compiler?

Edit: I want to extend the c# syntax with new keywords. So I need to "send" the source code first to my own compiler that makes plain c# files out of the files with extended keywords...

Matthias
  • 15,919
  • 5
  • 39
  • 84
  • Background compiler?? Do you mean IntelliSense parser? – Hans Passant Jul 19 '12 at 22:19
  • Perhaps if you could explain what you wanted to accomplish, we could help more. There are *tons* of hooks exposed by VS, so there's probably one that you can use. – dlev Jul 19 '12 at 22:44
  • I want to extend the c# syntax with new keywords. So I need to "send" the source code first to my own compiler that makes plain c# files out of the files with extended keywords... – Matthias Jul 22 '12 at 23:31
  • Matthias, what you are referring to is known as a macro – Mâtt Frëëman Aug 08 '12 at 13:03
  • @Matt-nonuby: Can you explain? – Matthias Aug 08 '12 at 13:39
  • "Yes". Please update your question to something answerable. You should not expect people to go hunting through the comments of other answers to gain rudimentary context on your problem. – Rushyo Aug 08 '12 at 13:45

1 Answers1

0

Maybe this is rather hackish, but you can call your parser via a pre-build event as described here. After the pre-build event finishes, the C# compiler should kick in.

I haven't tried this before, though, so please don't throw the tomatoes if it does not work :)

Regarding Intellisense, check out this possible duplicate question: How to extend IntelliSense items?

Community
  • 1
  • 1
Mihai Todor
  • 8,014
  • 9
  • 49
  • 86
  • This is required anyway. But the problem is with the editor, that shows syntax errors when the source code is not valid over *plain* C#. – Matthias Aug 06 '12 at 11:30
  • It's not a duplicate. This question is about the editor syntax highlightning. The other is about IntelliSense items. – Matthias Aug 06 '12 at 15:45
  • Well, Google gives a good amount of results for such an endeavor. Here's one of them: http://stackoverflow.com/questions/3253205/how-do-i-visual-studio-syntax-highlighting-extension – Mihai Todor Aug 06 '12 at 15:53