• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Valloric / ycmd / 1857
94%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2016 06:16PM UTC
Jobs 1
Files 40
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1857

push

travis-ci

homu
Auto merge of #455 - puremourning:unicode-investigation, r=Valloric

[READY] Fix issues with multi-byte characters

## Summary

This change introduces more general support for non-ASCII characters in buffers handled by YCMD.

In ycmd's public API, all offsets are byte offsets into the UTF-8 encoded buffers. We also assume (because, we have no other choice) that files stored on disk are also UTF-8 encoded. Internally, almost all of ycmd's functionality operates on unicode strings (python 2 `unicode()` and python 3 `str()` objects, transparently via `future`). Many of the downstream completion engines expect unicode code points as the offsets in their APIs. One special case is the `ycm_core` library (identifier completer and clang completer), which requires instances of the _native_ `str` type. All strings used within the c++ using `boost::python` require passing through `ToCppStringCompatible`

Previously, we were largely just assuming that `code point == byte offset` - i.e. all buffers contained only ASCII characters. This worked up to a point, but more by luck than judgement in a number of places.

## References

In combination with a YCM change and PR https://github.com/Valloric/ycmd/pull/453, I hope this:

- fixes https://github.com/Valloric/ycmd/issues/109
- fixes https://github.com/Valloric/YouCompleteMe/issues/2096
- fixes https://github.com/Valloric/YouCompleteMe/issues/2088
- fixes https://github.com/Valloric/YouCompleteMe/issues/2069
- fixes https://github.com/Valloric/YouCompleteMe/issues/2066
- fixes https://github.com/Valloric/YouCompleteMe/issues/1378

## Overview of changes

The changes fall into the following areas:

- Providing access to and conversion to/from code points and byte offsets (`request_wrap.py`)
- Changing certain algorithms/features to work entirely in codepoint space when they are trying to operate on logical 'characters' within the buffer (see known issues for why this isn't perfect, but probably most of the way there)
... (continued)

125 of 125 new or added lines in 14 files covered. (100.0%)

3028 of 3574 relevant lines covered (84.72%)

0.85 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
100.0
ycmd/completers/typescript/typescript_completer.py
2
100.0
ycmd/request_wrap.py
Jobs
ID Job ID Ran Files Coverage
1 1857.1 (USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7 COVERAGE=true) 24 Apr 2016 06:16PM UTC 0
84.72
Travis Job 1857.1
Source Files on build 1857
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1857
  • a3c41b4f on github
  • Prev Build on master (#1851)
  • Next Build on master (#1875)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc