Created
April 11, 2011 22:42
-
-
Save MarkBorcherding/914528 to your computer and use it in GitHub Desktop.
Powershell ctags settings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, already some years old and was still valuable, at least for me ;) I had a small issue with the above config. The second langmap overwrites the first one. So my functions in the module weren't indexed. I put my change to your gist if someone else is also searching for that. I use Pester tests within the subfolder "test".
Either we use
--langmap=Powershell:.psm1 --langmap=Powershell:+.ps1or directly with one langmap arg
--langmap=Powershell:.psm1.ps1In a oneliner (functions and all occurences for $<..>)
ctags -R --langdef=Powershell --langmap=Powershell:.psm1.ps1 --regex-Powershell="/function\s+(script:)?([a-zA-Z\-]+)/\2/f, function/i" --regex-Powershell="/\$(global:)?([a-zA-Z\-]+)/\2/v, variable/i" --exclude=testThat gave me too much variable definitions, so a way around that would be to write the type directly in front of the variable name and use that to filter only for the variable definitions where it looks like [] $<..>...
ctags -R --langdef=Powershell --langmap=Powershell:.psm1.ps1 --regex-Powershell="/function\s+(script:)?([a-zA-Z\-]+)/\2/m, method/i" --regex-Powershell="/\s*\[.*\]\s*\$([a-zA-Z\-]+)/\1/v, variable/i" --regex-Powershell="/\$global:([a-zA-Z\-]+)/\1/v, globalvariable/i" --exclude=testHope it helps others.