diff --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp --- a/lldb/tools/lldb-vscode/lldb-vscode.cpp +++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -947,6 +947,7 @@ 0, -1, matches, descriptions); size_t count = std::min((uint32_t)50, matches.GetSize()); targets.reserve(count); + auto command_prefix = llvm::StringRef(text).rsplit(" ").second; for (size_t i = 0; i < count; i++) { std::string match = matches.GetStringAtIndex(i); std::string description = descriptions.GetStringAtIndex(i); @@ -958,6 +959,15 @@ else EmplaceSafeString(item, "label", match + " -- " + description); + auto command_prefix_size = command_prefix.size(); + if (command_prefix_size && match.find(command_prefix, 0) == 0) { + EmplaceSafeString(item, "start", + llvm::StringRef(std::to_string(actual_column - + command_prefix_size))); + EmplaceSafeString(item, "length", + llvm::StringRef(std::to_string(command_prefix_size))); + } + targets.emplace_back(std::move(item)); }