zturner added inline comments.

================
Comment at: lldb/source/Commands/CommandCompletions.cpp:112
+  if (!Resolver)
+    Resolver = &SR;
+
----------------
labath wrote:
> amccarth wrote:
> > This leaves the caller with no way to say the don't want a tilde resolver.  
> > I didn't expect that from reading the API.  Perhaps a comment on the API 
> > could clarify that you're going to get this default behavior if you specify 
> > nullptr.
> I agree with Adrian.
> What do you think about an API like:
> `DiskFilesOrDirectories(..., const TildeExpressionResolver &Resolver = 
> StandardTildeExpressionResolver())` ?
I don't actually think there *should* be a way to specify no resolver.  That 
sounds like YAGNI.  The only real use cases are "Do it for real" or "do it with 
a mock implementation".  I've updated this to take a reference, which should 
indicate that it is required, and now the version that delegates to this 
function allocates a real instance in its own stack frame and passes it in.  
Hopefully this makes things more clear.


https://reviews.llvm.org/D30789



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to