Still don’t get schemes

Discussion Forums discussion Still don’t get schemes

This topic contains 0 voices and has 5 replies.

Viewing 6 posts - 1 through 6 (of 6 total)
Author Posts
Author Posts
April 10, 2006 at 3:41 pm #48

Darrell61
Member

I have made changes to an existing scheme and saved it into another file. When I open a file that uses this new scheme, the colors and font styles for most keywords are working. However, I have added some new keyword types and put keywords in the types, set coloring for the new types. They show up quite nicely in the Options>Style>Schemes dialog. PN2 even recognizes the file type. But, in coding the keywords are not being colored as expected. Can anyone elighten me on this scheme coloring thing?

April 11, 2006 at 8:32 am #14929

simon
Key Master

Hi, with built-in schemes this depends on which lexer they are using. Many lexers only support the existing configured keyword sets (so just adding extra ones won’t work – the lexer must be changed).

April 11, 2006 at 6:47 pm #14930

Darrell61
Member

I pretty sure I have changed the lexer properly:

<?xml version="1.0" encoding="UTF-8"?>

<Scheme>

<keyword-classes>

<keyword-class name="sql_keywords">

absolute action add admin after aggregate


blah blah blah


when whenever where with without work write year zone

</keyword-class>

<keyword-class name="sql_functions">

cast charindex convert ltrim rtrim substring

</keyword-class>

<keyword-class name="sql_datatypes">

bigint char datetime decimal int numeric nvarchar smalldatetime smallint tinyint varchar

</keyword-class>

</keyword-classes>

<base-language name="sqlbase">

<lexer name="sql" />

<use-styles>

<style name="Default" key="32" bold="false"/>

<style name="Whitespace" key="0" />

<style name="Comment" key="1" class="commentbox"/>

<style name="Comment Line" key="2" class="commentline"/>

<style name="Doc Comment" key="3" class="commentdoc"/>

<style name="Number" key="4" fore="colour.number"/>

<style name="Keyword" key="5" class="keyword" bold="false" fore="0000ff"/>

<style name="Double-Quoted String" key="6" fore="colour.string"/>

<style name="Single-Quoted String" key="7" fore="colour.char"/>

<style name="Symbols" key="8" fore="007f7f"/>

<style name="Preprocessor" key="9" class="preprocessor"/>

<style name="Operator" key="10" bold="false" fore="7F7F7F"/>

<style name="Identifier" key="11" />

<style name="End of line string" key="12" fore="000000" font="font.monospace" back="e0c0e0" eolfilled="true"/>

<style name="Functions" key="13" class="sql_functions" fore="FF9600"/>

<style name="Data Types" key="14" class="sql_datatypes" fore="A52A00"/>

<!-- braces.sql.style=10 -->

</use-styles>

</base-language>

<language name="sql" base="sqlbase" title="T-SQL" folding="true" foldcomments="true">

<use-keywords>

<keyword key="0" name="Keywords" class="sql_keywords"/>

<keyword key="13" name="Functions" class="sql_functions"/>

<keyword key="14" name="Data Types" class="sql_datatypes"/>

</use-keywords>

</language>

</Scheme>

April 11, 2006 at 6:50 pm #14931

Darrell61
Member
April 12, 2006 at 8:59 am #14932

simon
Key Master

Hi, the lexer I’m referring to is code built in to Scintilla (the editing component for PN) which understands the SQL language (the lexer referred to by the <lexer> line).

I’ve added an RFE for PN to add more keyword styles for the SQL lexer.

April 12, 2006 at 9:16 pm #14933

Darrell61
Member

Thank you very much, sir! I am guessing that is a coding change. Nothing I can fix on the fly, eh?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.