Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Issue #77 Allow end-user configuration of tags path relative to project root #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mshenfield
Copy link
Contributor

Allow user to specify the directory, relative to the root of each project
open within Atom, where symbols-view looks for the tags file, using
the tagsDirectory config variable. This closes #77 and is a step towards
#127.

This only effects toggle-project-symbols. The impetus behind this commit
is to allow popular confirations, such as storing tags files in the .git
directory, to work. The change required additional information on each
tag object, mainly specifiying the path of the project the tag was generated
for. This was to a) easily display the project directory when multiple projects
were open and b) to programatically resolve the full path of the symbol's file
when generating symbols relative to root.

This also required adding a configuration variable tagsDirectory, which should
be a directory relative to the project root that contains the tags file.

Also refactored the reloadTags method inside of watchTagsFiles into a separate
instance method, with a different name (triggerReloadTags) so that it didn't
shadow the instance attribute reloadTags, and could be used in the configuration
watcher for the new tagsDirectory configuration variable.

Added an appropriate test to run toggle-project-symbols with a relative
tagsDirectory config set.

Allow user to specify the directory, relative to the root of each project
open within Atom, where symbols-view looks for the `tags` file, using
the `tagsDirectory` config variable.

This only effects `toggle-project-symbols`. The impetus behind this commit
is to allow popular confirations, such as storing tags files in the `.git`
directory, to work. The change required additional information on each
`tag` object, mainly specifiying the path of the project the tag was generated
for. This was to a) easily display the project directory when multiple projects
were open and b) to programatically resolve the full path of the symbol's file
when generating symbols relative to root.

This also required adding a configuration variable `tagsDirectory`, which should
be a directory relative to the project root that contains the tags file.

Also refactored the reloadTags method inside of watchTagsFiles into a separate
instance method, with a different name (triggerReloadTags) so that it didn't
shadow the instance attribute reloadTags, and could be used in the configuration
watcher for the new `tagsDirectory` configuration variable.

Added an appropriate test to run `toggle-project-symbols` with a relative
`tagsDirectory` config set.
@mshenfield mshenfield changed the title Allow end-user configuration of tags path relative to project root Issue 77 Allow end-user configuration of tags path relative to project root Dec 10, 2015
@mshenfield mshenfield changed the title Issue 77 Allow end-user configuration of tags path relative to project root Issue #77 Allow end-user configuration of tags path relative to project root Dec 10, 2015
@mshenfield
Copy link
Contributor Author

I feel like there is an implied AtomTag class floating around, but would like to refactor in a separate PR. We have node-ctags Tag objects returned in TagReader and TagGenerator, and there is some Atom specific data and logic scattered throughout, including projectPath added in this PR, as well as the workspace appropriate naming in viewForItem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find the ctags file in .git/tags?
2 participants