2020-10-30 07:18:59 +00:00
|
|
|
import * as express from "express"
|
2020-11-04 02:11:14 +00:00
|
|
|
import * as fspath from "path"
|
2020-11-03 22:13:21 +00:00
|
|
|
import * as pluginapi from "../../../typings/pluginapi"
|
2020-10-30 07:18:59 +00:00
|
|
|
|
2020-11-04 02:11:14 +00:00
|
|
|
export const displayName = "Test Plugin"
|
|
|
|
export const path = "/test-plugin"
|
|
|
|
export const description = "Plugin used in code-server tests."
|
|
|
|
|
2020-10-30 07:18:59 +00:00
|
|
|
export function init(config: pluginapi.PluginConfig) {
|
|
|
|
config.logger.debug("test-plugin loaded!")
|
|
|
|
}
|
|
|
|
|
|
|
|
export function router(): express.Router {
|
|
|
|
const r = express.Router()
|
|
|
|
r.get("/goland/icon.svg", (req, res) => {
|
2020-11-04 02:11:14 +00:00
|
|
|
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
|
2020-10-30 07:18:59 +00:00
|
|
|
})
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
export function applications(): pluginapi.Application[] {
|
2020-10-30 07:26:30 +00:00
|
|
|
return [
|
|
|
|
{
|
2020-11-04 02:11:14 +00:00
|
|
|
name: "test app",
|
2020-10-30 07:26:30 +00:00
|
|
|
version: "4.0.0",
|
2020-10-30 07:39:14 +00:00
|
|
|
iconPath: "/icon.svg",
|
2020-11-04 02:11:14 +00:00
|
|
|
|
|
|
|
description: "my description",
|
2020-10-30 07:26:30 +00:00
|
|
|
},
|
|
|
|
]
|
2020-10-30 07:18:59 +00:00
|
|
|
}
|