Skip to content

Commit

Permalink
Merge pull request #26 from lowcoding/feat/v1.8.2
Browse files Browse the repository at this point in the history
🐞 fix: resetMaterialName
  • Loading branch information
wjkang authored Jun 16, 2024
2 parents 5d7dc4e + 84e3484 commit 9c9a479
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "lowcode",
"description": "lowcode tool, support ChatGPT and other LLM",
"author": "wjkang <ruoxieme@gmail.com>",
"version": "1.8.1",
"version": "1.8.2",
"icon": "asset/icon.png",
"publisher": "wjkang",
"repository": "https://github.com/lowcoding/lowcode-vscode",
Expand Down
5 changes: 3 additions & 2 deletions src/utils/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getOutputChannel } from './outputChannel';
import { getLastActiveTextEditor } from '../context';
import { getSyncFolder } from './config';
import { createChatCompletionForScript } from './llm';
import { resetMaterialName } from './name';

export const genCodeByBlock = async (data: {
material: string;
Expand All @@ -36,7 +37,7 @@ export const genCodeByBlock = async (data: {
data.privateMaterials
? getPrivateBlockMaterialsPath()
: blockMaterialsPath,
data.material,
resetMaterialName(data.material),
);
const schemaFile = path.join(block, 'config/schema.json');
const schama = fs.readJSONSync(schemaFile);
Expand Down Expand Up @@ -161,7 +162,7 @@ export const genCodeBySnippet = async (data: {
data.privateMaterials
? getPrivateSnippetMaterialsPath()
: snippetMaterialsPath,
data.name,
resetMaterialName(data.name),
);
const scriptFile = path.join(snippetPath, 'script/index.js');
const hook = {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const resetMaterialName = (name: string) => {
const arrayStr = name.split('] ');
return arrayStr[1] || name;
};

0 comments on commit 9c9a479

Please sign in to comment.