================
@@ -730,6 +731,9 @@ void ClangdLSPServer::onSync(const NoParams &,
Callback<std::nullptr_t> Reply) {
void ClangdLSPServer::onDocumentDidOpen(
const DidOpenTextDocumentParams &Params) {
PathRef File = Params.textDocument.uri.file();
+ if (llvm::sys::fs::is_directory(File)) {
+ return;
----------------
HighCommander4 wrote:
We shouldn't silently early-return, let's log an error similar to
[this](https://searchfox.org/llvm/rev/3f1386b9861758beb7a9ba15c24bdba3a9f8c03d/clang-tools-extra/clangd/ClangdLSPServer.cpp#761).
(A fancier thing we could do is produce a diagnostic here in clangd code and
send it to the client with `textDocument/publishDiagnostics`, but I'm guessing
the utility of that would be limited since the client is probably also not
going to be able to do its usual thing (e.g. show an editor) for a directory.)
https://github.com/llvm/llvm-project/pull/177834
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits