Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use temporary file when creating tag files without running prep…
…rocessor The tm_workspace_create_global_tags() function generates tags for two cases: 1. Source files pre-processed by C pre-processor. It first generates a file combining the parsed header files by creating a temporary file in which all the header files are included and this file is passed to the pre-processor. The result of the pre-processed file is then parsed by the ctags parser. 2. Source files directly parsed by the ctags parser. In this case all the source files are concatenated to a single file which is then parsed by the ctags parser. This patch leaves (1) more or less unchanged; however, the creation of the temporary file in (2) is unnecessary - the individual files can be parsed directly, the tags from all the parses can be combined, sorted and pruned without creating the temporary file. The temporary file is a problem for unit tests where some languages use the file name as the name of module in which the tags are defined and by using a different name, the unit test generates a different tag file every time it's run. Note the changed output of the process_order unit test caused by this change. The test parses two files, one containing enum { I1_E1, I1_E2, }; the other contining enum { I2_E1, I2_E2, }; Previously, because the files were concatenated the enums were different tags and the anonnymous tag renaming function renamed them to anon_enum_1 and anon_enum_2. Because now the files are parsed separately, the enum from the first file gets renamed to anon_enum_1 and when parsing the second file, we get the name anon_enum_1 as well for the second enum. This however isn't a problem - we don't display global tags in the symbol tree, autocompletion, and they are also ignored in scope completion so this shouldn't matter much.
- Loading branch information
Showing
2 changed files
with
80 additions
and
78 deletions.
There are no files selected for viewing
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
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