[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Did a minor rename and added a few `std::move`s before submitting. Was not worth another round of code review. Repository: rL LLVM https://reviews.llvm.org/D37150 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314678: [clangd] Command line arg to specify compile_commands.json path (authored by ibiryukov). Changed prior to commit: https://reviews.llvm.org/D37150?vs=117340&id=117354#toc Repository: rL LLVM

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread William Enright via Phabricator via cfe-commits
Nebiroth added a comment. In https://reviews.llvm.org/D37150#885749, @ilya-biryukov wrote: > Thanks for fixing the last comment. > Do you want me to land this for you? Yes please! https://reviews.llvm.org/D37150 ___ cfe-commits mailing list cfe-

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Thanks for fixing the last comment. Do you want me to land this for you? Comment at: clangd/GlobalCompilationDatabase.cpp:103 + Logger.log("Failed to find compilation database for " + Twine(File) + + "in overriden directory "

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 117340. Nebiroth added a comment. Improved logging message when unable to find compilation database in specified overriden directory. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilation

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. Thanks. LGTM modulo minor NIT (see other inline comment). Do you need help to land this? Comment at: clangd/GlobalCompilationDatabase.cpp:102 +if (ReturnValue == nullptr) + Logger.log("Failed to find

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 117337. Nebiroth marked 2 inline comments as done. Nebiroth added a comment. Changed placement of logging instruction to reduce logging output. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCo

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov requested changes to this revision. ilya-biryukov added inline comments. This revision now requires changes to proceed. Comment at: clangd/GlobalCompilationDatabase.cpp:90 + + Logger.log("Failed to find compilation database for " + Twine(File) + "\n"); + return nu

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 117327. Nebiroth added a comment. Fixed changes that were lost while merging with head. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilationDatabase.cpp clangd/GlobalCompilationDatabase

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov requested changes to this revision. ilya-biryukov added a comment. This revision now requires changes to proceed. Some changes seem to be lost while merging with head. Comment at: clangd/GlobalCompilationDatabase.cpp:75 + auto CachedIt = CompilationDatabases.find

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-29 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 117217. Nebiroth added a comment. Fixed missed comments and suggstions. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilationDatabase.cpp clangd/GlobalCompilationDatabase.h clangd/tool

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/GlobalCompilationDatabase.cpp:82 // FIXME(ibiryukov): Invalidate cached compilation databases on changes +return Result; Why remove this `FIXME`? Comment at: clangd/tool/ClangdM

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-28 Thread William Enright via Phabricator via cfe-commits
Nebiroth added inline comments. Comment at: clangd/tool/ClangdMain.cpp:20 #include +#include malaperle wrote: > William, did you perhaps miss this comment? I don't think unistd.h makes > sense here. I indeed missed it. https://reviews.llvm.org/D37150 _

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-27 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle requested changes to this revision. malaperle added inline comments. This revision now requires changes to proceed. Comment at: clangd/tool/ClangdMain.cpp:20 #include +#include William, did you perhaps miss this comment? I don't think unistd.h make

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-25 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 116559. Nebiroth added a comment. Fixed inverted compile_commands check logic that made tests fail. More readable command arg checks. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilationD

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Could you please run `clang-format` on every submission? Comment at: clangd/GlobalCompilationDatabase.cpp:98 + { +CompileCommandsDir = "/"; +return tryLoadDatabaseFromPath(CompileCommandsDir.getValue()); Is this some

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-21 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 116198. Nebiroth added a comment. More consistent logging in clangdmain. Restructured argument checking in ClangdMain Fixed empty compile-commands-dir triggering error messages. Fixed failing standard tests. https://reviews.llvm.org/D37150 Files: clangd/

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-18 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. All lit test for clangd are currently failing if I apply your change. Generally, please run `make check-clang-tools` to make sure your changes do not introduce any regressions. The tests are failing because when `--compile-commands-dir` is not specified clangd now

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-15 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 115462. Nebiroth marked an inline comment as done. Nebiroth added a comment. Fixed a few comments. Rebased on latest clangd version. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilationDa

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-12 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/GlobalCompilationDatabase.cpp:75 + if (CachedIt != CompilationDatabases.end()) +return (CachedIt->second.get()); + auto CDB = tooling::CompilationDatabase::loadFromDirectory(File, Error); Parentheses s

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-11 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 114654. Nebiroth added a comment. Simpilified a pointer return value. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/GlobalCompilationDatabase.cpp clangd/GlobalCompilation

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-11 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clangd/GlobalCompilationDatabase.cpp:98-100 +if (CDB) + return CDB; +return nullptr; Isn't that the same as "return CDB"? https://reviews.llvm.org/D37150 ___ c

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-08 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 114371. Nebiroth marked 10 inline comments as done. Nebiroth added a comment. Ran clang-format on modified files. More minor refactoring. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.c

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-08 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Could you also `clang-format` the code please? Comment at: clangd/ClangdServer.cpp:150 bool RunSynchronously, + llvm::Optional CompileCommandsDir, llvm::Optional Res

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-07 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 114199. Nebiroth marked 7 inline comments as done. Nebiroth added a comment. Modified CompileCommandsDir to only look in the specified path if the value is set. Moved CompileCommandsDir field to DirectoryBasedGlobalCompilationDatabase class. Minor refactorin

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. See my comments. Could you also `clang-format` the code please? Comment at: clangd/ClangdServer.cpp:150 bool RunSynchronously, + std::string CompileCommands, llvm::O

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-09-05 Thread William Enright via Phabricator via cfe-commits
Nebiroth updated this revision to Diff 113895. Nebiroth added a comment. Added function to avoid code reuse and extra nesting. https://reviews.llvm.org/D37150 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/GlobalCompilat

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-08-30 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clangd/GlobalCompilationDatabase.cpp:89 + // if --compileCommands arg was invoked, check value and override default path + std::size_t found = CompileCommands.find_first_of("/"); + std::string TempString = CompileCommands; -

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-08-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. BTW, if you're only looking for providing extra compilation flags for some files, you could use an extension to LSP that is already in clangd source tree. (See tests from https://reviews.llvm.org/D34947 for more details). But your change is also useful, as it allow

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-08-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/GlobalCompilationDatabase.cpp:29 + +static cl::opt CompileCommands("compileCommands", + cl::desc("Start with absolute path to compile_commands.json")); Please place this fl

[PATCH] D37150: [clangd] Command line arg to specify compile_commands.json path

2017-08-25 Thread William Enright via Phabricator via cfe-commits
Nebiroth created this revision. Adds compileCommands command line argument to specify an absolute path directly to the requested compile_commands.json for flags. https://reviews.llvm.org/D37150 Files: clangd/GlobalCompilationDatabase.cpp Index: clangd/GlobalCompilationDatabase.cpp =