11import * as vscode from "vscode" ;
2- import { AnalyticsProvider , CodeObjectError , CodeObjectErrorDetails , HttpError } from "../../services/analyticsProvider" ;
3- import { WebviewChannel , WebViewProvider } from "../webViewUtils" ;
2+ import { AnalyticsProvider , CodeObjectError , CodeObjectErrorDetails , HttpError , UsageStatusResults } from "../../services/analyticsProvider" ;
3+ import { WebviewChannel , WebViewProvider , WebViewUris } from "../webViewUtils" ;
44import { CodeAnalyticsView , CodeObjectInfo } from "./codeAnalyticsView" ;
55import { HtmlHelper , ICodeAnalyticsViewTab } from "./common" ;
66import { UiMessage } from "../../views-ui/codeAnalytics/contracts" ;
@@ -13,6 +13,7 @@ import { EditorHelper, EditorInfo } from "../../services/EditorHelper";
1313import { Settings } from "../../settings" ;
1414import { ErrorFlowParameterDecorator } from "../../decorators/errorFlowParameterDecorator" ;
1515import { OverlayView } from "./overlayView" ;
16+ import { CodeObjectGroupEnvironments } from "./CodeObjectGroups/CodeObjectGroupEnvUsage" ;
1617
1718export class ErrorsViewTab implements ICodeAnalyticsViewTab
1819{
@@ -34,7 +35,8 @@ export class ErrorsViewTab implements ICodeAnalyticsViewTab
3435 private _editorHelper : EditorHelper ,
3536 private _errorFlowParamDecorator : ErrorFlowParameterDecorator ,
3637 private _overlay : OverlayView ,
37- private _webViewProvider : WebViewProvider )
38+ private _webViewProvider : WebViewProvider ,
39+ private _webViewUris : WebViewUris )
3840 {
3941 this . _channel . consume ( UiMessage . Get . ErrorDetails , e => this . onShowErrorDetailsEvent ( e ) ) ;
4042 this . _channel . consume ( UiMessage . Notify . GoToLineByFrameId , e => this . goToFileAndLineById ( e . frameId ) ) ;
@@ -109,8 +111,10 @@ export class ErrorsViewTab implements ICodeAnalyticsViewTab
109111 if ( codeObject . id != this . _viewedCodeObjectId )
110112 {
111113 let errors : CodeObjectError [ ] = [ ] ;
114+ let errorsInEnv :UsageStatusResults | undefined ;
112115 try
113116 {
117+ errorsInEnv = await this . _analyticsProvider . getUsageStatus ( [ codeObject . id ] ) ;
114118 errors = await this . _analyticsProvider . getCodeObjectErrors ( codeObject . id ) ;
115119 }
116120 catch ( e )
@@ -123,7 +127,12 @@ export class ErrorsViewTab implements ICodeAnalyticsViewTab
123127 }
124128 }
125129
126- const html = HtmlBuilder . buildErrorItems ( codeObject , errors ) ;
130+ let html = "" ;
131+ if ( errorsInEnv ) {
132+ const usageHtml = new CodeObjectGroupEnvironments ( this . _webViewUris ) . getUsageHtml ( undefined , undefined , errorsInEnv ) ;
133+ html += usageHtml ;
134+ }
135+ html += HtmlBuilder . buildErrorItems ( codeObject , errors ) ;
127136 this . _channel . publish ( new UiMessage . Set . ErrorsList ( html ) ) ;
128137 this . _viewedCodeObjectId = codeObject . id ;
129138 }
@@ -140,7 +149,6 @@ export class ErrorsViewTab implements ICodeAnalyticsViewTab
140149 } ;
141150
142151 this . _overlay . show ( HtmlHelper . getLoadingMessage ( 'Loading error view...' ) , this . errorOverlayId ) ;
143-
144152 const errorDetails = await this . _analyticsProvider . getCodeObjectError ( e . errorSourceUID ) ;
145153 const codeObject = await this . getCurrentCodeObject ( ) || emptyCodeObject ;
146154
0 commit comments