@@ -106,12 +106,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
106106
107107 if (std::find (db_files.begin (), db_files.end (), path_string) == db_files.end ())
108108 {
109- db->add_database (
110- path_string,
111- [](TypeDef const & type)
112- {
113- return type.Flags ().WindowsRuntime ();
114- });
109+ db->add_database (path_string, [](TypeDef const & type) { return type.Flags ().WindowsRuntime (); });
115110 db_files.push_back (path_string);
116111 }
117112 }
@@ -134,7 +129,10 @@ TypeDef FindType(DkmProcess* process, std::string_view const& typeName)
134129 type = db->find (typeName);
135130 if (!type)
136131 {
137- NatvisDiagnostic (process, std::wstring (L" Could not find metadata for " ) + std::wstring (typeName.begin (), typeName.end ()), NatvisDiagnosticLevel::Error);
132+ NatvisDiagnostic (
133+ process,
134+ std::wstring (L" Could not find metadata for " ) + std::wstring (typeName.begin (), typeName.end ()),
135+ NatvisDiagnosticLevel::Error);
138136 }
139137 }
140138 return type;
@@ -170,12 +168,7 @@ cppwinrt_visualizer::cppwinrt_visualizer()
170168 db_files.push_back (file.path ().string ());
171169 }
172170 }
173- db.reset (new cache (
174- db_files,
175- [](TypeDef const & type)
176- {
177- return type.Flags ().WindowsRuntime ();
178- }));
171+ db.reset (new cache (db_files, [](TypeDef const & type) { return type.Flags ().WindowsRuntime (); }));
179172 }
180173 catch (...)
181174 {
@@ -184,7 +177,8 @@ cppwinrt_visualizer::cppwinrt_visualizer()
184177
185178 // Log an event for telemetry purposes when the visualizer is brought online
186179 com_ptr<DkmString> eventName;
187- if SUCCEEDED (DkmString::Create (DkmSourceString (L" vs/vc/diagnostics/cppwinrtvisualizer/objectconstructed" ), eventName.put ()))
180+ if SUCCEEDED (DkmString::Create (
181+ DkmSourceString (L" vs/vc/diagnostics/cppwinrtvisualizer/objectconstructed" ), eventName.put ()))
188182 {
189183 com_ptr<DkmTelemetryEvent> error;
190184 if SUCCEEDED (DkmTelemetryEvent::Create (eventName.get (), nullptr , nullptr , error.put ()))
@@ -201,7 +195,8 @@ cppwinrt_visualizer::~cppwinrt_visualizer()
201195 db.reset ();
202196}
203197
204- HRESULT cppwinrt_visualizer::EvaluateVisualizedExpression (_In_ DkmVisualizedExpression* pVisualizedExpression, _Deref_out_ DkmEvaluationResult** ppResultObject)
198+ HRESULT cppwinrt_visualizer::EvaluateVisualizedExpression (
199+ _In_ DkmVisualizedExpression* pVisualizedExpression, _Deref_out_ DkmEvaluationResult** ppResultObject)
205200{
206201 try
207202 {
@@ -237,7 +232,8 @@ HRESULT cppwinrt_visualizer::EvaluateVisualizedExpression(_In_ DkmVisualizedExpr
237232 else
238233 {
239234 // unrecognized type
240- NatvisDiagnostic (pVisualizedExpression, std::wstring (L" Unrecognized type: " ) + (LPWSTR)bstrTypeName, NatvisDiagnosticLevel::Error);
235+ NatvisDiagnostic (
236+ pVisualizedExpression, std::wstring (L" Unrecognized type: " ) + (LPWSTR)bstrTypeName, NatvisDiagnosticLevel::Error);
241237 return S_OK;
242238 }
243239
@@ -248,13 +244,19 @@ HRESULT cppwinrt_visualizer::EvaluateVisualizedExpression(_In_ DkmVisualizedExpr
248244 catch (...)
249245 {
250246 // If something goes wrong, just fail to display object/property. Don't take down VS.
251- NatvisDiagnostic (pVisualizedExpression, L" Exception in cppwinrt_visualizer::EvaluateVisualizedExpression" , NatvisDiagnosticLevel::Error, to_hresult ());
247+ NatvisDiagnostic (
248+ pVisualizedExpression,
249+ L" Exception in cppwinrt_visualizer::EvaluateVisualizedExpression" ,
250+ NatvisDiagnosticLevel::Error,
251+ to_hresult ());
252252 return E_FAIL;
253253 }
254254}
255255
256256HRESULT cppwinrt_visualizer::UseDefaultEvaluationBehavior (
257- _In_ DkmVisualizedExpression* /* pVisualizedExpression*/ , _Out_ bool * pUseDefaultEvaluationBehavior, _Deref_out_opt_ DkmEvaluationResult** ppDefaultEvaluationResult)
257+ _In_ DkmVisualizedExpression* /* pVisualizedExpression*/ ,
258+ _Out_ bool * pUseDefaultEvaluationBehavior,
259+ _Deref_out_opt_ DkmEvaluationResult** ppDefaultEvaluationResult)
258260{
259261 *pUseDefaultEvaluationBehavior = false ;
260262 *ppDefaultEvaluationResult = nullptr ;
@@ -283,7 +285,8 @@ HRESULT cppwinrt_visualizer::GetChildren(
283285 hr = pVisualizedExpression->GetDataItem (pPropertyVisualizer.put ());
284286 if (SUCCEEDED (hr))
285287 {
286- IF_FAIL_RET (pPropertyVisualizer->GetChildren (InitialRequestSize, pInspectionContext, pInitialChildren, ppEnumContext));
288+ IF_FAIL_RET (pPropertyVisualizer->GetChildren (
289+ InitialRequestSize, pInspectionContext, pInitialChildren, ppEnumContext));
287290 }
288291 }
289292
@@ -292,7 +295,8 @@ HRESULT cppwinrt_visualizer::GetChildren(
292295 catch (...)
293296 {
294297 // If something goes wrong, just fail to display object/property. Don't take down VS.
295- NatvisDiagnostic (pVisualizedExpression, L" Exception in cppwinrt_visualizer::GetChildren" , NatvisDiagnosticLevel::Error, to_hresult ());
298+ NatvisDiagnostic (
299+ pVisualizedExpression, L" Exception in cppwinrt_visualizer::GetChildren" , NatvisDiagnosticLevel::Error, to_hresult ());
296300 return E_FAIL;
297301 }
298302}
@@ -327,12 +331,14 @@ HRESULT cppwinrt_visualizer::GetItems(
327331 catch (...)
328332 {
329333 // If something goes wrong, just fail to display object/property. Don't take down VS.
330- NatvisDiagnostic (pVisualizedExpression, L" Exception in cppwinrt_visualizer::GetItems" , NatvisDiagnosticLevel::Error, to_hresult ());
334+ NatvisDiagnostic (
335+ pVisualizedExpression, L" Exception in cppwinrt_visualizer::GetItems" , NatvisDiagnosticLevel::Error, to_hresult ());
331336 return E_FAIL;
332337 }
333338}
334339
335- HRESULT cppwinrt_visualizer::SetValueAsString (_In_ DkmVisualizedExpression* pVisualizedExpression, _In_ DkmString* pValue, _In_ UINT32 Timeout, _Deref_out_opt_ DkmString** ppErrorText)
340+ HRESULT cppwinrt_visualizer::SetValueAsString (
341+ _In_ DkmVisualizedExpression* pVisualizedExpression, _In_ DkmString* pValue, _In_ UINT32 Timeout, _Deref_out_opt_ DkmString** ppErrorText)
336342{
337343 try
338344 {
@@ -348,7 +354,8 @@ HRESULT cppwinrt_visualizer::SetValueAsString(_In_ DkmVisualizedExpression* pVis
348354 catch (...)
349355 {
350356 // If something goes wrong, just fail to update object/property. Don't take down VS.
351- NatvisDiagnostic (pVisualizedExpression, L" Exception in cppwinrt_visualizer::SetValueAsString" , NatvisDiagnosticLevel::Error, to_hresult ());
357+ NatvisDiagnostic (
358+ pVisualizedExpression, L" Exception in cppwinrt_visualizer::SetValueAsString" , NatvisDiagnosticLevel::Error, to_hresult ());
352359 return E_FAIL;
353360 }
354361}
@@ -370,7 +377,10 @@ HRESULT cppwinrt_visualizer::GetUnderlyingString(_In_ DkmVisualizedExpression* p
370377 {
371378 // If something goes wrong, just fail to display object/property. Don't take down VS.
372379 NatvisDiagnostic (
373- pVisualizedExpression->RuntimeInstance ()->Process (), L" Exception in cppwinrt_visualizer::GetUnderlyingString" , NatvisDiagnosticLevel::Error, to_hresult ());
380+ pVisualizedExpression->RuntimeInstance ()->Process (),
381+ L" Exception in cppwinrt_visualizer::GetUnderlyingString" ,
382+ NatvisDiagnosticLevel::Error,
383+ to_hresult ());
374384 return E_FAIL;
375385 }
376386}
0 commit comments