@@ -108,10 +108,10 @@ defmodule NextLS.DB do
108
108
__query__ (
109
109
{ conn , s . logger } ,
110
110
~Q"""
111
- INSERT INTO symbols (module, file, type, name, line, 'column', source)
112
- VALUES (?, ?, ?, ?, ?, ?, ?);
111
+ INSERT INTO symbols (module, file, type, name, line, 'column', 'end_column', source)
112
+ VALUES (?, ?, ?, ?, ?, ?, ?, ? );
113
113
""" ,
114
- [ mod , file , "defmodule" , mod , module_line , 1 , source ]
114
+ [ mod , file , "defmodule" , mod , module_line , 1 , String . length ( Macro . to_string ( mod ) ) , source ]
115
115
)
116
116
117
117
if struct do
@@ -120,19 +120,28 @@ defmodule NextLS.DB do
120
120
__query__ (
121
121
{ conn , s . logger } ,
122
122
~Q"""
123
- INSERT INTO symbols (module, file, type, name, line, 'column', source)
124
- VALUES (?, ?, ?, ?, ?, ?, ?);
123
+ INSERT INTO symbols (module, file, type, name, line, 'column', 'end_column', source)
124
+ VALUES (?, ?, ?, ?, ?, ?, ?, ? );
125
125
""" ,
126
- [ mod , file , "defstruct" , "%#{ Macro . to_string ( mod ) } {}" , meta [ :line ] , 1 , source ]
126
+ [
127
+ mod ,
128
+ file ,
129
+ "defstruct" ,
130
+ "%#{ Macro . to_string ( mod ) } {}" ,
131
+ meta [ :line ] ,
132
+ meta [ :column ] || 1 ,
133
+ meta [ :column ] || 1 ,
134
+ source
135
+ ]
127
136
)
128
137
end
129
138
130
139
for { name , { :v1 , type , _meta , clauses } } <- defs , { meta , params , _ , _ } <- clauses do
131
140
__query__ (
132
141
{ conn , s . logger } ,
133
142
~Q"""
134
- INSERT INTO symbols (module, file, type, name, params, line, 'column', source)
135
- VALUES (?, ?, ?, ?, ?, ?, ?, ?);
143
+ INSERT INTO symbols (module, file, type, name, params, line, 'column', end_column, source)
144
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ? );
136
145
""" ,
137
146
[
138
147
mod ,
@@ -142,6 +151,7 @@ defmodule NextLS.DB do
142
151
:erlang . term_to_binary ( params ) ,
143
152
meta [ :line ] ,
144
153
meta [ :column ] || 1 ,
154
+ ( meta [ :column ] || 1 ) + String . length ( to_string ( name ) ) - 1 ,
145
155
source
146
156
]
147
157
)
@@ -151,10 +161,10 @@ defmodule NextLS.DB do
151
161
__query__ (
152
162
{ conn , s . logger } ,
153
163
~Q"""
154
- INSERT INTO symbols (module, file, type, name, line, 'column', source)
155
- VALUES (?, ?, ?, ?, ?, ?, ?);
164
+ INSERT INTO symbols (module, file, type, name, line, 'column', 'end_column', source)
165
+ VALUES (?, ?, ?, ?, ?, ?, ?, ? );
156
166
""" ,
157
- [ mod , file , type , name , line , column , source ]
167
+ [ mod , file , type , name , line , column , column + String . length ( to_string ( name ) ) - 1 , source ]
158
168
)
159
169
end
160
170
0 commit comments