summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/URITests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Move clangd tests to clangd directory. check-clangd is no longer ↵Sam McCall2019-04-291-187/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part of check-clang-tools. Summary: Motivation: - this layout is a pain to work with - without a common root, it's painful to express things like "disable clangd" (D61122) - CMake/lit configs are a maintenance hazard, and the more the one-off hacks for various tools are entangled, the more we see apathy and non-ownership. This attempts to use the bare-minimum configuration needed (while still supporting the difficult cases: windows, standalone clang build, dynamic libs). In particular the lit.cfg.py and lit.site.cfg.py.in are merged into lit.cfg.in. The logic in these files is now minimal. (Much of clang-tools-extra's lit configs can probably be cleaned up by reusing lit.llvm.llvm_config.use_clang(), and every llvm project does its own version of LDPATH mangling. I haven't attempted to fix any of those). Docs are still in clang-tools-extra/docs, I don't have any plans to touch those. Reviewers: gribozavr Subscribers: mgorny, javed.absar, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits, ilya-biryukov, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D61187 llvm-svn: 359424
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clangd] Remove 'using namespace llvm' from .cpp files. NFCIlya Biryukov2019-01-071-5/+6
| | | | | | | | The new guideline is to qualify with 'llvm::' explicitly both in '.h' and '.cpp' files. This simplifies moving the code between header and source files and is easier to keep consistent. llvm-svn: 350531
* [clangd] Canonicalize file path in URIForFile.Eric Liu2018-11-281-0/+22
| | | | | | | | | | | | | | | | | | | Summary: File paths in URIForFile can come from index or local AST. Path from index goes through URI transformation and the final path is resolved by URI scheme and could be potentially different from the original path. Hence, we should do the same transformation for all paths. We do this in URIForFile, which now converts a path to URI and back to a canonicalized path. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54845 llvm-svn: 347739
* [clangd] Cleanup error consumption code. NFCIlya Biryukov2018-11-221-22/+7
| | | | | | | - Remove reimplementations of llvm::consumeError. - Simplify test code by using EXPECT_ERROR where it fits. llvm-svn: 347472
* [clangd] Namespace style cleanup in cpp files. NFC.Sam McCall2018-10-201-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standardize on the most common namespace setup in our *.cpp files: using namespace llvm; namespace clang { namespace clangd { void foo(StringRef) { ... } And remove redundant llvm:: qualifiers. (Except for cases like make_unique where this causes problems with std:: and ADL). This choice is pretty arbitrary, but some broad consistency is nice. This is going to conflict with everything. Sorry :-/ Squash the other configurations: A) using namespace llvm; using namespace clang; using namespace clangd; void clangd::foo(StringRef); This is in some of the older files. (It prevents accidentally defining a new function instead of one in the header file, for what that's worth). B) namespace clang { namespace clangd { void foo(llvm::StringRef) { ... } This is fine, but in practice the using directive often gets added over time. C) namespace clang { namespace clangd { using namespace llvm; // inside the namespace This was pretty common, but is a bit misleading: name lookup preferrs clang::clangd::foo > clang::foo > llvm:: foo (no matter where the using directive is). llvm-svn: 344850
* [clangd] Mark colon as a safe character when percent-encoding.Kadir Cetinkaya2018-10-091-3/+6
| | | | | | | | | | | | | | Summary: Also change output of percent-encoding to use upper-case letters. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53016 llvm-svn: 344033
* [clangd] Check that scheme is valid when parsing URI.Eric Liu2018-09-251-3/+4
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52455 llvm-svn: 342961
* [clangd] Use workspace root path as hint path for resolving URIs in ↵Eric Liu2018-06-191-1/+1
| | | | | | | | | | | | | | | | | | workspace/symbol Summary: Some URI schemes require a hint path to be provided, and workspace root path seems to be a good fit. Reviewers: sammccall, malaperle Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48290 llvm-svn: 335035
* [clangd] Customizable URI schemes for dynamic index.Eric Liu2018-06-151-34/+7
| | | | | | | | | | | | | | | | | Summary: This allows dynamic index to have consistent URI schemes with the static index which can have customized URI schemes, which would make file proximity scoring based on URIs easier. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D47931 llvm-svn: 334809
* s/LLVM_ON_WIN32/_WIN32/, clang-tools-extraNico Weber2018-04-101-2/+2
| | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. llvm-svn: 329695
* [clangd] TestFS cleanup: getVirtualBlahBlah -> testPath/testRoot. Remove ↵Sam McCall2018-02-161-2/+2
| | | | | | SmallString micro-opt for more ergonomic tests. NFC llvm-svn: 325326
* [clangd] Do not precent-encode numbers in URI.Eric Liu2018-02-071-0/+1
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: klimek, jkorous-apple, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D43009 llvm-svn: 324475
* [clangd] Fix URI scheme conflict and an unused variable warning in tests. NFCEric Liu2018-02-011-2/+2
| | | | llvm-svn: 323957
* [clangd] Use new URI with scheme support in place of the existing LSP URIEric Liu2018-01-291-34/+16
| | | | | | | | | | | | | | | | | | Summary: o Replace the existing clangd::URI with a wrapper of FileURI which also carries a resolved file path. o s/FileURI/URI/ o Get rid of the URI hack in vscode extension. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D42419 llvm-svn: 323660
* [clangd] Try to fix build bot failue in r323101Eric Liu2018-01-221-2/+2
| | | | llvm-svn: 323111
* [clangd] Add support for different file URI schemas.Eric Liu2018-01-221-0/+220
Summary: I will replace the existing URI struct in Protocol.h with the new URI and rename FileURI to URI in a followup patch. Reviewers: sammccall Reviewed By: sammccall Subscribers: jkorous-apple, klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41946 llvm-svn: 323101
OpenPOWER on IntegriCloud