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?
Still don't get schemes
(6 posts) (2 voices)-
Posted 6 years ago #
-
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).
Posted 6 years ago # -
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>
Posted 6 years ago # -
Posted 6 years ago #
-
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.
Posted 6 years ago # -
Thank you very much, sir! I am guessing that is a coding change. Nothing I can fix on the fly, eh?
Posted 6 years ago #
Reply
You must log in to post.