G'day,
I'm having to do a pile of work on some old ASP websites, always VBScript, and it's getting quite annoying that the default scripting language is JavaScript (I've *never* seen an ASP website written in JavaScript!). So, here's a patch for setting the default scripting language to VBScript (or Python). This excerpt from the patched filetypes.xml says it all:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
While I was in there, I added a couple of VBScript keywords too.
NB: my C is a bit rusty, and my knowledge of the Geany codebase is almost non-existent, so I went for simple/works over best. Please feel free to revise as necessary.
cheers, Ross.
On Thu, 24 Sep 2009 20:16:35 +1000, Ross wrote:
Hi,
I'm having to do a pile of work on some old ASP websites, always VBScript, and it's getting quite annoying that the default scripting language is JavaScript (I've *never* seen an ASP website written in JavaScript!). So, here's a patch for setting the default scripting language to VBScript (or Python). This excerpt from the patched filetypes.xml says it all:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
While I was in there, I added a couple of VBScript keywords too.
Thanks. Both parts committed.
Regards, Enrico
On Thu, 24 Sep 2009 19:15:56 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
I think this should be an integer setting, not hex.
Regards, Nick
Nick Treleaven wrote:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
I think this should be an integer setting, not hex.
It's overloading the syntax highlight styling settings to pass a simple integer setting into the language config to be stored in the array of GeanyLexerStyle style configs. This alleviates the need to extend the config structure to support arbitrary key/value setting pairs. It's a hack, but it's the simplest hack I could see that doesn't mess with the existing structure.
If you start getting a few of these, you might want to reconsider the structure of StyleSet. ITMT, dirty hacks win :)
Um, so yes, it needs to be hex.
On Sun, 27 Sep 2009 22:13:54 +1000 Ross McKay rosko@zeta.org.au wrote:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
I think this should be an integer setting, not hex.
It's overloading the syntax highlight styling settings to pass a simple integer setting into the language config to be stored in the array of GeanyLexerStyle style configs. This alleviates the need to extend the config structure to support arbitrary key/value setting pairs. It's a hack, but it's the simplest hack I could see that doesn't mess with the existing structure.
If you start getting a few of these, you might want to reconsider the structure of StyleSet. ITMT, dirty hacks win :)
Um, so yes, it needs to be hex.
If it's OK with you I'll change it to an integer setting.
Regards, Nick
On Sun, 27 Sep 2009 15:14:37 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 27 Sep 2009 22:13:54 +1000 Ross McKay rosko@zeta.org.au wrote:
# default scripting language for ASP set to VBScript # 0x000001 = JavaScript (or leave blank for default) # 0x000002 = VBScript # 0x000003 = Python html_asp_default_language=0x000002
I think this should be an integer setting, not hex.
...
If it's OK with you I'll change it to an integer setting.
Done in r4246. Please test (or provide ASP samples so I can test it).
Regards, Nick
Nick Treleaven wrote:
If it's OK with you I'll change it to an integer setting.
Done in r4246. Please test (or provide ASP samples so I can test it).
Nice, works just like a bought one (only better). FWIW, here's a simple sample of ASP code with no script language directive, that previously showed VBScript keywords in blue, except "in":
<% ' comment -- this is not an unterminated string constant :) Dim sName, sValue For Each sName in Request.ServerVariables sValue = Trim(Request.ServerVariables(sName)) If sValue <> "" Then sValue = Server.HTMLEncode(sValue) End If Response.Write "<p>" & sName & " = " & sValue & "</p>" & vbCrLf Next %>
cheers, Ross.
On Mon, 28 Sep 2009 11:07:10 +1000 Ross McKay rosko@zeta.org.au wrote:
Nice, works just like a bought one (only better). FWIW, here's a simple sample of ASP code with no script language directive, that previously showed VBScript keywords in blue, except "in":
<% ' comment -- this is not an unterminated string constant :) Dim sName, sValue
Thanks, the setting seems to work OK. But keywords don't get coloured - did they used to? The attached patch seems to fix that, but I'm not sure if the change affects other colouring too.
Regards, Nick
On Wed, 30 Sep 2009 14:56:50 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
But keywords don't get coloured - did they used to? The attached patch seems to fix that, but I'm not sure if the change affects other colouring too.
Oops, try this attached patch instead.
Regards, Nick
Nick Treleaven wrote:
Oops, try this attached patch instead.
Ah, yes, I must remember to check mail before send mail! See my other email for comments.
cheers, Ross
Nick Treleaven wrote:
Thanks, the setting seems to work OK. But keywords don't get coloured - did they used to?
Keywords, comments, string constants, script delimiters, script directives and everything else show up with different colours when in VBScript mode (on my configuration, that's: blue, grey, green, dark green, dark green, and brown). When Geany thinks script means JavaScript, nearly everything is blue except string constants and lowercase keywords in common with JScript.
The attached patch seems to fix that, but I'm not sure if the change affects other colouring too.
The one you picked was embedded VBScript (? maybe <script>...</script> blocks?) not ASP VBScript which is the next block; see attached patch.
As above, but with different colours (meaning I needed to fiddle with my filetypes.xml again :)
cheers, Ross
On Thu, 01 Oct 2009 01:21:03 +1000 Ross McKay rosko@zeta.org.au wrote:
The attached patch seems to fix that, but I'm not sure if the change affects other colouring too.
The one you picked was embedded VBScript (? maybe <script>...</script> blocks?) not ASP VBScript which is the next block; see attached patch.
Committed: Use jscript_keyword for SCE_HB[A]_WORD markup styles.
Regards, Nick