diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-06-16 19:20:23 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-06-16 19:20:23 +0200 |
commit | 2ece50559bea3ea01aabea7fba3cc3173ff25270 (patch) | |
tree | 8e8b3e23eb92740581a3a6e6575417c777c46503 /utils.py | |
parent | 8de73909a123440e7ae42a27297e91ae11a6585f (diff) | |
download | pylint-2ece50559bea3ea01aabea7fba3cc3173ff25270.tar.gz |
closes #69220: add column offset to the astng node
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -249,6 +249,11 @@ class MessagesHandlerMixIn: """ if line is None and node is not None: line = node.fromlineno + + col_offset = None + if hasattr(node, 'col_offset'): + col_offset = node.col_offset #measured in bytes for utf-8, divide by two for chars? + # should this message be displayed if not self.is_message_enabled(msgid, line): return @@ -273,7 +278,7 @@ class MessagesHandlerMixIn: module, obj = get_module_and_frameid(node) path = node.root().file # add the message - self.reporter.add_message(msgid, (path, module, obj, line or 1), msg) + self.reporter.add_message(msgid, (path, module, obj, line or 1, col_offset or 0), msg) def help_message(self, msgids): """display help messages for the given message identifiers""" |