universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
326 stars 26 forks source link

test, fix: set file name for get-definitions; fix C tests #109

Closed AmaiKinono closed 2 years ago

AmaiKinono commented 2 years ago

When a tag has file scope, and is not in current file, Citre filters them out from definitions.

For this to work in the tests, we should set buffer-file-name after load a file into the buffer.

This causes problems in existing C tests. The solution is change the extension from .c to .h so the file-local definitions become public.

@masatake I wonder if my change is acceptable?

AmaiKinono commented 2 years ago

@masatake Do you use Emacs 26?

I don't know why the tests failed on Emacs 26. It passed on Emacs 27 and 29 on my PC. I haven't find a way to downgrade to or install a Emacs 26 so I can't figure it out myself.

masatake commented 2 years ago

I'm using Emacs-27.2 for developing ctags. Thank you for considering my environment.

AmaiKinono commented 2 years ago

Now it passes the CI ;)

@masatake still, I'd like your comment on this

The solution is change the extension from .c to .h so the file-local definitions become public.

Is this acceptable? Based on my limited understanding of C, technically there's no difference between a .h and .c file, so this change shouldn't be misleading.