summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/TestFS.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Move clangd tests to clangd directory. check-clangd is no longer ↵Sam McCall2019-04-291-73/+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] Auto-index watches global CDB for changes.Sam McCall2018-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of receiving compilation commands, auto-index is triggered by just filenames to reindex, and gets commands from the global comp DB internally. This has advantages: - more of the work can be done asynchronously (fetching compilation commands upfront can be slow for large CDBs) - we get access to the CDB which can be used to retrieve interpolated commands for headers (useful in some cases where the original TU goes away) - fits nicely with the filename-only change observation from r347297 The interface to GlobalCompilationDatabase gets extended: when retrieving a compile command, the GCDB can optionally report the project the file belongs to. This naturally fits together with getCompileCommand: it's hard to implement one without the other. But because most callers don't care, I've ended up with an awkward optional-out-param-in-virtual method pattern - maybe there's a better one. This is the main missing integration point between ClangdServer and BackgroundIndex, after this we should be able to add an auto-index flag. Reviewers: ioeric, kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits, ilya-biryukov Differential Revision: https://reviews.llvm.org/D54865 llvm-svn: 347538
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-3/+3
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [clangd] Make FSProvider const-correct. NFCSam McCall2018-10-101-1/+1
| | | | llvm-svn: 344118
* [clangd] Avoid duplicates in findDefinitions responseSimon Marchi2018-08-101-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When compile_commands.json contains some source files expressed as relative paths, we can get duplicate responses to findDefinitions. The responses only differ by the URI, which are different versions of the same file: "result": [ { ... "uri": "file:///home/emaisin/src/ls-interact/cpp-test/build/../src/first.h" }, { ... "uri": "file:///home/emaisin/src/ls-interact/cpp-test/src/first.h" } ] In getAbsoluteFilePath, we try to obtain the realpath of the FileEntry by calling tryGetRealPathName. However, this can fail and return an empty string. It may be bug a bug in clang, but in any case we should fall back to computing it ourselves if it happens. I changed getAbsoluteFilePath so that if tryGetRealPathName succeeds, we return right away (a real path is always absolute). Otherwise, we try to build an absolute path, as we did before, but we also call VFS->getRealPath to make sure to get the canonical path (e.g. without any ".." in it). Reviewers: malaperle Subscribers: hokein, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48687 llvm-svn: 339483
* [clangd] Do not rebuild AST if inputs have not changedIlya Biryukov2018-07-261-1/+2
| | | | | | | | | | | | | | | | | Summary: If the contents are the same, the update most likely comes from the fact that compile commands were invalidated. In that case we want to avoid rebuilds in case the compile commands are actually the same. Reviewers: ioeric Reviewed By: ioeric Subscribers: simark, javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D49783 llvm-svn: 338012
* [clangd] Customizable URI schemes for dynamic index.Eric Liu2018-06-151-0/+5
| | | | | | | | | | | | | | | | | 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
* [clangd] Add forgotten include guard to TestFS.h. NFCIlya Biryukov2018-05-301-0/+3
| | | | llvm-svn: 333548
* [clangd] Remove Tagged and some related APIs from ClangdServer.Sam McCall2018-03-121-4/+3
| | | | | | | | | | | | Context can do what Tagged was intended to support (snapshot filesystems), and less intrusively. getTaggedFileSystem() no longer needs a filename. Cleanups while here: - code-complete now returns errors as Expected, like other functions - added an alias Callback<T> for the usual callback function type llvm-svn: 327344
* [clangd] TestFS cleanup: getVirtualBlahBlah -> testPath/testRoot. Remove ↵Sam McCall2018-02-161-3/+4
| | | | | | SmallString micro-opt for more ergonomic tests. NFC llvm-svn: 325326
* [clangd] Fixed findDefinitions to always return absolute paths.Ilya Biryukov2018-02-131-1/+4
| | | | | | | | Relative paths could be returned in some cases, e.g. when relative path is used in compilation arguments. This led to crash when trying to convert the path to URI. llvm-svn: 325029
* [clangd] Fix r323658 test failure on windows.Eric Liu2018-01-291-0/+3
| | | | llvm-svn: 323703
* [clangd] Remove unused test param. NFCSam McCall2017-12-051-6/+1
| | | | llvm-svn: 319742
* [clangd] Split code-completion tests out of ClangdTests. NFC.Sam McCall2017-12-051-0/+57
Summary: Common parts are mostly FS related, so pulled out TestFS.h for the common stuff. Deliberately resisted cleaning up much here, so this is pretty mechanical. Reviewers: hokein Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40784 llvm-svn: 319741
OpenPOWER on IntegriCloud