Comments (14)
Could you create a minimum cpp file and send it me?
You also need (setq counsel-etags-debug t)
, reproduce the issue and send me emacs output.
Besides, as I see from the tags file, you might need use relative path to create tags file. Use ctags -R -e .
instead of ctags -R -e C:\projs1
from counsel-etags.
main.cpp.txt
I get the following emacs output:
No project found. You can create tags file using ‘counsel-etags-scan-code’.
So we don’t need project root at all. Or you can setup ‘counsel-etags-project-root’.
c:\\cygwin64\\bin\\find.exe . \( -iwholename "*/.vscode" -or -iwholename "*/tools" -or -iwholename "*/test" -or -iwholename "*/extern" -or -iwholename "*/doc" -or -iwholename "*/deps" -or -iwholename "*/data" -or -iwholename "*/build" -or -iwholename "*/.git" -or -iwholename "*/.svn" -or -iwholename "*/.cvs" -or -iwholename "*/.bzr" -or -iwholename "*/.hg" -or -iwholename "*/bin" -or -iwholename "*/fonts" -or -iwholename "*/images" -or -iwholename "*/.DS_Store" -or -iwholename "*/.npm" -or -iwholename "*/.tmp" -or -iwholename "*/.sass-cache" -or -iwholename "*/.idea" -or -iwholename "*/node_modules" -or -iwholename "*/bower_components" -or -iwholename "*/.tox" -or -iwholename "*/.cask" \) -prune -o -type f -not -size +800k -not -name ".clang-format" -not -name "*.json" -not -name "*.log" -not -name "tags" -not -name "TAGS" -not -name "*.tgz" -not -name "*.gz" -not -name "*.xz" -not -name "*.zip" -not -name "*.tar" -not -name "*.rar" -not -name "GTAGS" -not -name "GPATH" -not -name "GRTAGS" -not -name "cscope.files" -not -name "*bundle.js" -not -name "*min.js" -not -name "*min.css" -not -name "*.png" -not -name "*.jpg" -not -name "*.jpeg" -not -name "*.gif" -not -name "*.bmp" -not -name "*.tiff" -not -name "*.ico" -not -name "*.doc" -not -name "*.docx" -not -name "*.xls" -not -name "*.ppt" -not -name "*.pdf" -not -name "*.odt" -not -name "*.obj" -not -name "*.so" -not -name "*.o" -not -name "*.a" -not -name "*.ifso" -not -name "*.tbd" -not -name "*.dylib" -not -name "*.lib" -not -name "*.d" -not -name "*.dll" -not -name "*.exe" -not -name ".metadata*" -not -name "*.class" -not -name "*.war" -not -name "*.jar" -not -name "*flymake" -not -name "#*#" -not -name ".#*" -not -name "*.swp" -not -name "*~" -not -name "*.elc" -not -name "*.pyc" -print | ctags -e -L - at e:/projects/workspace/projects/etagsrepro/
counsel-etags-collect-cands: Wrong type argument: stringp, nil
‘c:\\cygwin64\\bin\\find.exe . \( -iwholename "*/.vscode" -or -iwholename "*/tools" -or -iwholename "*/test" -or -iwholename "*/extern" -or -iwholename "*/doc" -or -iwholename "*/deps" -or -iwholename "*/data" -or -iwholename "*/build" -or -iwholename "*/.git" -or -iwholename "*/.svn" -or -iwholename "*/.cvs" -or -iwholename "*/.bzr" -or -iwholename "*/.hg" -or -iwholename "*/bin" -or -iwholename "*/fonts" -or -iwholename "*/images" -or -iwholename "*/.DS_Store" -or -iwholename "*/.npm" -or -iwholename "*/.tmp" -or -iwholename "*/.sass-cache" -or -iwholename "*/.idea" -or -iwholename "*/node_modules" -or -iwholename "*/bower_components" -or -iwholename "*/.tox" -or -iwholename "*/.cask" \) -prune -o -type f -not -size +800k -not -name ".clang-format" -not -name "*.json" -not -name "*.log" -not -name "tags" -not -name "TAGS" -not -name "*.tgz" -not -name "*.gz" -not -name "*.xz" -not -name "*.zip" -not -name "*.tar" -not -name "*.rar" -not -name "GTAGS" -not -name "GPATH" -not -name "GRTAGS" -not -name "cscope.files" -not -name "*bundle.js" -not -name "*min.js" -not -name "*min.css" -not -name "*.png" -not -name "*.jpg" -not -name "*.jpeg" -not -name "*.gif" -not -name "*.bmp" -not -name "*.tiff" -not -name "*.ico" -not -name "*.doc" -not -name "*.docx" -not -name "*.xls" -not -name "*.ppt" -not -name "*.pdf" -not -name "*.odt" -not -name "*.obj" -not -name "*.so" -not -name "*.o" -not -name "*.a" -not -name "*.ifso" -not -name "*.tbd" -not -name "*.dylib" -not -name "*.lib" -not -name "*.d" -not -name "*.dll" -not -name "*.exe" -not -name ".metadata*" -not -name "*.class" -not -name "*.war" -not -name "*.jar" -not -name "*flymake" -not -name "#*#" -not -name ".#*" -not -name "*.swp" -not -name "*~" -not -name "*.elc" -not -name "*.pyc" -print | ctags -e -L -‘ executed.
Tags file e:/projects/workspace/projects/etagsrepro/TAGS was created.
Read file .... nil 140
tags-file=e:/projects/workspace/projects/etagsrepro/TAGS
counsel-etags-cache[tags-file]=nil
force-tags-file=e:/projects/workspace/projects/etagsrepro/TAGS tags-file=e:/projects/workspace/projects/etagsrepro/TAGS
tagname=add
Note: file is write protected
counsel-etags-open-file-api: Search failed: "add"
Looking at my emacs config I don't see any explicit usage of ctags, so it should just be using the defaults.
EDIT:
FWIW, I tried it on my linux machine and it seems to have stopped working completely.
This is the ouptut:
find . \( -iwholename "*/.vscode" -or -iwholename "*/tools" -or -iwholename "*/test" -or -iwholename "*/extern" -or -iwholename "*/doc" -or -iwholename "*/deps" -or -iwholename "*/data" -or -iwholename "*/build" -or -iwholename "*/.git" -or -iwholename "*/.svn" -or -iwholename "*/.cvs" -or -iwholename "*/.bzr" -or -iwholename "*/.hg" -or -iwholename "*/bin" -or -iwholename "*/fonts" -or -iwholename "*/images" -or -iwholename "*/.DS_Store" -or -iwholename "*/.npm" -or -iwholename "*/.tmp" -or -iwholename "*/.sass-cache" -or -iwholename "*/.idea" -or -iwholename "*/node_modules" -or -iwholename "*/bower_components" -or -iwholename "*/.tox" -or -iwholename "*/.cask" \) -prune -o -type f -not -size +800k -not -name ".clang-format" -not -name "*.json" -not -name "*.log" -not -name "tags" -not -name "TAGS" -not -name "*.tgz" -not -name "*.gz" -not -name "*.xz" -not -name "*.zip" -not -name "*.tar" -not -name "*.rar" -not -name "GTAGS" -not -name "GPATH" -not -name "GRTAGS" -not -name "cscope.files" -not -name "*bundle.js" -not -name "*min.js" -not -name "*min.css" -not -name "*.png" -not -name "*.jpg" -not -name "*.jpeg" -not -name "*.gif" -not -name "*.bmp" -not -name "*.tiff" -not -name "*.ico" -not -name "*.doc" -not -name "*.docx" -not -name "*.xls" -not -name "*.ppt" -not -name "*.pdf" -not -name "*.odt" -not -name "*.obj" -not -name "*.so" -not -name "*.o" -not -name "*.a" -not -name "*.ifso" -not -name "*.tbd" -not -name "*.dylib" -not -name "*.lib" -not -name "*.d" -not -name "*.dll" -not -name "*.exe" -not -name ".metadata*" -not -name "*.class" -not -name "*.war" -not -name "*.jar" -not -name "*flymake" -not -name "#*#" -not -name ".#*" -not -name "*.swp" -not -name "*~" -not -name "*.elc" -not -name "*.pyc" -print | ctags -e -L - at /home/beni/workspace/projects/sprout/
counsel-etags-collect-cands: Wrong type argument: stringp, nil
error in process filter: Wrong type argument: markerp, nil [2 times]
Failed to create tags file.
from counsel-etags.
3c42153 tested on windows (Chen Bin)
from counsel-etags.
On this windows machine the last update also causes the generation of the tags file to fail (As on linux, but slightly different message).
counsel-etags-scan-dir called => e:/projects/workspace/projects/sprout/ t
You need install ctags first.
counsel-etags-get-scan-command called => find-pg=c:\\cygwin64\\bin\\find.exe ctags-pg=nil cmd=
counsel-etags-scan-dir-internal called => src-dir=e:/projects/workspace/projects/sprout/ force=t find-pg=c:\\cygwin64\\bin\\find.exe ctags-pg=nil default-directory=e:/projects/workspace/projects/sprout/ cmd=
at e:/projects/workspace/projects/sprout/
counsel-etags-find-tag-api called => sample nil nil
error in process filter: Wrong type argument: markerp, nil [2 times]
Failed to create tags file.
If the TAGS file already exists it still fails to open the file from the results, but the error message has changed again. (Counsel-etags still shows the duplicated paths in the results list.)
counsel-etags-find-tag-api called => getName nil e:/workspace/p2render/
counsel-etags-collect-cands called tagname=getName fuzz=nil dir=e:/workspace/p2render/
tags-file=e:/workspace/p2render/TAGS
counsel-etags-cache[tags-file]=nil
force-tags-file=e:/workspace/p2render/TAGS tags-file=e:/workspace/p2render/TAGS
tagname=getName
Note: file is write protected
counsel-etags-open-file-api: Search failed: "getName"
from counsel-etags.
Does c:\cygwin64\bin\ctags.exe
exist? Have you installed ctags? Or maybe reinstall ctags?
What's the result of (file-executable-p "c:\\\\cygwin64\\\\bin\\\\\ctags.exe")
?
from counsel-etags.
Actually, ctags was not installed under cygwin, but I had a binary lying around somewhere else. After installing cygwin ctags an regenerating the tags file it works! Sorry for the confusion, but I didn't understand what was going on, because it just stopped working some day.
Thanks for helping me out. I find counsel-etags very helpful in navigating code bases and use it regularly!
Now I noticed a few other things but they might be more related to ctags in general then etags-counsel in particular.
- Can *.inl files be included in the tags data base?
- I noticed that function declarations with line breaks are not properly represented in the TAGS file. They seem to cause truncated lines in the tags file. The attached file is quite short and has two examples of this.
prop_intersection.hpp.txt - The quality of the search results sometimes has problems. E.g. when looking up method sample() (lower case), I get many hits for classes called Sample (upper case). I cannot tell whether this always was the case and I just stumbled upon it now, or if it is a new problem.
from counsel-etags.
Yeah, I should warn user when ctags is not installed.
ctags can support any language because in essence it's just regular expression, check its documentation and my ctags setup on README.
I was also a good C++ developer so I understand your concern.
I intentionally to make the initial tag search more generic because it's actually more efficent.
If you get multliple canidates, press !keyword1\|keyword2
to filter out results (when filtering, it's actually case sensitive regular expression but space means .*
).
That's actually faster because you don't need worry about case and which part of tag name you input. For example, to manually search "MyFunctionName", you can input "yfun"
from counsel-etags.
I could solve problem 1 & 2 simply by manually copying a windows build of universal ctags into the cygwin directory!
That's actually faster because you don't need worry about case and which part of tag name you input. For example, to manually search "MyFunctionName", you can input "yun"
Fair enough, I can see how that can be useful. However, I generally use find-tag-at-point, and in that specific case I would argue that the most helpful action would be to exclude tags that cannot reasonably be the thing at point (e.g. function vs. class).
If it is a matter of implementation efficiency that would slow down every other aspect I can see why you made that decision, though. If CPU time is not the issue, it might even be cool to try to narrow it down further by looking at the signature
from counsel-etags.
Maybe it's good idea that find-tag-at-point
should initiate case sensitive search.
I'm concerned that any "smarter" algorithm makes counsel-etags
slower and less generic.
On the other hand, I agreed user should have freedom to extend the program.
What about giving you a callback function to filter the candidates with original context (the file name and line number where to start search the tag) as parameter?
from counsel-etags.
Maybe it's good idea that
find-tag-at-point
should initiate case sensitive search.
I would like that.
I'm concerned that any "smarter" algorithm makes
counsel-etags
slower and less generic.
Makes sense to me.
What about giving you a callback function to filter the candidates with original context (the file name and line number where to start search the tag) as parameter?
Sounds good. But on the other hand I must be the worst elisp programmer using emacs so I'm not sure what I would do with it.
As it is, counsel-etags is a very helpful tool for me. Thanks for sharing it.
from counsel-etags.
need some use cases:
- in
js2-mode
,this.fn1
, if current font facejs2-object-property-access
, try to get parent node name, if parent isthis
, at least we could exclude candidates likefn1={abce}
.
from counsel-etags.
In many languages one could try to differentiate between variables and functions based on trailing brackets. E.g. a = a();
from counsel-etags.
85ef653 add smart rules to filter out noise (Chen Bin)
I added plugin system. Now only support javascript. But I'm open to new rule for C++.
from counsel-etags.
Ah, cool. My lisp is very bad but I might give it a try some time.
from counsel-etags.
Related Issues (20)
- counsel-etags-grep cant' follow parameters? HOT 6
- Issue with creating a TAGS file when in Tramp mode HOT 2
- counsel-etags did not auto update TAG file. HOT 11
- need CI and tdd HOT 1
- How to color candidate/selection when 'counsel-etags-grep' like swiper does? HOT 8
- could add function name in when looking up tags
- how to do case insensitive grep? HOT 4
- When calling "counsel-etags-find-tag-at-point", rg report separator is error HOT 6
- Unable to use counsel-etags-grep under the windows version of emacs (spacemacs) HOT 3
- Ctags Will Scan Code When Jump Next Tag HOT 12
- How to go back to previous position after I executed counsel-etags-find-tag-at-point ? HOT 2
- 如何指定tag的输出路径 HOT 4
- about ctags cache HOT 4
- counsel-etags-find-tag-at-point-other-window
- How can I append external tags? HOT 4
- Please don't provide a feature in my-byte-compile HOT 2
- "No tag is found." although TAGS file contains this tag HOT 6
- Counsel-etags-grep can only find results in some files HOT 6
- 当tag搜索不到想要的内容时回退到使用ripgrep HOT 4
- 调用 counsel-etags-grep 时可以忽略tag文件 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from counsel-etags.