madskristensen / WebEssentials2012

http://vswebessentials.com
Other
95 stars 46 forks source link

About GetClassificationsSpans #90

Closed sebagomez closed 8 years ago

sebagomez commented 8 years ago

I have a question about your code in the GetClassificationSpans function. I'm working on my own extension to provide syntax coloring on prolog source code files, called VSProlog. The problem I'm facing is that I want to implement comment block coloring (/* /) which just like C++ and the like, the start block (/) can be in a line of code and the close block (*/) can be placed many lines below. I had an approach where when I got a span, I get the line and check for every line before that one to see if there's a start block, in that case, that line is also a comment. The thing is, that's too expensive and freezes VS for a second... so I thought I could just check for the previous line, if that line is a comment, i'm also in a comment. But I don't know how to do that, because I can get the previously returned classifications spans. I hope I made myself clear, any tip of advice would be greatly appreciated. Regards

madskristensen commented 8 years ago

You probably need to decouple the parser/lexer and the classifier. The right place to ask these questions is at https://gitter.im/Microsoft/extendvs

sebagomez commented 8 years ago

cool thanks!