Syntax Highlighting - most efficient and professional way
I want code for: syntax highlighting (of programming languages)
Language: C# or assembly x86 (preferably C#)
Qualifications: most efficient implementation possible / most professional / the way that big corporations like Microsoft do it
Rephrased: How do I implement syntax highlighting in C# for Windows in the most efficient way presently known?
Elaboration (feel free to skip - not needed to answer question :)):
I don't want just any way of implementing it - I've already seen several.
What I'd like to know is how Microsoft does it so well on Visual Studio (whichever version).
People keep trying to reinvent the wheel when it comes to syntax highlighting. I don't understand why.
Is this considered a very hard problem? I've seen implementations that only highlight what's currently showing on the screen, I think that's the way to go... (it used some clever API to know which lines of a textbox were actually showing).
I've also seen implementations using RichTextBox and I think that's not the way to go (maybe I'm wrong here) - I think something like subclassing the routine that draws text on the regular textbox and changing its brushes might be better (maybe I've seen that somewhere - I doubt I'd think of that myself)
Also I've heard that some people implement it with AST just like a compiler would be coded (the lexer part, I think?) - I'd hope that that's overkill - I don't see that as being efficient. (uneducated guess)
If it's indeed a hard problem, then how do the big corps always get it right? I've never heard of a way to break the syntax highlighting in Visual Studio, for example.
But any other tool that implements it does so poorly, or worse than the big guys.
What's the official "this is the best way and any other way is less efficient" way of doing it?
I really don't have any evidence that Microsoft's way is better, but seeing that they probably know more about Windows API than anybody else, I'd guess that there way of implementing it is the best (I would love to be wrong - imagine being able to say that my implementation of syntax highlighting is better than MS's!)
Sorry for the disjointed elaboration.
Also I apologize in advance for any faux-pas - this is my first question.
What is the most efficient way to truncate a number for a specific accuracy?
What is the most efficient (fastest) way to get a lower bound of zero? Math.max(0, x) will work, returning 0 for any negative value of x. However, my experience with Math.* is that there often is a fa
Unfortunately I need to iterate over all the DOM elements of a page and i'm wondering what the most efficient technique is. I could probably benchmark these myself and might if I have the time but i'm
We have: std::string string_array; string_array = some data; string_array = some more data; char* cstring_array; What is the most efficient way to copy data from string_array to cstr
I believe I need to use ndb.delete_multi but I am confused as to how to make it work for a specific set of keys and whether it is the most efficient way to go. Using Python 2.7 with Google App Engine.
Given an array a, what would be the most efficient way to determine whether or not at least one element i satisfies the condition a[i] == i? All the elements in the array are sorted and distinct, bu
I'm starting to run a few ads on a website, and I'm trying to decide the best way to track performance. Specifically, What's the most efficient way to count clicks? About the only way I can think of
What is the most efficient way to find the common prefix of many strings. For example: For this set of strings /home/texai/www/app/application/cron/logCron.log /home/texai/www/app/application/jobs/log
I'm running Emacs, editing files in C++ mode and PHP mode. I love syntax highlighting as a concept, but the default colors are a travesty. I can barely read some of them: way too dark. What is the eas
I'm trying to think of the most efficient way to parse a file that stores names, studentids and Facebook ids. I'm trying to get the fbid value, so for this particular line it would be: 1281766051. I t
Which Python library for syntax highlighting is the best one? I'm interested in things like supported languages, ease of use, pythonic design, dependencies, development status, etc.
I have some content with up to 2-levels of replies. I am wondering what the most efficient way to fetch and output the replies. I should note that I am planning on storing the comments with fields con
I'm looking for a general purpose syntax highlighting library, to output to html. It's for use within a ruby app, so a ruby library would be good, but an excellent utility which can be piped in and ou
Consider these two folder structures: Foo/ Folder1/ File1.txt Folder2/ Folder3/ File2.txt Bar/ Folder1/ Folder2/ Folder3/ Folder4/ I'd like to know the most efficient way in PHP to tell me that the
What is the most efficient way to copy an array of 1000 ints from one array to another in objective C? This will be running on an iphone within some drawing code so its important to be as efficient as
I have installed vim in Debian 6. I am trying to change color scheme and enable syntax highlighting. But it's not working. I added set background=dark in .vimrc file. But white background is displayin
I have just finished this MySQL query and as I still consider myself a novice, was wondering if I have done this in the most efficient way? I have 4 tables, the first 2 contain category data and categ
What is the most efficient way in Quickfix/n 1.4 to extract the message type as defined here: http://www.fixprotocol.org/FIXimate3.0/en/FIX.5.0SP2/messages_sorted_by_type.html I currently use var msgT
I'm searching for a PHP syntax highlighting engine that can be customized (i.e. I can provide my own tokenizers for new languages) and that can handle several languages simultaneously (i.e. on the sam
I'm using Eclipse & the Scala plugin to write scala code. The editor seems to have limited syntax highlighting options - for example I would like to change the formatting of variables (I like them
I want to modify Xcode syntax highlighting. Namely, I do a lot of 'NSAsserts', which I find visually distracting, and so I would like lines starting with 'NSAssert' to be a light gray. This way, I can
I have the JBoss Freemarker IDE installed in Eclipse/Indigo. For the first .ftl I created the syntax highlighting/parsing works fine. But when I copied this to create new .flt syntax highlighting/pars
How do I turn syntax highlighting on in Eclipse editor?
What would be the most efficient way of storing (and retrieving) session data (array) from a shopping bag into a mysql db? So that visitors get back their shopping bag content on a new visit. All I ne
I have a bunch of DataTables that need to be converted to object[,] arrays (not object arrays). What's the most efficient way to do this in terms of performance? I know I can do this by building m
I am very pleased with the new editor by Github. Unfortunately it isn't exactly easy to customize it. I wanted to create my own Syntax Highlighting Theme, because I am not happy with the ones availabl
What is the most efficient to share data between multiple cores. Sure you can use shared memory but that also comes at a cost. Say one core is continously writing to a variable and the other core has
I'm migrating from Matlab to C + GSL and I would like to know what's the most efficient way to calculate the matrix B for which: B[i][j] = exp(A[i][j]) where i in [0, Ny] and j in [0, Nx]. Notice tha
What is the most efficient way to duplicate a row in an Sqlite3 database exactly except with an updated PrimaryKey?
Given an array of integers 1 to 100 (inserted randomly), and one integer is taken out of the array. What is the most efficient way of finding the integer that is missing?
is there a way to get visual studio 2008 to do a nice syntax highlighting for the intermediate language?
I am implementing a dynamic application for 4 desktops in my house so i don't think that security is big issue however i would like to know what is the most efficient wayto implement sessions?cookies
Is there any way to add syntax highlighting for *.less files in Geany? I found that using *.css syntax higlighting, sugessted somewhere in the internet is not enough for me, and in fact it making bloo
Using the Twitter API, what would be the most efficient way to find which users favorited a specific tweet? And also it possible to do this in retrospective, or must the streams be tapped prior the fa
Please provide an efficient way to empty the entire database without dropping it.
I have an ArrayList of objects in Java. The objects have four fields, two of which I'd use to consider the object equal to another. I'm looking for the most efficient way, given those two fields, to s
I see there are syntax highlighting extensions for Vi and Emacs in Opa binary package. I use KDE as my desktop environment so I was wondering if anybody knows such extensions for Kate?
I am creating a chat windows for a game, and I am using WinRT XAML for the UI. 1.What is the most efficient way to design the chat window to be able to be scrollable and handle multicolored text? At
I know VBA in Excel isn't the quickest of things - but I need the most efficient (i.e. quickest) way to loop through a large sample of rows. Currently I have: For Each c In Range($A$2:$A$ & Cell
What is the easiest and most efficient way to convert org.json.JSONArray to List?
What is the most efficient way to write a select statement similar to the below. SELECT * FROM Orders WHERE Orders.Order_ID not in (Select Order_ID FROM HeldOrders) The gist is you want the records f
What's the most efficient way to sort objects in an NSSet/NSMutableSet based on a property of the objects in the set? Right now the way I am doing it is by iterating through each object, add them to a
What is the most efficient way for an extension method to map object properties to a IDictionary where : keys are property paths (e.g. Customer.Company.Address.Line1) values are string representati
I am creating a tile-based 2D game as a way of learning basic modern OpenGL concepts. I'm using shaders with OpenGL 2.1., and am familiar with the rendering pipeline and how to actually draw geometr
I'm wondering what will be the most efficient way to make a hash containing some elements (in JAVA). I want to have in this hash objects of my class Node that are similar to those representing class F
I have a string that contains a series of random words separated by commas: worda,sample,wordb,another,extra,exampleb This list will always be different. What is the most efficient way to replace the
I am trying to generate a query and having difficulty finding the most efficient way to do it in sqlalchemy, (note I'm using flask-sqlalchemy) The goal is to find all users have a meeting with a speci