File tree Expand file tree Collapse file tree 1 file changed +25
-23
lines changed Expand file tree Collapse file tree 1 file changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -107,21 +107,7 @@ export default class BashServer {
107
107
108
108
const word = this . getWordAtPoint ( pos )
109
109
110
- if ( Builtins . isBuiltin ( word ) ) {
111
- return Builtins . documentation ( word ) . then ( doc => ( {
112
- contents : {
113
- language : 'plaintext' ,
114
- value : doc ,
115
- } ,
116
- } ) )
117
- } else if ( this . executables . isExecutableOnPATH ( word ) ) {
118
- return this . executables . documentation ( word ) . then ( doc => ( {
119
- contents : {
120
- language : 'plaintext' ,
121
- value : doc ,
122
- } ,
123
- } ) )
124
- } else if ( process . env . EXPLAINSHELL_ENDPOINT !== '' ) {
110
+ if ( process . env . EXPLAINSHELL_ENDPOINT !== '' ) {
125
111
const response = await this . analyzer . getExplainshellDocumentation ( {
126
112
pos,
127
113
endpoint : process . env . EXPLAINSHELL_ENDPOINT ,
@@ -131,19 +117,35 @@ export default class BashServer {
131
117
this . connection . console . log (
132
118
'getExplainshellDocumentation returned: ' + JSON . stringify ( response , null , 4 ) ,
133
119
)
134
-
135
- return null
120
+ } else {
121
+ return {
122
+ contents : {
123
+ kind : 'markdown' ,
124
+ value : new TurndownService ( ) . turndown ( response . helpHTML ) ,
125
+ } ,
126
+ }
136
127
}
128
+ }
137
129
138
- return {
130
+ if ( Builtins . isBuiltin ( word ) ) {
131
+ return Builtins . documentation ( word ) . then ( doc => ( {
139
132
contents : {
140
- kind : 'markdown ' ,
141
- value : new TurndownService ( ) . turndown ( response . helpHTML ) ,
133
+ language : 'plaintext ' ,
134
+ value : doc ,
142
135
} ,
143
- }
144
- } else {
145
- return null
136
+ } ) )
146
137
}
138
+
139
+ if ( this . executables . isExecutableOnPATH ( word ) ) {
140
+ return this . executables . documentation ( word ) . then ( doc => ( {
141
+ contents : {
142
+ language : 'plaintext' ,
143
+ value : doc ,
144
+ } ,
145
+ } ) )
146
+ }
147
+
148
+ return null
147
149
}
148
150
149
151
private onDefinition ( pos : LSP . TextDocumentPositionParams ) : LSP . Definition {
You can’t perform that action at this time.
0 commit comments