File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ export class PluginAPI {
55
55
public async applications ( ) : Promise < Application [ ] > {
56
56
const apps = new Array < Application > ( )
57
57
for ( const [ , p ] of this . plugins ) {
58
+ if ( ! p . applications ) {
59
+ continue
60
+ }
58
61
const pluginApps = await p . applications ( )
59
62
60
63
// Add plugin key to each app.
@@ -86,6 +89,9 @@ export class PluginAPI {
86
89
*/
87
90
public mount ( r : express . Router ) : void {
88
91
for ( const [ , p ] of this . plugins ) {
92
+ if ( ! p . router ) {
93
+ continue
94
+ }
89
95
r . use ( `${ p . routerPath } ` , p . router ( ) )
90
96
}
91
97
}
Original file line number Diff line number Diff line change @@ -129,8 +129,10 @@ export interface Plugin {
129
129
* Returns the plugin's router.
130
130
*
131
131
* Mounted at <code-sever-root>/<plugin-path>
132
+ *
133
+ * If not present, the plugin provides no routes.
132
134
*/
133
- router ( ) : express . Router
135
+ router ? ( ) : express . Router
134
136
135
137
/**
136
138
* code-server uses this to collect the list of applications that
@@ -139,8 +141,10 @@ export interface Plugin {
139
141
* refresh the list of applications
140
142
*
141
143
* Ensure this is as fast as possible.
144
+ *
145
+ * If not present, the plugin provides no applications.
142
146
*/
143
- applications ( ) : Application [ ] | Promise < Application [ ] >
147
+ applications ? ( ) : Application [ ] | Promise < Application [ ] >
144
148
}
145
149
146
150
/**
You can’t perform that action at this time.
0 commit comments