Move adding a lexer notes to 'Syntax highlighting' section; mention

adding the LINK_LEXER command manually.
Some minor edits (reST section grouping).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2984 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-09-23 11:25:23 +00:00
parent bce7d185b9
commit 76e9f77b53
2 changed files with 21 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2008-09-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* HACKING:
Move adding a lexer notes to 'Syntax highlighting' section; mention
adding the LINK_LEXER command manually.
Some minor edits (reST section grouping).
2008-09-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/editor.c, src/ui_utils.c:

26
HACKING
View File

@ -2,7 +2,7 @@ About this file
---------------
This file contains information for anyone wanting to work on the Geany
codebase. You should be aware of the open source licenses used - see
the README file or the documentation.
the README file or the documentation. It is pseudo-reStructuredText.
Writing plugins
---------------
@ -154,8 +154,8 @@ might not be static strings when Geany is configured with
printf("Prefix: " GEANY_PREFIX); but instead use
printf("Prefix: %s", GEANY_PREFIX);
Adding a file foo.[hc] in src/ or plugins/
------------------------------------------
Adding a source file foo.[hc] in src/ or plugins/
-------------------------------------------------
Add foo.c, foo.h to SRCS in path/Makefile.am.
Add foo.o to OBJS in path/makefile.win32.
Add path/foo.c to po/POTFILES.in (for string translation).
@ -165,14 +165,6 @@ Adding a filetype
You can add a filetype without syntax highlighting or tag parsing, but
check to see if those features have been written in other projects first.
For syntax highlighting, it may be possible to use an existing Scintilla
lexer in the scintilla/ subdirectory - if not, you will need to find
(or write) one, LexFoo.cxx. Try the Scintilla project first. Remember
to update scintilla/Makefile.am and scintilla/makefile.win32.
For tag parsing (e.g. for the symbol list), see 'Adding a TagManager
parser' below.
Add GEANY_FILETYPES_FOO to filetypes.h.
Initialize GEANY_FILETYPES_FOO in init_builtin_filetypes() of
filetypes.c.
@ -203,8 +195,17 @@ see below.
Syntax highlighting
^^^^^^^^^^^^^^^^^^^
It may be possible to use an existing Scintilla lexer in the scintilla/
subdirectory - if not, you will need to find (or write) one,
LexFoo.cxx. Try the Scintilla project first. When adding a lexer, update:
* scintilla/Makefile.am
* scintilla/makefile.win32
* scintilla/KeyWords.cxx - add a LINK_LEXER command *manually*
For syntax highlighting, you will need to edit highlighting.c and add
the following things:
1. Write styleset_foo_init() to setup default styles and load style
settings from the filetypes.foo configuration file. You should probably
start by copying and adapting another filetype's initialization, such
@ -232,9 +233,8 @@ typing in a comment (but it can still be forced by the user).
If the Scintilla lexer supports user type keyword highlighting (e.g.
SCLEX_CPP), update editor_lexer_get_type_keyword_idx() in editor.c.
Adding a TagManager parser
--------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^
This assumes the filetype for Geany already exists.
First write or find a CTags compatible parser, foo.c. Note that there