[Github-comments] [geany/geany] Use cxx parser from uctags (PR #3032)

Masatake YAMATO notifications at xxxxx
Thu Dec 2 12:30:40 UTC 2021


> Those multiple scope separators in PHP are quite unpleasant though - our code currently assumes there's a single type of scope separator per language. I guess the easiest way for us will be to rewrite tags we receive from ctags to have a single type of scope separator. Is there any other language that uses multiple types of scope separators?

Some of the parsers use scopeSeparator API.
Some of the parsers don't use the API. So I cannot answer the question quickly.
What I know are:

* dtd,
* itcl running on tcl
* tcloo running on tcl

these parsers use the API, and specifies different separators.
  
>  (I'm not sure if multiple types of scope separators are a good idea even if the given language uses these for certain kinds - I think tools processing ctags files won't be very happy they have to deal with this.)

Understandable. However, I wanted to make ctags pass extracted information to client tools including Geany as is.
I thought ctags should not do too clever. Reducing information can be done in a client tool. In ctags level, just passing too much information is better than reducing information.  Even if a target language doing wrong, ctags doesn't try to fix it. This basic rule makes the development ctags a bit easier.

What ctags can do is providing more API for:
(1) getting separators, and
(2) adjusting separators as a client tool wants when making tags.


It seems that you misunderstand the meaning of roles.
Basically, roles are for reference tags.
I would like you to read https://docs.ctags.io/en/latest/output-tags.html?highlight=reference%20tags#reference-tags .
If a user doesn't need reference tags, pass `--extras=-r` to ctags. You may be able to do the same in C language.
```
enum { 	XTAG_REFERENCE_TAGS, };
extern bool enableXtag (xtagType type, bool state);
```

> After thinking about it for a while, is it actually a good idea to distinguish between imports and package definitions using a role in go (and possibly some other languages)?

`import X` defines nothing.
`import X` refers X as a package defined somewhere. So ctags extracts X as a reference tag with package kind with the imported role.

The difference between Python and Go comes from the grammar(?) of Python.
Unlike Go, in the text of a Python script, there is no keyword for defining a module.

See also https://github.com/universal-ctags/ctags/issues/2428.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3032#issuecomment-984584737
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211202/f8090b0f/attachment-0001.htm>


More information about the Github-comments mailing list