Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Avoid comments in tag search pattern #1

Open
hiberabyss opened this issue Mar 25, 2019 · 1 comment
Open

[Feature Request] Avoid comments in tag search pattern #1

hiberabyss opened this issue Mar 25, 2019 · 1 comment

Comments

@hiberabyss
Copy link

Sometimes, the comments are multi-bytes and not UTF-8 encoded. In this case, the comment bytes in tag file could not match the one in source codes, since the encoding is different.

Could an option provided to avoid comments in tag search pattern to avoid such problem?

Thanks!

@masatake
Copy link
Member

masatake commented Apr 1, 2019

This is difficult to solve.

The pattern fields are not made by a parser.
The common part of ctags makes the pattern from the line number told by a parser.
It means we cannot use the knowledge of the target programming language when making the pattern fields.

Introducing a hook to the parser to clean up the pattern is an idea I found.

  1. a pattern made by the common part "/* multi bytes string */".
  2. passing it to C parser to clean up.
  3. new pattern cleaned up by C parser "/* .* */".

Good idea at first glance.
However, this approach has a big limitation for the multi line comments.

/* multi
   bytes
   string */

If the parser receiving " string */" line, the C parser cannot recognize it as a comment block.

A more large-scale mechanism may be needed.

@masatake masatake transferred this issue from universal-ctags/ctags Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants