Skip to content

Commit 3bbc530

Browse files
committed
1.1.2
1 parent ba5c9f0 commit 3bbc530

25 files changed

Lines changed: 293 additions & 98 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ dist
44
node_modules
55
.vscode-test/
66
*.vsix
7-
*.js.map
7+
*.js.map
8+
src/localconfig.ts

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Change Log
22

3+
v1.1.2 (2023-01-17)
4+
5+
- Fix some known issues
6+
7+
v1.1.1 (2023-01-10)
8+
9+
- Fix some known bugs
10+
11+
- Improve the quality of suggestions
12+
13+
- Change the keybinding of command a new line from ``Alt/option+N`` to ``Alt/option+\``
14+
15+
v1.1.0 (2023-01-03)
16+
17+
- Fix some known bugs
18+
19+
- Add translation component to activity bar
20+
21+
- Add new option Only Key Control, to get suggestions only in need (command: ``Alt/option + N`` to get suggestions in this mode)
22+
23+
- Add conditions to key ``Tab``, if there is some suggestions, press ``Tab`` to accept the current suggestion, otherwise, press to indent
24+
325
v1.0.9 (2022-12-12)
426

527
- Fix some known bugs

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
![CodeGeeX license](https://img.shields.io/github/license/THUDM/CodeGeeX?colorA=0B9FE0&colorB=brightgreen)
66
![CodeGeeX vscode extension version](https://img.shields.io/visual-studio-marketplace/v/aminer.codegeex?colorA=0B9FE0&colorB=brightgreen)
77
![CodeGeeX download](https://img.shields.io/visual-studio-marketplace/d/aminer.codegeex?colorA=0B9FE0&colorB=brightgreen)
8-
![CodeGeeX API calls per week](https://img.shields.io/badge/dynamic/json?label=API%20calls&query=%24.result.count&suffix=%2Fweek&url=http%3A%2F%2Ftianqi.aminer.cn%2Fapi%2Fv1%2Fapi%2Fcodegeex%2Fdashboard%3Ftime_type%3Dweeks&colorA=0B9FE0&colorB=brightgreen)
98
![CodeGeeX vscode extension rating](https://img.shields.io/visual-studio-marketplace/stars/aminer.codegeex?colorA=0B9FE0&colorB=brightgreen)
109
![CodeGeeX vscode extension last update](https://img.shields.io/visual-studio-marketplace/last-updated/aminer.codegeex?colorA=0B9FE0&colorB=brightgreen)
1110
[![CodeGeeX github stars](https://img.shields.io/github/stars/THUDM/CodeGeeX?style=social)](https://github.com/THUDM/CodeGeeX)
@@ -14,7 +13,17 @@ CodeGeeX is an AI-based coding assistant, which can suggest code in the current
1413

1514
In addition, with the large-scale model, CodeGeeX can translate codes to other programming languages, and provides customizable features (**Prompt Mode**) to help you configure your own programming assistant. Happy coding!
1615

17-
Please kindly let us know if you encounter any problem or have any suggestion, via [codegeex@aminer.cn](mailto:codegeex@aminer.cn). Or you can also fill out the survey(https://wj.qq.com/s2/11260705/6cd6/)/问卷(https://wj.qq.com/s2/11259178/fd49/) to tell us about all your feelings for our extension.
16+
Please kindly let us know if you encounter any problem or have any suggestion, via [codegeex@aminer.cn](mailto:codegeex@aminer.cn). Or you can join our [Slack](https://join.slack.com/t/codegeexworkspace/shared_invite/zt-1m76zecsi-~JW59Jmvx09lX4Pqv9oE_w) or [Telegram](https://t.me/+IipIayJ32B1jOTg1) or [WeChat/微信群](https://wj.qq.com/s2/11274205/a15b/) to give us your feedback or get support. Furthermore, welcome to fill out the [survey](https://wj.qq.com/s2/11260705/6cd6/)/[问卷](https://wj.qq.com/s2/11259178/fd49/) to tell us about all your feelings for our extension.
17+
18+
### Quick menu:
19+
20+
**[Basic Usage](#basic-usage)**<br/>
21+
**[Privacy](#privacy)**<br/>
22+
**[Guidance](#guidance)**<br/>
23+
&emsp;***[Stealth Mode](#stealth-mode)***<br />
24+
&emsp;***[Interactive Mode](#interactive-mode)***<br/>
25+
&emsp;***[Translation Mode](#translation-mode)***<br/>
26+
&emsp;***[Prompt Mode](#prompt-mode)***<br/>
1827

1928
## Basic Usage
2029
Make sure vscode version is >= 1.68.0. Install the extension and enable it globally. There are three modes of usage:
@@ -31,7 +40,7 @@ We highly respect the privacy of your code. The code is only used as the input o
3140
## Guidance
3241
Please see the details and examples for how to use the three modes in CodeGeeX:
3342
### Stealth mode
34-
In this mode, CodeGeeX will start generating codes when you stop writing (the icon at the bottom of VSCode starts spinning). When the generated code is shown in gray, just press ``Tab`` to insert the generated codes. You can also press ``Alt/Option+[`` or ``]`` to change between candidates. If you are not satisfied with the current suggestions, you can also press ``Alt/Option+N`` to get new suggestions. Change the number of candidates in the extension settings ``Candidate Num`` (more candidates will slow down the generation speed). **Note**: The generation always starts at the current position of your cursor, thus if you modify the code before the generation is finished, it will probably cause bugs. We keep working on making the generation faster.
43+
In this mode, CodeGeeX will start generating codes when you stop writing (the icon at the bottom of VSCode starts spinning). When the generated code is shown in gray, just press ``Tab`` to insert the generated codes. You can also press ``Alt/Option+[`` or ``]`` to change between candidates. If you are not satisfied with the current suggestions, you can also press ``Alt/Option+\`` to get new suggestions. Change the number of candidates in the extension settings ``Candidate Num`` (more candidates will slow down the generation speed). **Note**: The generation always starts at the current position of your cursor, thus if you modify the code before the generation is finished, it will probably cause bugs. We keep working on making the generation faster.
3544

3645
![image](https://lfs.aminer.cn/misc/wangshan/pretrain/codegeex/bubble_sort_go.gif)
3746

package.json

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"publisher": "AMiner",
33
"name": "codegeex",
44
"displayName": "CodeGeeX",
5-
"description": "We introduce CodeGeeX, a large-scale multilingual code generative model with 13 billion parameters, pretrained on a large code corpus of more than 20 programming languages.",
6-
"homepage": "https://models.aminer.cn/codegeex",
5+
"description": "CodeGeeX is an AI-based coding assistant, which can suggest code in the current or following lines. It is powered by a large-scale multilingual code generation model with 13 billion parameters, pretrained on a large code corpus of more than 20 programming languages.",
6+
"homepage": "https://codegeex.ai",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/THUDM/CodeGeeX"
1010
},
1111
"icon": "codegeex_logo.png",
12-
"version": "1.1.0",
12+
"version": "1.1.2",
1313
"engines": {
1414
"vscode": "^1.68.0"
1515
},
@@ -19,6 +19,19 @@
1919
"Machine Learning",
2020
"Other"
2121
],
22+
"keywords": [
23+
"python",
24+
"go",
25+
"java",
26+
"javascript",
27+
"c++",
28+
"c#",
29+
"php",
30+
"typescript",
31+
"ai",
32+
"autocomplete",
33+
"inline completion"
34+
],
2235
"activationEvents": [
2336
"*"
2437
],
@@ -106,12 +119,12 @@
106119
"type": "object",
107120
"additionalProperties": "string",
108121
"default": {},
109-
"description": "DisabledFor is a list of specific languages that will be disabled temporarily for the extension, you can set manully language* as the key and then set the value true to disable a language or false to re-enable it in workspace settings (this will need to restart vscode) or do this by clicking icon in the status bar.\n*language should be a valid vscode language id, like python, shellscript, csharp, objective-cpp and etc. You can click the language option in status bar to find the list and language ids are in the parentheses."
122+
"markdownDescription": "DisabledFor is a list of specific languages that will be disabled temporarily for the extension, you can set manully language* as the key and then set the value true to disable a language or false to re-enable it settings (this will need to restart vscode) or do this by clicking icon in the status bar. <br/>* *language should be a valid vscode language id, like python, shellscript, csharp, objective-cpp and etc.* You can click the language option in status bar to find the list and language ids are in the parentheses."
110123
},
111124
"Codegeex.EnableExtension": {
112125
"type": "boolean",
113126
"default": true,
114-
"description": "This will decide if you enable the stealth mode of the extension."
127+
"description": "Check this if you want to enable stealth mode of the extension."
115128
},
116129
"Codegeex.GenerationPreference": {
117130
"type": "string",
@@ -125,7 +138,7 @@
125138
"Codegeex.OnlyKeyControl": {
126139
"type": "boolean",
127140
"default": null,
128-
"description": "This will decide if you want to get suggestions only in need by pressing alt/option+n"
141+
"description": "Check this if you want to get suggestions only in need by pressing alt/option+\\ in stealth mode."
129142
},
130143
"Codegeex.PromptTemplates(Experimental)": {
131144
"type": "object",
@@ -143,7 +156,7 @@
143156
"Codegeex.Survey": {
144157
"type": "boolean",
145158
"default": null,
146-
"markdownDescription": "This is decided by if you have chosen to make a survey. If you want to make the survey again, you can click the link:<br>[EN]:https://wj.qq.com/s2/11260705/6cd6/<br>[CN]:https://wj.qq.com/s2/11259178/fd49/"
159+
"markdownDescription": "This is decided by if you have chosen to make a survey. If you want to make the survey again, you can click the link: [survey](https://wj.qq.com/s2/11260705/6cd6/)/[问卷](https://wj.qq.com/s2/11259178/fd49/)"
147160
},
148161
"Codegeex.Translation": {
149162
"type": "string",
@@ -152,7 +165,7 @@
152165
"comment"
153166
],
154167
"default": "comment",
155-
"description": "When inserting code translated, you want to ___ original code"
168+
"description": "When inserting code translated, you want to ___ original code when you use the translation mode."
156169
}
157170
}
158171
}
@@ -171,7 +184,7 @@
171184
},
172185
{
173186
"command": "codegeex.new-completions",
174-
"key": "Alt+N",
187+
"key": "Alt+\\",
175188
"when": "editorFocus && !editorReadonly"
176189
},
177190
{

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,12 @@ export async function activate(context: vscode.ExtensionContext) {
169169
if (onlyKeyControl) {
170170
context.globalState.update("DisableInlineCompletion", true);
171171
} else {
172+
context.globalState.update("DisableInlineCompletion", false);
172173
context.subscriptions.push(
173-
//vscode.commands.registerCommand('codegeex.inline-completions',()=>
174174
vscode.languages.registerInlineCompletionItemProvider(
175175
{ pattern: "**" },
176176
inlineProvider
177177
)
178-
//)
179178
);
180179
}
181180

@@ -204,6 +203,7 @@ export async function activate(context: vscode.ExtensionContext) {
204203
"EnableExtension"
205204
);
206205
if (editor) {
206+
207207
changeIconColor(
208208
//@ts-ignore
209209
enableExtension,

src/localconfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const apiSecret = "";
55

66
//write your statistic hert here or disable it
77
export const statApiHerf = "";
8-
export const enableStats = true;
8+
//export const enableStats = true;
99
export const surveyUrlCN = "";
1010
export const surveyUrlEN = "";

src/mode/generationWithInteractiveMode.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ export default async function generationWithInteractiveMode(
2222
cursorPosition.character
2323
);
2424
let code_block = document.getText(selection);
25+
if (
26+
cursorPosition.character === 0 &&
27+
code_block[code_block.length - 1] !== "\n"
28+
) {
29+
code_block += "\n";
30+
}
2531
code_block = code_block
2632
.replaceAll("#", hash)
2733
.replaceAll("+", addSignal)
2834
.replaceAll("&", andSignal);
2935
updateStatusBarItem(myStatusBarItem, g_isLoading, true, "");
30-
await codegeexCodeGen(code_block.trim())
36+
await codegeexCodeGen(code_block)
3137
.then(() =>
3238
updateStatusBarItem(myStatusBarItem, g_isLoading, false, "Done")
3339
)

src/mode/generationWithPrompMode.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ export async function generateWithPromptMode(
2020
let custom_prompts = {};
2121
for (let key of keys) {
2222
if (key != "explanation") {
23-
items.push({ label: key, description: "" });
24-
// @ts-ignore
25-
custom_prompts[key] = await readTemplate(templates[key]);
23+
try {
24+
// @ts-ignore
25+
custom_prompts[key] = await readTemplate(templates[key]);
26+
items.push({ label: key, description: "" });
27+
} catch (err) {
28+
console.log(err);
29+
}
2630
}
2731
}
28-
console.log(custom_prompts);
2932

3033
vscode.window.showQuickPick(items).then((selection) => {
3134
if (!selection) {

src/param/configures.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const translationInsertMode = configuration.get("Translation");
3838
export const enableExtension = configuration.get("EnableExtension", true);
3939
export const acceptedsurvey = configuration.get("Survey", null);
4040
export const completionDelay = configuration.get("CompletionDelay", 0.5);
41-
export const choseModel = configuration.get("Codex.Model");
4241
export const templates = configuration.get("PromptTemplates(Experimental)", {});
4342
export const onlyKeyControl = configuration.get("OnlyKeyControl");
4443
export const controls = {

src/param/constparams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { localeCN } from "../locales/localeCN";
44
import { localeEN } from "../locales/localeEN";
55

66
export const extensionId = "aminer.codegeex";
7-
export const extensionVersion = "1.1.0";
7+
export const extensionVersion = "1.1.2";
88
export const myScheme = "codegeex";
99

1010
//api to do the statistics of data

0 commit comments

Comments
 (0)