GNOME Bugzilla – Bug 139968
ASP Support for GtkSourceView
Last modified: 2009-04-12 16:31:59 UTC
GtkSourceView does not highlight the syntax of ASP files.
Created attachment 26632 [details] Example ASP Language spec Here's an ASP language specification file I've been using. It works well and is fairly exhaustive (and large), containing all the sytax elements/properties/methods/events/operators etc. that I could find in Microsoft's online documentation. I wrote this file because I had to learn ASP/VBScript for a recent project. Syntax highlighting made the coding a lot easier. Since it's based on my experience, it only includes VBScript syntax for highlighting. Also, I think VBScript is the default and most widely used (?). This file could be enhanced to handle JScript, VB.Net, etc., and whatever else ASP allows as a scripting language, but I'm not really that familiar with any of those other languages.
Does anyone knowning ASP want to try this .lang file?
Is application/x-asp recognized as mime-type by shared-mime-info? As a policy we do not include lang files whose mime types are not in shared-mime-info.
If this appears at the top '<%@LANGUAGE="JAVASCRIPT"%>' then you can highlight any programming enclosed in <% %> as JavaScript. The rest should be HTML. Not sure how to make that into a .lang file, but it works for me! As for VBScript, what Scott Martin has above seems to be correct.
Created attachment 126091 [details] ASP Syntax Highlighting for GTKSourceView-2.0
Hi, I'm a professional ASP Developer and use gedit daily for my work. I was using Scott Martin asp.lang but somehow I feel strange with it. Mostly because of odd highlighting like in "end function", missing ADO and HTML syntax. So I created a new one from the ground using scripting documentation 5.6, ado 2.5 and asp 3.0 specification. It alsos separate ASP Blocks from HTML blocks and highlight then all, just like the PHP one. I'm currently running it in gedit 2.22.3 Glad to share, Fabio Zendhi Nagao (nagaozen)
Created attachment 126093 [details] [FIXED] ASP Syntax Highlighting for GTKSourceView-2.0
Comment on attachment 126093 [details] [FIXED] ASP Syntax Highlighting for GTKSourceView-2.0 Sorry, I forgot to assing application/x-asap to the asp.lang. @Paulo Maggi: Yes, they are recognized as mime-type by shared-mime-info
Hi Fabio, about the file looks good, but just a niptick: shouldn't be <% %> highlighted as it is <?php ?> in php?
Oro? Isn't it working this way for you? It's fine here 'cause asp block is defined as: <context id="asp-block"> <start><[%]</start> <end>[%]></end> . . . </context>
Created attachment 126096 [details] example I mean, as you can see in the image the <% and the %> is not highlighted, I think that they should be. The should use the same style as in php with the <?php ?>
Created attachment 126103 [details] [UPDATED] GTKSourceView-2.0 asp.lang (In reply to comment #11) > Created an attachment (id=126096) [edit] > example > > I mean, as you can see in the image the <% and the %> is not highlighted, I > think that they should be. The should use the same style as in php with the > <?php ?> > You are right, I missed it. It's now fixed. But i've assigned the style to "preprocessor" instead of "keyword" as used in php.lang. I've also inserted vb and ado constants.
The file looks ok. I am going to commit it now but could you provide us with an example file of ASP no more than 10 lines? This is needed for the test script. Thanks.
Created attachment 126104 [details] ASP Xtreme Evolution Model for Pastebin Controller (In reply to comment #13) > The file looks ok. I am going to commit it now but could you provide us with an > example file of ASP no more than 10 lines? This is needed for the test script. > > Thanks. > Here's the example: pastebinModel.asp. 470 lines of ASP ;D
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Fabio, I have been using your asp.lang for work (thank you!), but I have noticed that it does not highlight Elseif as it does Else and If.
(In reply to comment #16) > Fabio, > > I have been using your asp.lang for work (thank you!), but I have noticed that > it does not highlight Elseif as it does Else and If. > Hi Eli, I've noticed missing things too "adTypeReadWrite", for example ... I'm looking for new specifications to update the work.
Created attachment 126524 [details] ASP/VBScript language spec to GTKSourceView 2.0 I've updated the old version with the full ADO 2.7 constants. Also included elseif -- thx to Eli
(In reply to comment #18) > Created an attachment (id=126524) [edit] > ASP/VBScript language spec to GTKSourceView 2.0 > > I've updated the old version with the full ADO 2.7 constants. Also included > elseif -- thx to Eli > Updated, thanks.
Created attachment 132544 [details] Updated lang definition I've detected some keywords that wasn't in the lang spec. They've been added now.
I committed the missing keywords. But in the future please 1 - open a new bug 2 - attach a patch, not the whole file 3 - make sure the file is in unix format, not dos thanks