Closed LazyRen closed 6 years ago
Ah good catch on the output attribute, thank you!
I wonder what is in your cscope database, or at least what is returned by the lookup. Can you please run this command from a terminal prompt (replace "XXX" with a symbol in your project) and paste the output in a comment?
cscope -dL -f `pwd`/cscope.out -0XXX
Thank you!
at first it returned "cannot read trailer offset from file cscope.out". It was due to spaces on pwd. so I've changed all spaces within path. Now it returns
cscope -dL -f cscope.out -0exec defs.h panic 26 int exec(char *, char ); exec.c exec 11 exec(char *path, char *argv) init.c main 30 exec("sh", argv); sh.c runcmd 78 exec(ecmd->argv[0], ecmd->argv); sysfile.c sys_exec 420 return exec(path, argv); user.h exit 13 int exec(char , char ); usertests.c exectest 297 if(exec("echo", echoargv) < 0){ usertests.c bigargtest 1626 exec("echo", args); usys.S SYSCALL 19 SYSCALL(exec)
from the terminal.
After rebuilding cscope.file now sublimescscope works fine. I guess spaces in path screwed everything. Thank you for fast response.
Actually, I think it wasn't the spaces... I think you had non-ascii characters in your path? I think this might still be a problem....
Yes I had non-ascii char(korean). But I still have those, and it works fine. Only thing I’ve changed is removing white space from the path.
here is what I get from using cscope
defs.h: 26 [scope: panic] int exec(char *, char **); . . .(keep goes on)
I used to have white spaces "Google 드라이브/3 - 1" like this.
That's weird. The original error was "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 67: ordinal not in range(128)". I thought that was coming from the non-ascii characters in your path. But you're saying you still have those in your path and now cscopesublime plugin works fine and finds results?
yes indeed
But after a bit search on the problem. I think it might be the problem of filename encoding. I used this path for my google drive which is used by both windows and mac. Windows use utf16 for the filename while mac uses utf8. While removing white spaces from the file name maybe the encoding also got changed and I guess that might have solved the problem?
Thus cscope works fine with white spaces existing in filename usually?
Yeah I think you might be right there. It seems to be an encoding issue. Or it could be a spaces in the directory or filename issue?
Here's a quick test I did, using just cscope and not even Sublime Text:
~/Test Directory With Spaces In The Directory/TestCapsLockSync ❮❮❮ /opt/homebrew/bin/cscope -Rbq
~/Test Directory With Spaces In The Directory/TestCapsLockSync ❮❮❮ /opt/homebrew/bin/cscope -dL -f "`pwd`/cscope.out" -0Something
cscope: cannot read trailer offset from file /Users/jkasper/Test Directory With Spaces In The Directory/TestCapsLockSync/cscope.out
https://groups.google.com/forum/#!topic/vim_use/NWpWK0Q4mdE seems to indicate that cscope itself can't handle spaces in the path?? I can't believe I've never hit this problem before. =:/
So I've fixed the output attribute error. Thanks very much for reporting that, @LazyRen! I guess I'm not sure what to do with this issue at this point. Is there anything that is actionable now? What would you like me to do with this? Or I guess I'm assuming from your comments that both cscope and CscopeSublime are working correctly for you after changing your paths on your system? Or have you found a situation where cscope works but CscopeSublime does not work correctly?
I guess now it’s matter of cscope developer for the space issues... Thank you for fast response and such a good package. For the encoding matter, I don’t see the ways to fix it.
Ok, well I'll mark this as closed for now. Thanks again for the help, @LazyRen. If you hit any more problems, please let me know and open a new issue for it! =:)
I once had CscopeSublimeSearchWorker has no attribute "output" so I used Package Resource Viewer to add self.output = "" for Worker class. It now does not provide any error for such, but I still get only empty file opened when I type commands for cscope.
And here is the new(or existed but ignored because of above error) error that I get when I launch cscope.
Traceback (most recent call last): File "./python3.3/threading.py", line 901, in _bootstrap_inner File "/Users/LazyRen/Library/Application Support/Sublime Text 3/Packages/Cscope/cscope.py", line 397, in run matches = self.run_cscope(self.mode, self.symbol) File "/Users/LazyRen/Library/Application Support/Sublime Text 3/Packages/Cscope/cscope.py", line 377, in run_cscope output, erroroutput = proc.communicate() File "./python3.3/subprocess.py", line 920, in communicate File "./python3.3/subprocess.py", line 1577, in _communicate File "./python3.3/subprocess.py", line 848, in _translate_newlines UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 67: ordinal not in range(128)