-
Notifications
You must be signed in to change notification settings - Fork 629
/
ctags-lang-julia.7.rst.in
124 lines (92 loc) · 4.16 KB
/
ctags-lang-julia.7.rst.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.. _ctags-lang-julia(7):
==============================================================
ctags-lang-julia
==============================================================
-------------------------------------------------------------------
Random notes about tagging Julia source code with Universal-ctags
-------------------------------------------------------------------
:Version: @VERSION@
:Manual group: Universal-ctags
:Manual section: 7
SYNOPSIS
--------
| **@CTAGS_NAME_EXECUTABLE@** ... --languages=+Julia ...
| **@CTAGS_NAME_EXECUTABLE@** ... --language-force=Julia ...
| **@CTAGS_NAME_EXECUTABLE@** ... --map-Julia=+.jl ...
DESCRIPTION
-----------
This man page gathers random notes about tagging Julia source code.
TAGGING ``import`` AND ``using`` EXPRESSIONS
--------------------------------------------
Summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`using X`
==== ========== ================== ===================
name kind role other noticeable fields
==== ========== ================== ===================
X module used N/A
==== ========== ================== ===================
`using X: a, b`
==== ========== ================== ===================
name kind role other noticeable fields
==== ========== ================== ===================
X module namespace N/A
a, b unknown used scope:module:X
==== ========== ================== ===================
`import X`
==== ========== ================== ===================
name kind role other noticeable fields
==== ========== ================== ===================
X module imported N/A
==== ========== ================== ===================
`import X.a, Y.b`
==== ========== ================== ===================
name kind role other noticeable fields
==== ========== ================== ===================
X, Y module namespace N/A
a unknown imported scope:module:X
b unknown imported scope:module:Y
==== ========== ================== ===================
`import X: a, b`
==== ========== ================== ===================
name kind role other noticeable fields
==== ========== ================== ===================
X module namespace N/A
a,b unknown imported scope:module:X
==== ========== ================== ===================
Examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"input.jl"
.. code-block:: Julia
using X0
"output.tags"
with "--options=NONE -o - --extras=+r --fields=+rzK input.jl"
.. code-block:: tags
X0 input.jl /^using X0$/;" kind:module roles:used
``--extras=+r`` (or ``--extras=+{reference}``) option is needed for this tag,
since it's a reference tag. This is because module ``X`` is not defined here.
It is defined in another file. Enable ``roles:`` field with ``--fields=+r`` is
for recording that the module is "used", i.e., loaded by ``using``.
"input.jl"
.. code-block:: Julia
import X1.a, X2.b, X3
"output.tags"
with "--options=NONE -o - --extras=+r --fields=+rzKZ input.jl"
.. code-block:: tags
X1 input.jl /^import X1.a, X2.b, X3$/;" kind:module roles:namespace
X2 input.jl /^import X1.a, X2.b, X3$/;" kind:module roles:namespace
X3 input.jl /^import X1.a, X2.b, X3$/;" kind:module roles:imported
a input.jl /^import X1.a, X2.b, X3$/;" kind:unknown scope:module:X1 roles:imported
b input.jl /^import X1.a, X2.b, X3$/;" kind:unknown scope:module:X2 roles:imported
Why ``X1`` and ``X2`` have role "namespace", while ``X3`` have role "imported"?
It's because the symbol ``a`` in module ``X1``, and ``b`` in module ``X2`` are
brought to the current scope, but ``X1`` and ``X2`` themselves are not. We use
"namespace" role for such modules.
``X3`` is different. The symbol ``X3``, together with all exported symbols in
``X3``, is brought to current scope. For such modules, we use "imported" or
"used" role depending whether they are loaded by ``import`` or ``using``.
Also, notice that ``a`` and ``b`` have the "unknown" kind. This is because we
cannot know whether it's a function, constant, or macro, etc.
SEE ALSO
--------
ctags(1), ctags-client-tools(7)