summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/URI.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Simplify the callside of URI::resolve, NFC.Haojian Wu2019-09-231-0/+11
| | | | | | | | | | | | | | | | Summary: - Add a overrloded URI::resolve, which accepts a string URI; - also fixed some callside that don't check the error; Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67916 llvm-svn: 372617
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clangd] Avoid slow ostreams in URI conversion.Sam McCall2019-07-081-16/+15
| | | | | | | This speeds up some hot paths significantly (e.g. dex::generateProximityURIs by a third or so) llvm-svn: 365289
* 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-42/+47
| | | | | | | | 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] clang-format everything. NFCIlya Biryukov2019-01-031-1/+1
| | | | llvm-svn: 350303
* [clangd] Canonicalize file path in URIForFile.Eric Liu2018-11-281-13/+26
| | | | | | | | | | | | | | | | | | | 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: stop passing around list of supported URI schemes.Eric Liu2018-11-221-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of passing around a list of supported URI schemes in clangd, we expose an interface to convert a path to URI using any compatible scheme that has been registered. It favors customized schemes and falls back to "file" when no other scheme works. Changes in this patch are: - URI::create(AbsPath, URISchemes) -> URI::create(AbsPath). The new API finds a compatible scheme from the registry. - Remove URISchemes option everywhere (ClangdServer, SymbolCollecter, FileIndex etc). - Unit tests will use "unittest" by default. - Move "test" scheme from ClangdLSPServer to ClangdMain.cpp, and only register the test scheme when lit-test or enable-lit-scheme is set. (The new flag is added to make lit protocol.test work; I wonder if there is alternative here.) Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54800 llvm-svn: 347467
* [clangd] Namespace style cleanup in cpp files. NFC.Sam McCall2018-10-201-45/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | | | | | | | | 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] Fix build bot after r342961Eric Liu2018-09-251-4/+3
| | | | | | | Use llvm::isAlpha instead of std::isalpha etc. This should fix bot failure: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20180 llvm-svn: 342964
* [clangd] Check that scheme is valid when parsing URI.Eric Liu2018-09-251-2/+20
| | | | | | | | | | | | 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] Implement proximity path boosting for DexKirill Bobyrev2018-09-061-0/+20
| | | | | | | | | | | | | | | This patch introduces `PathURI` Search Token kind and utilizes it to uprank symbols which are defined in files with small distance to the directory where the fuzzy find request is coming from (e.g. files user is editing). Reviewed By: ioeric Reviewers: ioeric, sammccall Differential Revision: https://reviews.llvm.org/D51481 llvm-svn: 341542
* [clangd] Allow using customized include path in URI.Haojian Wu2018-04-091-0/+7
| | | | | | | | | | | | | | | | | | | Summary: Calculating the include path from absolute file path does not always work for all build system, e.g. bazel uses symlink as the build working directory. The absolute file path from editor and clang is diverged from each other. We need to address it properly in build sysmtem integration. This patch worksarounds the issue by providing a hook in URI which allows clients to provide their customized include path. Reviewers: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D45426 llvm-svn: 329578
* [clangd] Do not precent-encode numbers in URI.Eric Liu2018-02-071-1/+2
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: klimek, jkorous-apple, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D43009 llvm-svn: 324475
* [clangd] Use new URI with scheme support in place of the existing LSP URIEric Liu2018-01-291-22/+22
| | | | | | | | | | | | | | | | | | 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] Add support for different file URI schemas.Eric Liu2018-01-221-0/+199
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