File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,15 @@ export class VSCodeDBTConfiguration implements DBTConfiguration {
89
89
) ;
90
90
}
91
91
92
+ getDisableDepthsCalculation ( ) : boolean {
93
+ return workspace
94
+ . getConfiguration ( "dbt" )
95
+ . get < boolean > (
96
+ "disableDepthsCalculation" ,
97
+ DEFAULT_CONFIGURATION_VALUES . disableDepthsCalculation ,
98
+ ) ;
99
+ }
100
+
92
101
getWorkingDirectory ( ) : string {
93
102
return getFirstWorkspacePath ( ) ;
94
103
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface DBTConfiguration {
16
16
getEnableNotebooks ( ) : boolean ;
17
17
getDisableQueryHistory ( ) : boolean ;
18
18
getInstallDepsOnProjectInitialization ( ) : boolean ;
19
+ getDisableDepthsCalculation ( ) : boolean ;
19
20
20
21
// Workspace settings
21
22
getWorkingDirectory ( ) : string ;
@@ -38,6 +39,7 @@ export const DEFAULT_CONFIGURATION_VALUES = {
38
39
enableNotebooks : false ,
39
40
disableQueryHistory : false ,
40
41
installDepsOnProjectInitialization : true ,
42
+ disableDepthsCalculation : false ,
41
43
altimateUrl : "https://api.myaltimate.com" ,
42
44
isLocalMode : false ,
43
45
} as const ;
Original file line number Diff line number Diff line change 1
1
import { DBTTerminal } from "../../dbt_integration/terminal" ;
2
2
import { DBTGraphType } from "./graphParser" ;
3
- import { AltimateRequest } from "../../altimate" ;
4
- import { workspace } from "vscode" ;
5
3
import { DbtIntegrationClient } from "../dbtIntegrationClient" ;
4
+ import { DBTConfiguration } from "../configuration" ;
6
5
7
6
export class ModelDepthParser {
8
7
constructor (
9
8
private terminal : DBTTerminal ,
10
9
private dbtIntegrationClient : DbtIntegrationClient ,
10
+ private configuration : DBTConfiguration ,
11
11
) { }
12
12
13
13
public createModelDepthsMap (
@@ -16,9 +16,8 @@ export class ModelDepthParser {
16
16
childMetaMap : DBTGraphType ,
17
17
) : Map < string , number > {
18
18
// Check if depth calculation is disabled
19
- const disableDepthsCalculation = workspace
20
- . getConfiguration ( "dbt" )
21
- . get < boolean > ( "disableDepthsCalculation" , false ) ;
19
+ const disableDepthsCalculation =
20
+ this . configuration . getDisableDepthsCalculation ( ) ;
22
21
if ( disableDepthsCalculation ) {
23
22
this . terminal . debug (
24
23
"ModelDepthParser" ,
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ container
120
120
new ModelDepthParser (
121
121
context . container . get ( "DBTTerminal" ) ,
122
122
context . container . get ( DbtIntegrationClient ) ,
123
+ context . container . get ( "DBTConfiguration" ) ,
123
124
) ,
124
125
) ;
125
126
You can’t perform that action at this time.
0 commit comments