[clangd] Change PreambleOnlyAction with content truncation
authorKadir Cetinkaya <kadircet@google.com>
Tue, 5 May 2020 15:55:11 +0000 (17:55 +0200)
committerKadir Cetinkaya <kadircet@google.com>
Tue, 26 May 2020 05:37:03 +0000 (07:37 +0200)
commit34e39eb2adc2b3f16c2c2c0607a904ee55705c01
treeeea829d818db6c8fd93bdc755ab28eefb2988b95
parenteeedbd033612e105755156023bdeec2fba4eca21
[clangd] Change PreambleOnlyAction with content truncation

Summary:
Lexing until the token location is past preamble bound could be wrong
in some cases as preprocessor lexer can lex multiple tokens in a single call.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79426
clang-tools-extra/clangd/Preamble.cpp
clang-tools-extra/clangd/unittests/PreambleTests.cpp