all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [elpa] 02/04: company-clang: handle multibyte chars between bol and point
Date: Thu, 20 Mar 2014 06:10:09 +0200	[thread overview]
Message-ID: <532A6A21.8040802@yandex.ru> (raw)
In-Reply-To: <83k3bp8qrz.fsf@gnu.org>

On 20.03.2014 05:58, Eli Zaretskii wrote:

> Please tell the details: what does "don't work" mean?

It means that Clang returns a wrong list of completions.

Take this test file, for example:

===
typedef struct test_s {
   int num_a;
   long num_b;
   char c;
} test_t;

int main(int args, char *argv[]) {
   test_t tt;
   /*ыыы*/tt.;
   return 0;
}
===

Put point after `.', type `M-x company-clang'. The list of completions 
should include 3 items, from the struct test_t.

"Doesn't work" usually means that it returns a different, much longer 
list. So, with the above file saved in UTF-8, either approach works. But 
when it's in UTF-16, only the current one succeeds.

> The question is not what Clang uses, the question is how does it
> expect the offsets to be supplied for files encoded in different
> encodings.  That is something that should be described in the Clang
> manuals.

Either it isn't, or I don't know what to search for.

 > I assumed that it needs offsets in bytes, but that
> assumption was not based on anything except looking at your code.

The docstring for the relevant function 
(http://clang.llvm.org/doxygen/group__CINDEX__CODE__COMPLET.html#ga50fedfa85d8d1517363952f2e10aa3bf) 
says "column", but apparently it has a special notion of columns. For 
example, it considers any tab character as taking only one column.



  reply	other threads:[~2014-03-20  4:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140319033013.17542.14344@vcs.savannah.gnu.org>
     [not found] ` <E1WQ7Co-0004c8-Lo@vcs.savannah.gnu.org>
2014-03-19 13:15   ` [elpa] 02/04: company-clang: handle multibyte chars between bol and point Stefan
2014-03-19 14:08     ` Dmitry Gutov
2014-03-19 16:54       ` Eli Zaretskii
2014-03-19 17:56         ` Dmitry Gutov
2014-03-19 18:33           ` Eli Zaretskii
2014-03-19 21:15             ` Dmitry Gutov
2014-03-20  2:56               ` Dmitry Gutov
2014-03-20  3:58                 ` Eli Zaretskii
2014-03-20  4:10                   ` Dmitry Gutov [this message]
2014-03-20 16:11                     ` Eli Zaretskii
2014-03-20 18:58                       ` Richard Stallman
2014-03-20 19:04                         ` Dmitry Gutov
2014-03-21 12:15                           ` Richard Stallman
2014-03-21  3:47                       ` Dmitry Gutov
2014-03-21  8:04                         ` Eli Zaretskii
2014-03-20  3:47               ` Eli Zaretskii
2014-03-19 16:40     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=532A6A21.8040802@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.