-
Notifications
You must be signed in to change notification settings - Fork 629
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
use modeline as a hint for choosing a parser #41
Merged
Merged
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
Closed
I found Vim modeline detector is broken. I withdraw this again. |
Revised. Please, review them. |
…-option "Honor --ruby-kinds option in ruby.c" is merged. A unit test case is added for checking.
If a parser for a given file cannot be determined by file extension, a editor mode line can be used as a good hint for the choice. emacs detects following two formats at the first line of a file as a mode specification: -*- MODE -*-[1] -*- mode: MODE; ... -*-[2] [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes [2] https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html This patch makes ctags determines a parser by this mode specification. TODO: getPatternLanguage is not considered yet. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… -*-" editor mode line Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…r mode line Signed-off-by: Masatake YAMATO <yamato@redhat.com>
emacs detects following format at the end of file as a mode specification[1]: Local Variables: mode: MODE ... End: This patch makes ctags determines a parser by this mode specification. [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ditor mode line Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…executable Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Generally -*- MODE -*- style emacs modeline must be appeared on the first line of the file. However, if the first line is #! shbang, the modeline can be appeared on the second line. This patch handles this case. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…er #! Signed-off-by: Masatake YAMATO <yamato@redhat.com>
vim detects following format at the end of file as a mode specification[1][2]: /* vim: set filetype=FILETYPE */ This patch makes ctags determines a parser by this mode specification. [1] http://vimdoc.sourceforge.net/htmldoc/options.html#modeline [2] http://vimdoc.sourceforge.net/htmldoc/filetype.html#filetype Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…choosing a parser Choosing parser by file extension can conflict. For example ".m" is used by ObjectiveC and Matlab. shbang and modline is more specific hint for choosing a parser than file extension. TODO: Documents must be updated. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
masatake
added a commit
that referenced
this pull request
Jul 7, 2014
use modeline as a hint for choosing a parser
masatake
pushed a commit
to masatake/ctags
that referenced
this pull request
Mar 12, 2020
masatake
pushed a commit
to masatake/ctags
that referenced
this pull request
Mar 12, 2020
masatake
added a commit
to masatake/ctags
that referenced
this pull request
Sep 15, 2021
69d052914 Merge pull request universal-ctags#42 from wataash/pcc-debug f325a479a Conform style of PCC_DEBUG 00e41d611 Fix -Wformat (2) a60906336 Merge pull request universal-ctags#41 from wataash/wformat 547709ae7 Fix -Wformat 1dcc4a8bb Merge pull request universal-ctags#40 from wataash/has-attribute 99454223b Fix gcc build: error: attributes should be specified before the declarator in a function definition 222388cfa `#ifndef __has_attribute` instead of invalid `#ifndef __attribute__` 9569c380a Merge pull request universal-ctags#39 from wataash/fix-w-format ffd9f12ad Fix -Wformat 291934145 Use parentheses within macros around parameter names 563d6be05 Fix syntax 73dde20bd Correct captured text positions $0s and $0e eb6efd959 Enable execution of actions embedded in predicates git-subtree-dir: misc/packcc git-subtree-split: 69d052914c97191e7b1dfb4997ae740c735a7a63
masatake
added a commit
to masatake/ctags
that referenced
this pull request
Dec 2, 2022
e9aec0d0b Version 0.2.0 (universal-ctags#41) 33b51a75f Merge pull request universal-ctags#44 from masatake/fopen-m c0f010773 Use mmap(2) when opening a tags file if fopen() supports "m" mode flag. fbb9011a4 GitHub Actions: show error logs when failed git-subtree-dir: libreadtags git-subtree-split: e9aec0d0ba4fa8c1223d774e1c4b2dce328b9a97
masatake
added a commit
to masatake/ctags
that referenced
this pull request
Dec 2, 2022
53b7e27ab Version 0.2.1 5fbf0c7c8 use "m" mode flag of fopen only when compiling with glibc 2.3 or higher e9aec0d0b Version 0.2.0 (universal-ctags#41) 33b51a75f Merge pull request universal-ctags#44 from masatake/fopen-m c0f010773 Use mmap(2) when opening a tags file if fopen() supports "m" mode flag. fbb9011a4 GitHub Actions: show error logs when failed git-subtree-dir: libreadtags git-subtree-split: 53b7e27abc24162e5650985877a2fd2c637600a8
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.
Choosing parser by file extension can conflict. For example ".m" is
used by ObjectiveC and Matlab. shbang and modline is more specific
hint for choosing a parser than file extension.
modeline formats used in vim and emacs are supported in this patch set.
TODO: Documents must be updated.