Skip to content

Commit

Permalink
fix: customCompletions
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ngjie committed Jan 10, 2023
1 parent 8ffdb1a commit f5e17f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ajax-proxy",
"private": true,
"description": "Modify your Ajax response to test",
"version": "2.2.3",
"version": "2.2.4",
"scripts": {
"dev": "pnpm -C ./packages/vue-panels serve",
"watch": "run-p watch:lib watch:chrome",
Expand Down
17 changes: 14 additions & 3 deletions packages/code-editor/packages/useEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function useInit(container) {
enableBasicAutocompletion: true,
});

// TODO: 自定义提示
// customCompletions(target)
// 自定义提示
customCompletions(target)

return target;
}
Expand All @@ -39,7 +39,18 @@ function customCompletions(target) {
return;
}
callback(null, [
{ meta: 'todo', caption: 'AND', value: 'AND', score: 1 },
{ meta: 'AjaxProxy::Ctx.req', caption: 'req.url: string', value: 'req.url', score: 100 },
{ meta: 'AjaxProxy::Ctx.req', caption: 'req.method: string', value: 'req.method', score: 100 },
{ meta: 'AjaxProxy::Ctx.req', caption: 'req.body?: any', value: 'req.body', score: 100 },
{ meta: 'AjaxProxy::Ctx.res', caption: 'res.status: string', value: 'res.status', score: 100 },
{ meta: 'AjaxProxy::Ctx.res', caption: 'res.customStatus: string', value: 'res.customStatus', score: 100 },
{ meta: 'AjaxProxy::Ctx.res', caption: 'res.response: any', value: 'res.response', score: 100 },
{
meta: 'AjaxProxy::Next',
caption: 'next({ override?: string, status?: string | number })',
value: 'next({ override: "", status: "" });',
score: 100
},
]);
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/shell-chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Ajax Proxy",
"version": "2.2.3",
"version": "2.2.4",
"description": "Modify your Ajax response to test",
"author": "Gj",
"icons": {
Expand Down

0 comments on commit f5e17f8

Please sign in to comment.