[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a reviewer: ilya-biryukov. ilya-biryukov added a comment. Comment at: clangd/ClangdLSPServer.cpp:430 CDB.clear(); - -reparseOpenedFiles(); +compileCommandsChangePost(CCChangeData); } ilya-biryukov wrote: > simark wrote: > >

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. > if/when we have a native implementation, supporting multiple mechanisms with > different layering requirements to get at most a 2x win in watcher resource > usage seems like a dubious way to spend our complexity budget. I guess the only think that might force

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Just a couple of high-level comments here: - I'm not sure we can/should commit to supporting editor-based file watching forever. - One natural long-term direction would be to get this functionality into `JSONCompilationDatabase`, and clients of that don't have an

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Simon Marchi via Phabricator via cfe-commits
simark added inline comments. Comment at: clangd/ClangdLSPServer.cpp:430 CDB.clear(); - -reparseOpenedFiles(); +compileCommandsChangePost(CCChangeData); } malaperle wrote: > ilya-biryukov wrote: > > Maybe keep the old logic of reparsing all open

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added inline comments. Comment at: clangd/ClangdLSPServer.cpp:430 CDB.clear(); - -reparseOpenedFiles(); +compileCommandsChangePost(CCChangeData); } ilya-biryukov wrote: > Maybe keep the old logic of reparsing all open files? This would

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D49267#1173291, @simark wrote: > Ok, I agree that having clangd watch files itself could be necessary at some > point (when the client does not support it), but it would have to be > configurable. In our case, we have efficient enough

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Simon Marchi via Phabricator via cfe-commits
simark added a comment. In https://reviews.llvm.org/D49267#1173266, @ilya-biryukov wrote: > The approach is not ideal, but may be a good middle ground before we figure > out how we approach file watching in clangd. Note that there are other things > that won't force the updates currently, e.g.

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D49267#1171932, @simark wrote: > I guess you mean language client here, not language server. In our case we > already have a client capable of file watching, so it's convenient for us to > do that (plus, this is what the LSP

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-23 Thread Simon Marchi via Phabricator via cfe-commits
simark added a comment. In https://reviews.llvm.org/D49267#1171286, @ilya-biryukov wrote: > Thanks for putting up this change! It can be really annoying that clangd does > not pick up the compile commands that got updated. > > A few things of the top of my head on why we might want to punt on

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a subscriber: sammccall. ilya-biryukov added a comment. @sammccall pointed out that I've been looking at a different layer of caching. Clangd does per-directory (to avoid reloading compilation database multiple times) and per-file (to avoid calling into compilation database

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Herald added a subscriber: arphaman. Thanks for putting up this change! It can be really annoying that clangd does not pick up the compile commands that got updated. A few things of the top of my head on why we might want to punt on using the LSP watches: - File

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-12 Thread Simon Marchi via Phabricator via cfe-commits
simark updated this revision to Diff 155284. simark added a comment. Remove unintended changes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49267 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/GlobalCompilationDatabase.cpp

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-12 Thread Simon Marchi via Phabricator via cfe-commits
simark added a comment. Note, https://reviews.llvm.org/D49265 in clang is a prerequisite. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D49267: [clangd] Watch for changes in compile_commands.json

2018-07-12 Thread Simon Marchi via Phabricator via cfe-commits
simark created this revision. Herald added subscribers: cfe-commits, jkorous, MaskRay, ioeric, ilya-biryukov. This patch adds support for watching for changes to compile_commands.json, and reparsing files if needed. The watching is done using the "workspace/didChangeWatchedFiles" notification,