File tree Expand file tree Collapse file tree 5 files changed +32
-23
lines changed
views/jobManager/selfCodes Expand file tree Collapse file tree 5 files changed +32
-23
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " vscode-db2i" ,
3
3
"displayName" : " Db2 for IBM i" ,
4
4
"description" : " Db2 for IBM i tools in VS Code" ,
5
- "version" : " 0.10.1 " ,
5
+ "version" : " 0.10.2 " ,
6
6
"preview" : true ,
7
7
"engines" : {
8
8
"vscode" : " ^1.70.0"
Original file line number Diff line number Diff line change
1
+ import { commands } from "vscode" ;
1
2
import { getInstance } from "./base" ;
2
3
import { ServerComponent } from "./connection/serverComponent" ;
3
4
@@ -19,6 +20,7 @@ export class IBMiDetail {
19
20
20
21
setFeatureSupport ( featureId : Db2FeatureIds , supported : boolean ) {
21
22
this . features [ featureId ] = supported ;
23
+ commands . executeCommand ( `setContext` , `vscode-db2i:${ featureId } Supported` , supported ) ;
22
24
}
23
25
24
26
getVersion ( ) {
@@ -30,6 +32,12 @@ export class IBMiDetail {
30
32
}
31
33
32
34
async fetchSystemInfo ( ) {
35
+ // Disable all features
36
+ const features = Object . keys ( featureRequirements ) as Db2FeatureIds [ ] ;
37
+ for ( const featureId of features ) {
38
+ this . setFeatureSupport ( featureId , false ) ;
39
+ }
40
+
33
41
const instance = getInstance ( ) ;
34
42
const content = instance . getContent ( ) ;
35
43
@@ -52,7 +60,6 @@ export class IBMiDetail {
52
60
levelCheckFailed = true ;
53
61
}
54
62
55
- const features = Object . keys ( featureRequirements ) as Db2FeatureIds [ ] ;
56
63
for ( const featureId of features ) {
57
64
const requiredLevelForFeature = featureRequirements [ featureId ] [ String ( this . version ) ] ;
58
65
const supported = requiredLevelForFeature && this . db2Level >= requiredLevelForFeature ;
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ export async function onConnectOrServerInstall(): Promise<boolean> {
35
35
await ServerComponent . checkForUpdate ( ) ;
36
36
37
37
updateStatusBar ( ) ;
38
- toggleViews ( ) ;
39
38
40
39
if ( ServerComponent . isInstalled ( ) ) {
41
40
JobManagerView . setVisible ( true ) ;
@@ -83,15 +82,6 @@ export function initConfig(context: ExtensionContext) {
83
82
} ) ;
84
83
}
85
84
86
- export function toggleViews ( ) {
87
- const features = osDetail . getFeatures ( ) ;
88
-
89
- const featureIds = Object . keys ( features ) as ( keyof typeof features ) [ ] ;
90
- for ( const featureId of featureIds ) {
91
- commands . executeCommand ( `setContext` , `vscode-db2i:${ featureId } Supported` , features [ featureId ] ) ;
92
- }
93
- }
94
-
95
85
export async function askAboutNewJob ( startup ?: boolean ) : Promise < boolean > {
96
86
const instance = getInstance ( ) ;
97
87
const connection = instance . getConnection ( ) ;
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ export class ServerComponent {
107
107
command : `echo ${ ExecutablePathDir } `
108
108
} ) ;
109
109
110
- if ( commandResult . code === 0 && commandResult . stderr === `` ) {
110
+ this . writeOutput ( JSON . stringify ( commandResult ) ) ;
111
+
112
+ if ( commandResult . code === 0 ) {
113
+ const stuffInStderr = commandResult . stderr . length > 0 ;
111
114
const remotePath = path . posix . join ( commandResult . stdout , basename ) ;
112
115
113
116
ServerComponent . writeOutput ( JSON . stringify ( { remotePath, ExecutablePathDir} ) ) ;
@@ -122,14 +125,17 @@ export class ServerComponent {
122
125
123
126
await Config . setServerComponentName ( basename ) ;
124
127
128
+ if ( stuffInStderr ) {
129
+ ServerComponent . writeOutput ( `Server component was uploaded to ${ remotePath } but there was something in stderr, which is not right. It might be worth seeing your user profile startup scripts.` ) ;
130
+ }
131
+
125
132
window . showInformationMessage ( `Db2 for IBM i extension server component has been updated!` ) ;
126
133
this . installed = true ;
127
134
updateResult = UpdateStatus . JUST_UPDATED ;
128
135
129
136
} else {
130
137
updateResult = UpdateStatus . FAILED ;
131
138
132
- this . writeOutput ( JSON . stringify ( commandResult ) ) ;
133
139
window . showErrorMessage ( `Something went really wrong when trying to fetch your home directory.` ) . then ( chosen => {
134
140
if ( chosen === `Show` ) {
135
141
this . outputChannel . show ( ) ;
Original file line number Diff line number Diff line change 9
9
Uri ,
10
10
Disposable
11
11
} from "vscode" ;
12
- import { JobManager } from "../../../config" ;
12
+ import { JobManager , osDetail } from "../../../config" ;
13
13
import { SelfCodeNode , SelfIleStackFrame } from "./nodes" ;
14
14
import { openExampleCommand } from "../../examples/exampleBrowser" ;
15
15
import { SQLExample } from "../../examples" ;
@@ -94,15 +94,21 @@ export class selfCodesResultsView implements TreeDataProvider<any> {
94
94
where user_name = current_user
95
95
order by logged_time desc` ;
96
96
97
- const result = await selected . job . query < SelfCodeNode > ( content ) . run ( 10000 ) ;
98
- if ( result . success ) {
99
- const data : SelfCodeNode [ ] = result . data . map ( ( row ) => ( {
100
- ...row ,
101
- INITIAL_STACK : JSON . parse ( row . INITIAL_STACK as unknown as string )
102
- } ) ) ;
97
+ try {
98
+ const result = await selected . job . query < SelfCodeNode > ( content ) . run ( 10000 ) ;
99
+ if ( result . success ) {
100
+ const data : SelfCodeNode [ ] = result . data . map ( ( row ) => ( {
101
+ ...row ,
102
+ INITIAL_STACK : JSON . parse ( row . INITIAL_STACK as unknown as string )
103
+ } ) ) ;
103
104
104
-
105
- return data ;
105
+
106
+ return data ;
107
+ }
108
+ } catch ( e ) {
109
+ this . setRefreshEnabled ( false ) ;
110
+ osDetail . setFeatureSupport ( `SELF` , false ) ;
111
+ vscode . window . showErrorMessage ( `An error occured fetching SELF code errors, and therefore will be disabled.` ) ;
106
112
}
107
113
}
108
114
You can’t perform that action at this time.
0 commit comments