HomePhabricator

[clangd] Serve comments for headers decls from dynamic index only

Description

[clangd] Serve comments for headers decls from dynamic index only

Summary:
To fix a crash in code completion that occurrs when reading doc
comments from files that were updated after the preamble was
computed. In that case, the files on disk could've been changed and we
can't rely on finding the comment text with the same range anymore.

The current workaround is to not provide comments from the headers at
all and rely on the dynamic index instead.

A more principled solution would be to store contents of the files
read inside the preamble, but it is way harder to implement properly,
given that it would definitely increase the sizes of the preamble.

Together with D47272, this should fix all preamble-related crashes
we're aware of.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, ioeric, MaskRay, jkorous, cfe-commits

Differential Revision: https://reviews.llvm.org/D47274

Details

Committed
ibiryukovMay 24 2018, 7:49 AM
Reviewer
sammccall
Differential Revision
D47274: [clangd] Serve comments for headers decls from dynamic index only
Parents
rL333188: [clangd] Skip .inc headers when canonicalizing header #include.
Branches
Unknown
Tags
Unknown