This project is read-only.

Syntax Highlighting

Sep 20, 2009 at 6:18 PM
Edited Sep 21, 2009 at 1:35 AM

I've been looking through everything on syntax highlighting I can find but i jsut can't figure it out.

 

I'm trying to get the Lua Language to highlight, I've tried using the already built in version and it doesn't work, and i tried loading the properties file from SciTe and it still didn't work, got any advice?

 

I have this xml here for my lexer i don't know if its right, but i based it off the files inside the source

 

I loaded it like this

syntaxHighlighter1.Lexing.LoadLexerLibrary("lua.xml");

and i set the language and the lexer both to "lua"

what am i missing?

 

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
	<Language Name="lua">
		<AutoComplete FillUpCharacters=".([" SingleLineAccept="True" IsCaseSensitive="False">
			<List>
				and break do else elseif end false for function if 
				in local nil not or repeat return then true until while
				_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring
				print rawget rawset require tonumber tostring type unpack
				assert collectgarbage dofile error gcinfo loadfile loadstring
				print rawget rawset require tonumber tostring type unpack
				_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT 
				_STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype
				abs acos asin atan atan2 ceil cos deg exp 
				floor format frexp gsub ldexp log log10 max min mod rad random randomseed 
				sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan
				string.byte string.char string.dump string.find string.len 
string.lower string.rep string.sub string.upper string.format string.gfind string.gsub 
table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn 
math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp 
math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod 
math.pi math.pow math.rad math.random math.randomseed math.sin math.sqrt math.tan 
string.gmatch string.match string.reverse table.maxn
math.cosh math.fmod math.modf math.sinh math.tanh math.huge
sort tinsert tremove
			</List>
		</AutoComplete>

		<Indentation TabWidth="4" SmartIndentType="cpp" />
			
		
		<Lexer LineCommentPrefix="--" StreamCommentPrefix="--[[ " StreamCommentSuffix=" ]]" >	
			<Keywords List="0" Inherit="False">
				and break do else elseif end false for function if 
				in local nil not or repeat return then true until while
				_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring
				print rawget rawset require tonumber tostring type unpack
				assert collectgarbage dofile error gcinfo loadfile loadstring
				print rawget rawset require tonumber tostring type unpack
				_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT 
				_STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype
				abs acos asin atan atan2 ceil cos deg exp 
				floor format frexp gsub ldexp log log10 max min mod rad random randomseed 
				sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan
				string.byte string.char string.dump string.find string.len 
			</Keywords>
			<Keywords List="1" Inherit="False">
				string.lower string.rep string.sub string.upper string.format string.gfind string.gsub 
table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn 
math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp 
math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod 
math.pi math.pow math.rad math.random math.randomseed math.sin math.sqrt math.tan 
string.gmatch string.match string.reverse table.maxn
math.cosh math.fmod math.modf math.sinh math.tanh math.huge
sort tinsert tremove
			</Keywords>
		</Lexer>
	</Language>
</ScintillaNET> 

Sep 21, 2009 at 7:07 AM

In y program i use this synthaxe :

 

doc.Scintilla.ConfigurationManager.CustomLocation = "lua.xml";
doc.Scintilla.ConfigurationManager.Language = "lua";

 

Hervé

Sep 21, 2009 at 8:18 AM

And to be absolutly sure you're using the right lexer just set for the  <Lexer> Tag the Attribute LexerName="lua"


P.S: for the available Styles look in your ../Configuration/Builtin/LexerStyleNames/lua.txt

Best regards

Klingel

 

Sep 23, 2009 at 1:01 AM

Yeah, I alread figured that out....kinda feel stupid now.

 

But anyone got any advice on getting autocomplete working

 

Sep 23, 2009 at 3:52 PM
Edited Sep 23, 2009 at 3:53 PM

What exactly is your problem with the Autocompletelist ?

look at http://scintillanet.codeplex.com/Thread/View.aspx?ThreadId=57703

perhaps it help's

P.S.: No-one is born a master ;-)