Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 12 additions & 2 deletions luahelper-vscode/src/common/luaPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class LuaPath {
let retStr: string = "";
let suffixStr: string = "";
let platform: string = os.platform();
let arch = os.machine();
switch (platform) {
case "win32":
let suffixVerStr: string = luaVersionStr.replace(".", "");
Expand All @@ -83,7 +84,11 @@ export class LuaPath {
suffixStr = "/debugger/luasocket/linux/lua" + luaVersionStr + "/lua";
break;
case "darwin":
suffixStr = "/debugger/luasocket/mac/lua" + luaVersionStr + "/lua";
if (arch === "arm64") {
suffixStr = "/debugger/luasocket/mac/arm64/lua" + luaVersionStr + "/lua";
} else {
suffixStr = "/debugger/luasocket/mac/x64/lua" + luaVersionStr + "/lua";
}
break;
}
retStr = stdPath + suffixStr;
Expand All @@ -99,6 +104,7 @@ export class LuaPath {
let retStr: string = "";
let suffixStr: string = "";
let platform: string = os.platform();
let arch = os.machine();
switch (platform) {
case "win32":
suffixStr = "/debugger/luasocket/win/x64/lua" + luaVersionStr + "/?.dll";
Expand All @@ -107,7 +113,11 @@ export class LuaPath {
suffixStr = "/debugger/luasocket/linux/lua" + luaVersionStr + "/?.so";
break;
case "darwin":
suffixStr = "/debugger/luasocket/mac/lua" + luaVersionStr + "/?.so";
if (arch === "arm64") {
suffixStr = "/debugger/luasocket/mac/arm64/lua" + luaVersionStr + "/?.so";
} else {
suffixStr = "/debugger/luasocket/mac/x64/lua" + luaVersionStr + "/?.so";
}
break;
}
retStr = stdPath + suffixStr;
Expand Down
3 changes: 2 additions & 1 deletion luahelper-vscode/src/debug/luaDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ export class LuaDebugSession extends LoggingDebugSession {
let runCMD = pathCMD + cpathCMD + reqCMD + doFileCMD;

let LuaCMD = strVect[0] + " -e ";
this._debugFileTermianl.sendText(LuaCMD + runCMD, true);
this._debugFileTermianl.show();
//兼容terminal启动耗时较长的情况,延迟发送命令
setTimeout(() => this._debugFileTermianl.sendText(LuaCMD + runCMD, true), 2000);
}
else{
// 非单文件调试模式下,拉起program
Expand Down
36 changes: 25 additions & 11 deletions luahelper-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,17 +480,31 @@ async function copyLuaSocket() {

vscode.window.showInformationMessage("copy lua socket " + selectWord.label + " lib success.");
} else if (process.platform === "darwin") {
srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/' + selectWord.label + "/socket");
let cmdStr1 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr1);
child_process.execSync(cmdStr1);

srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/' + selectWord.label + "/mime");
let cmdStr2 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr2);
child_process.execSync(cmdStr2);

vscode.window.showInformationMessage("copy lua socket " + selectWord.label + " lib success.");
if (process.arch === "arm64") {
srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/arm64/' + selectWord.label + "/socket");
let cmdStr1 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr1);
child_process.execSync(cmdStr1);

srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/arm64/' + selectWord.label + "/mime");
let cmdStr2 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr2);
child_process.execSync(cmdStr2);

vscode.window.showInformationMessage("copy lua socket " + selectWord.label + " lib success.");
} else {
srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/x64/' + selectWord.label + "/socket");
let cmdStr1 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr1);
child_process.execSync(cmdStr1);

srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/mac/x64/' + selectWord.label + "/mime");
let cmdStr2 = "cp -R " + srcCopyDir + " " + dstPath + "/";
console.log("cmdStr:%s", cmdStr2);
child_process.execSync(cmdStr2);

vscode.window.showInformationMessage("copy lua socket " + selectWord.label + " lib success.");
}
} else if (process.platform === "linux") {
srcCopyDir = path.join(Tools.VSCodeExtensionPath, '/debugger/luasocket/linux/' + selectWord.label + "/socket");
let cmdStr1 = "cp -a " + srcCopyDir + " " + dstPath + "/";
Expand Down
3 changes: 2 additions & 1 deletion luahelper-vscode/src/luapandaDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ export class LuaConfigurationProvider implements vscode.DebugConfigurationProvid

let LuaCMD = strVect[0] + " -e ";

LuaConfigurationProvider.RunFileTerminal.sendText(LuaCMD + runCMD, true);
LuaConfigurationProvider.RunFileTerminal.show();
//兼容terminal启动耗时较长的情况,延迟发送命令
setTimeout(() => LuaConfigurationProvider.RunFileTerminal.sendText(LuaCMD + runCMD, true), 2000);
return;
}

Expand Down