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 | 820e2b62a9a88542db41733bfda72ad77888ad3a (patch) | |
tree | 956d2989f65a25b1b6b9e7dd474b96138b70a57e /utils.py | |
parent | 673316bb83c4fac55bd854b66f2165e32c17a409 (diff) | |
download | pylint-git-820e2b62a9a88542db41733bfda72ad77888ad3a.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""" |