Skip to content

Commit de85a82

Browse files
authored
Merge pull request #168 from covespace/add_tags
Add tags
2 parents 69837e8 + 59ba922 commit de85a82

File tree

6 files changed

+120
-3
lines changed

6 files changed

+120
-3
lines changed

package.json

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "devchat",
33
"displayName": "DevChat",
44
"description": "Write prompts, not code",
5-
"version": "0.0.49",
5+
"version": "0.1.8",
66
"icon": "assets/devchat.png",
77
"publisher": "merico",
88
"engines": {
@@ -13,7 +13,45 @@
1313
"url": "https://github.com/covespace/devchat-vscode.git"
1414
},
1515
"categories": [
16-
"Other"
16+
"Programming Languages",
17+
"Snippets",
18+
"Machine Learning",
19+
"Education"
20+
],
21+
"keywords": [
22+
"ai",
23+
"anthropic",
24+
"assistant",
25+
"autocomplete",
26+
"bot",
27+
"chat",
28+
"chatbot",
29+
"codegen",
30+
"c#",
31+
"c++",
32+
"codex",
33+
"co-pilot",
34+
"devchat",
35+
"documentation",
36+
"go",
37+
"golang",
38+
"intellisense",
39+
"java",
40+
"javascript",
41+
"keybindings",
42+
"kotlin",
43+
"llm",
44+
"model",
45+
"openai",
46+
"php",
47+
"pilot",
48+
"python",
49+
"refactor",
50+
"ruby",
51+
"sourcegraph",
52+
"snippets",
53+
"test",
54+
"typescript"
1755
],
1856
"activationEvents": [
1957
"*"

src/context/customContext.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import path from 'path';
33
import { logger } from '../util/logger';
44

5-
import { runCommandStringArrayAndWriteOutput, CommandResult } from '../util/commonUtil';
5+
import { runCommandStringArrayAndWriteOutput, runCommandStringAndWriteOutputSync, CommandResult } from '../util/commonUtil';
66

77

88
export interface CustomContext {
@@ -85,6 +85,9 @@ class CustomContexts {
8585
commandArray[index] = arg.replace('${CurDir}', contextDir);
8686
});
8787

88+
if (commandArray.length === 1) {
89+
return runCommandStringAndWriteOutputSync(commandArray[0], outputFile);
90+
}
8891
return await runCommandStringArrayAndWriteOutput(commandArray, outputFile);
8992
}
9093
}

src/util/commonUtil.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,26 @@ export async function getLanguageIdByFileName(fileName: string): Promise<string
180180

181181
export function runCommand(command: string): string {
182182
return childProcess.execSync(command).toString();
183+
}
184+
185+
export function runCommandStringAndWriteOutputSync(command: string, outputFile: string): CommandResult {
186+
try {
187+
const options = {
188+
cwd: UiUtilWrapper.workspaceFoldersFirstPath() || '.'
189+
};
190+
const output = childProcess.execSync(command, options).toString();
191+
const onOutputFile = (command: string, stdout: string): string => {
192+
const data = {
193+
"command": command,
194+
"content": stdout,
195+
};
196+
return JSON.stringify(data);
197+
};
198+
fs.writeFileSync(outputFile, onOutputFile(command, output));
199+
return { exitCode: 0, stdout: output, stderr: '' }
200+
} catch (error) {
201+
logger.channel()?.error(`Error occurred: ${error}`);
202+
logger.channel()?.show();
203+
return { exitCode: 1, stdout: '', stderr: String(error) }
204+
}
183205
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"pattern": "release_note",
3+
"description": "write release note for release",
4+
"message": "write release note for release",
5+
"default": false,
6+
"instructions": ["instruct.txt"]
7+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
As a software developer assistant, your task is to provide clear and concise responses and write release notes based on the given context.
2+
Follow these guidelines:
3+
4+
1. A release note should at least contain two sections, "Highlights" and "Change Log" unless required otherwise.
5+
2. In the "Highlights" section, summarize and list the most important changes in the release, ordered by importance.
6+
3. In the "Change Log" section, list all the changes in the release.
7+
Classify the changes into different subsections, including but not limited to improvements, bug fixes, and documentation.
8+
Try best to void putting changes in a "Other Changes" subsection.
9+
4. For each subsection of "Change Log", further group and summarize the changes into a bullet list.
10+
Try best to group more than one commit into a bullet.
11+
At the end of each bullet, include the issue numbers or commit hashes in parentheses if applicable.
12+
5. Format a release note by enclosing it within a block of triple backticks (```), and include 'release' alongside the beginning backticks.
13+
14+
Here is an example:
15+
```release
16+
## Highlights
17+
18+
- Added commitmsg as block type for commit messages
19+
- Fixed a bug in the order of storing prompts
20+
- Replaced video with gifs in README.md
21+
22+
## Change Log
23+
24+
### Improvements
25+
26+
- Optimized the order of messages (1e6a130)
27+
- Added token counting utils (#32) (e3c2064, 2e6e130)
28+
- Limited token number for Assistant to make prompt (312fbfe, afffe48)
29+
- Added commitmsg as code type for commit messages (f49dd6d)
30+
31+
### Bug Fixes
32+
33+
- Fixed a bug in the order of storing prompts (24d8009)
34+
- Fixed a bug of overwriting request token number (600ea31)
35+
36+
### Documentation
37+
38+
- Replaced video with gifs in README.md (b50f081, d5aa6d2, 3c8a6bf, a5a81a9)
39+
- Updated instruct.txt (27fe87f)
40+
```
41+
42+
If you need more information, ask for it.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "git_log_releasenote",
3+
"description": "git log for write release note",
4+
"command": ["git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:\"%h - %B\""]
5+
}

0 commit comments

Comments
 (0)