This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Don't insert absolute paths, give up instead.
ClosedPublic

Authored by sammccall on Jul 6 2019, 2:55 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Jul 6 2019, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2019, 2:55 PM
kadircet accepted this revision.Jul 8 2019, 4:28 AM
kadircet added inline comments.
clang-tools-extra/clangd/Headers.cpp
206 ↗(On Diff #208284)

why not directly replace with ""?

clang-tools-extra/clangd/unittests/HeadersTests.cpp
100 ↗(On Diff #208284)

can you also log the error ?

This revision is now accepted and ready to land.Jul 8 2019, 4:28 AM
sammccall marked an inline comment as done.Jul 8 2019, 11:04 AM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/HeadersTests.cpp
100 ↗(On Diff #208284)

I'm a bit confused about this - why do we need to log it in a unit test?

sammccall marked 2 inline comments as done.Jul 8 2019, 11:07 AM
sammccall added inline comments.
clang-tools-extra/clangd/Headers.cpp
206 ↗(On Diff #208284)

Because replace_path_prefix("/foo/bar.c", "/foo", "") yields "/bar.c" rather than "bar.c". Added a comment.

This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.