New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parsers and built-in filetypes for Lisp dialects #1922
Open
quipa
wants to merge
7
commits into
geany:master
Choose a base branch
from
quipa:lisp_dialects
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description Add parsers to allow for the use of global tag files and enable basic autocompletion for these Lisp dialects. Add Scheme filetype. Commit follows instructions described in HACKING for parsers and filetypes. ## Parsers In ctags/ * Add clojure.c and modify for integration with geany * Add lisp.c and modify for integration with geany * Add scheme.c and modify for integration with geany NOTE: These parsers are originally from the universal-ctags/ctags repository. In ctags/Makefile.am * Add clojure.c to parsers * Add lisp.c to parsers * Add scheme.c to parsers In ctags/main/parsers.h * Add ClojureParser * Add LispParser * Add SchemeParser In src/tagmanager/tm_parser.h. * Add TM_PARSER_CLOJURE * Add TM_PARSER_LISP * Add TM_PARSER_SCHEME In src/tagmanager/tm_parser.c: * Add a map_CLOJURE TMParserMapEntry mapping to ClojureKinds with appropriate TMTagType and add corresponding MAP_ENTRY(CLOJURE) to parser_map * Add a map_LISP TMParserMapEntry mapping to LispKinds with appropriate TMTagType and add corresponding MAP_ENTRY(LISP) to parser_map * Add a map_SCHEME TMParserMapEntry mapping to SchemeKinds with appropriate TMTagType and add corresponding MAP_ENTRY(SCHEME) to parser_map In src/tagmanager/tm_parser.c: Add Clojure, Lisp and Scheme to tm_parser_has_full_context(). In symbols.c: Update add_top_level_items() with Clojure and Lisp and Scheme. ## Filetypes In filetypes.c, init_builtin_filetypes(): * Set 2nd argument to Lisp in FT_INIT() macro for Lisp filetype * Add full entry for Clojure in FT_INIT() macro for Clojure filetype * Add full entry for Scheme in FT_INIT() macro for Clojure filetype In filetypes.h * Add GEANY_FILETYPES_CLOJURE * Add GEANY_FILETYPES_LISP * Add GEANY_FILETYPES_SCHEME In data/filetype_extensions.conf * Add Scheme In data/filedefs/ * Add filetypes.Scheme.conf In data/Makefile.am * Add filetype.Scheme.conf to filetypes ## Notes * In tm_parser.c tm_parser_has_full_context() new entries probably need verifying in language relevant documentation. * Need to add tests for parsers in this commit.
# Description Add parser to allow for the use of global tag files and enable basic autocompletion for these Racket. Add Clojure, Scheme and Racket as built-in filetypes. Clojure, Scheme and Racket use Lisp Lexer. Commit follows instructions described in HACKING for parsers and filetypes. ## Racket Parser In ctags/ * Add ``racket.c``. This parser is based on the Scheme parser from the universal-ctags/ctags repository and was adapted for integration with geany. In ctags/Makefile.am * Add ``scheme.c`` to ``parsers`` In ctags/main/parsers.h * Add ``RacketParser`` In src/tagmanager/tm_parser.h. * Add ``TM_PARSER_RACKET`` In src/tagmanager/tm_parser.c: * Add a ``ap_SCHEME TMParserMapEntry`` mapping to ``SchemeKinds`` with appropriate ``TMTagType`` and add corresponding ``MAP_ENTRY(SCHEME)`` to ``parser_map`` In src/tagmanager/tm_parser.c: Add Racket to ``tm_parser_has_full_context()``. In symbols.c: Update ``add_top_level_items()`` with Racket. ## Built-in filetypes In filetypes.c, ``init_builtin_filetypes()``: * Add full entry for Scheme in ``FT_INIT()`` macro for Racket filetype In filetypes.h * Add GEANY_FILETYPES_RACKET In data/filetype_extensions.conf * Add ``Racket`` to ``[Extensions]`` * Add ``Racket`` to ``Script`` in ``[Groups]`` In data/filedefs/ * Add ``filetypes.racket`` * Modify ``filetype.Clojure.conf`` to ``filetypes.clj`` * Modify ``filetype.Scheme.conf`` to ``filetypes.scheme`` In data/fildefs/filetype.clj In data/fildefs/filetype.scheme In data/fildefs/filetype.lisp In data/fildefs/filetype.rkt * (except lisp) Add ``[styling]`` section with contents equal to those in filetype.lisp * Add ``wordchars`` * Add ``whitespaces_chars`` NOTE: This enables selecting on double click functions and variables with these characters In data/Makefile.am * Add filetype.racket to filetypes * Modify ``filetype.Clojure.conf`` to ``filetypes.clj`` * Modify ``filetype.Scheme.conf`` to ``filetypes.scheme`` In src/highlightingsmappings.h * Add ``highlighting_lexer_CLOJURE`` * Add ``highlighting_lexer_SCHEME`` * Add ``highlighting_lexer_RACKET`` * Add ``highlighting_styles_CLOJURE`` * Add ``highlighting_styles_SCHEME`` * Add ``highlighting_styles_RACKET`` * Add ``highlighting_keywords_CLOJURE`` * Add ``highlighting_keywords_SCHEME`` * Add ``highlighting_keywords_RACKET`` * Add ``highlighting_properties_CLOJURE`` * Add ``highlighting_properties_SCHEME`` * Add ``highlighting_properties_RACKET`` In src/highlighting.c * Add ``init_styleset_case(CLOJURE);`` in ``highlighting_init_styles()`` * Add ``init_styleset_case(SCHEME);`` in ``highlighting_init_styles()`` * Add ``init_styleset_case(RACKET);`` in ``highlighting_init_styles()`` ## Notes * Need to add tests for Racket parser in this commit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale:
Currently geany functionality for Lisp dialects is limited to syntax highlighting and only covers [Common] Lisp and Clojure (currently not full built-in file type). The following change not only expands functionality to existing Lisps dialects but adds support for two major Lisp dialects, Scheme and Racket.
Changes:
Existing problems: