[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-11-03 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7f059a258a1d: [clangd] Handle absolute/relative path specifications in Config (authored by kadircet). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 301912. kadircet added a comment. - Explicitly handle FragmentDir.empty() case by returning Path as-is. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90270/new/ https://reviews.llvm.org/D90270 Files: clang-

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 2 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:170 + [PathMatch(std::move(PathMatch)), + FragmentDir(FragmentDirectory)](const Params &P) { if (P.Path.empty()) -

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Still LG but a few more nits Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:46 +// Returns an empty stringref if Path is not under FragmentDir. +llvm::StringRef configRelative(llvm::StringRef Path, you should document+verify

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:51 +return llvm::StringRef(); + return Path; +} sammccall wrote: > not that if Path == FragmentDir you're going to return "" which means "not > under". > I don't think th

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 301842. kadircet marked an inline comment as done. kadircet added a comment. - Return "." if Path == FragmentDir in conifgRelative. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90270/new/ https://reviews.llvm

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:51 +return llvm::StringRef(); + return Path; +} not that if Path == FragmentDir you're going to return "" which means "not under". I don't think this can happen yet, but

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:162 return false; +llvm::StringRef Path = P.Path; +// Ignore the file if it is not nested under Fragment and strip the sammccall wrote: >

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 301311. kadircet marked 6 inline comments as done. kadircet added a comment. - Make Directory a parameter of fromYAMLFile. - Factor out configRelative logic to a helper. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:75 llvm::SourceMgr *SourceMgr; + // Directory containing the fragment. Absolute path with forward slashes

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/ConfigProvider.cpp:124 std::vector Result; - Cache.read(FS, DC, P.FreshTime, Result); + Cache.read(FS, DC, P.FreshTime, Fragment::SourceInfo::Absolute, Result); return Result; ---

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-28 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 301280. kadircet marked 9 inline comments as done. kadircet added a comment. - Drop PathSpec, deduce it from emptyness of FragmentDirectory. - Make tests more homogenous. - Add path cannonicalization to compile stage. Repository: rG LLVM Github Monorepo

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks for doing this! Main points: - I think we should have one high-level concept of "the optional associated directory" rather than two low-level ones of "the location of the config file" and "should we use the location to form relative paths" - We need to be care

[PATCH] D90270: [clangd] Handle absolute/relative path specifications in Config

2020-10-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, arphaman. Herald added a project: clang. kadircet requested review of this revision. Herald added subscribers: ormris, MaskRay, ilya-biryukov. This introduces a mechanism for pro