Skip to content

Commit

Permalink
提交0.1.5 版本源码
Browse files Browse the repository at this point in the history
  • Loading branch information
k0204 committed Mar 26, 2017
1 parent 9a0fde6 commit abd7ca3
Show file tree
Hide file tree
Showing 88 changed files with 13,857 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
out
node_modules
9 changes: 9 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.vscode/**
.vscode-test/**
out/test/**
test/**
src/**
**/*.map
.gitignore
tsconfig.json
vsc-extension-quickstart.md
11 changes: 11 additions & 0 deletions License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@

# LuaIde
1. author:kangping
1. luaIde 是基于vscode开发的一款用于lua语言开发者使用的插件
1. 目标:致力于做最好的lua开发工具
1. 更新:luaide 个人开发者开发 持续更新
1. 是否开源:开源 (2017年3月28日将上传github)
1. 是否开源:开源
1. 平台支持:win,mac

# 文档  请直接查看wiki

#重要提示
1. 由于上传了源码 所以原来下载 LuaDebug 的地址由 lua/LuaDebug.lua 修改为 luaDebug/LuaDebug.lua
#更新记录
1. 0.1.5 修改代码格式化bug
1. 将源代码提交至github


#注意: 0.1.0 版本改动比较大请删除.vscode/launch.json 文件 重写生成调试文件
#qq群 494653114
# LuaDebug.lua [下载地址](https://github.com/k0204/LuaIde) (lua/LuaDebug.lua)
# 文档请直接查看[wiki](https://github.com/k0204/LuaIde/wiki)

# 捐献
如果你想支持LuaIde 的开发 可以通过微信 扫下面的二维码进行支持
![IDE](https://coding.net/u/k0204/p/imgres/git/raw/master/money.png)
![IDE](https://coding.net/u/k0204/p/imgres/git/raw/master/money.png)
2 changes: 1 addition & 1 deletion Template/FileTemplates/TestTemplate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ end
function {moduleName}:test1()

end
return {moduleName}
return {moduleName}
Empty file.
7 changes: 7 additions & 0 deletions Template/funTemplate/CreateFunctionTemplate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--@desc
--time:{time}
{paramdesc}
--return
function {functionName}({param})

end
9 changes: 9 additions & 0 deletions Template/funTemplate/CreateModuleFunctionTemplate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--=======================================
--@desc
--time:{time}
{paramdesc}
--return
--=======================================
function {moduleName}:{functionName}({param})

end
5 changes: 5 additions & 0 deletions images/donate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<body>
谢谢你的支持,LuaIde 会继续优化,为你的工作节约更多的时间!
<br/>
<img src="wechat.png" height="160" width="176" />
</body>
134 changes: 134 additions & 0 deletions images/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<body style="background-color: white">
<p style="text-align:center;">
<strong><span style="font-size:16px;">欢迎使用luaIde</span></strong>
</p>
<p style="text-align:left;">
<span style="font-size:16px;"><span style="font-size:14px;"></span><span style="font-size:12px;color:#333333;">luaIde 是基于vscode开发的一款用于lua语言开发者使用的插件</span><br
/>
<span style="font-size:12px;color:#333333;">目标:致力于做最好的lua开发工具</span><br />
<span style="font-size:12px;color:#333333;">作者:k0204(kangping)</span><br />
<span style="font-size:12px;color:#333333;">更新:luaide 个人开发者开发 持续更新</span><br />
<span style="font-size:12px;color:#333333;">是否开源:开源 (2017年3月28日将上传github)</span><br />
<span style="font-size:12px;color:#333333;">平台支持:win,mac</span></span>
</p>
<p style="text-align:left;">
<span style="font-size:24px;"><span style="font-size:12px;color:#333333;">开源地址:</span><span style="font-size:12px;color:#333333;">&nbsp;</span>
<a href="https://github.com/k0204/LuaIde" target="_blank"><span style="font-size:12px;color:#333333;">github</span></a>
<span style="font-size:12px;color:#333333;">&nbsp;</span>
</span>
</p>
<p style="text-align:left;">
<span style="font-size:12px;"><span style="font-size:12px;color:#333333;">文档地址:</span><a href="https://github.com/k0204/LuaIde/wiki"
target="_blank"><span style="font-size:12px;color:#333333;">wiki</span></a></span>
</p>
<p style="text-align:left;">
<span style="color:#333333;">演示视频地址:</span>
</p>
<ol>
<li>
<h3 class="title" style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:#FFFFFF;">
<a href="https://v.qq.com/x/page/q0385b2ipgl.html" target="_blank"><span style="color:#333333;">LuaIde-安装</span></a>
<span style="color:#333333;">&nbsp;&nbsp;</span>
</h3>
</li>
<li>
<p>
<a href="https://v.qq.com/x/page/t0385ky0bq6.html" target="_blank"><span style="color:#333333;">下载Lua调试文件</span></a>
</p>
</li>
<li>
<p style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:#FFFFFF;">
<a href="https://v.qq.com/x/page/o0385pgruga.html" target="_blank"><span style="color:#333333;">LuaIde mac 调试 cocos</span></a>
</p>
</li>
<li>
<p style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:#FFFFFF;">
<a href="https://v.qq.com/x/page/p0385eyjmtv.html" target="_blank"><span style="color:#333333;">LuaIde mac ulua Debugger</span></a>
</p>
</li>
<li>
<p style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:#FFFFFF;">
<span style="color:#333333;"><a href="https://v.qq.com/x/page/c0385cjbsdo.html" target="_blank"><span style="color:#333333;">LuaIde Ulua Ios 调试视频</span></a>
</span>
</p>
</li>
<li>
<p style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:#FFFFFF;">
<a href="https://v.qq.com/x/page/w03868nk91m.html" target="_blank"><span style="color:#333333;">cococ2dx 2.x windows调试视频</span></a>
</p>
</li>
<li>
<h3 class="title" style="font-size:14px;font-weight:normal;color:#2A2A2A;font-family:PingFangSC-Regular, Tahoma, &quot;background-color:rgba(248, 248, 248, 0.0313726);">
<a href="https://v.qq.com/x/page/b0386x0y2dw.html" target="_blank"><span style="color:#333333;">cocos2dx 3.x windows 调试视频</span></a>
</h3>
</li>
<li>
<span style="color:#333333;">由于个人时间有限,后续会添加其他环境的演示视频</span>
<p>
<br />
</p>
</li>
</ol>
<p>
<br />
</p>
<p style="text-align:left;">
<span style="color:#333333;">&nbsp;版本更新记录:</span>
</p>
<p style="text-align:left;">
<span style="color:#333333;">&nbsp; &nbsp;</span><strong><span style="color:#333333;"> 0.1.3 &nbsp;(2017/3/21)</span></strong>
</p>
<ol>
<li>
<span style="color:#333333;">修改format else时会多出一行</span>
</li>

<li>
<span style="color:#333333;">添加index 欢迎界面</span>
</li>
</ol>
<p style="text-align:left;">
<span style="color:#333333;">&nbsp; &nbsp;</span><strong><span style="color:#333333;"> 0.1.2 &nbsp;(2017/3/21)</span></strong>
</p>
<ol>

<li>
<span style="color:#333333;">添加方法调用时 不适用() 强制报错,提升代码规范 &nbsp;</span>
<s><span style="color:#333333;">show name&nbsp;</span></s><span style="color:#333333;">这种方法调用将直接报错</span>
</li>
<li>
<span style="color:#333333;">去掉代码提示中的 方法加() 和 table 加[] ,去掉重复代码提示</span>
</li>
<li>
<span style="color:#333333;">修复self. 或者 self: 或将其他文件中的方法或属性提示出来bug</span>
</li>

</ol>
<p>
<span style="color:#333333;">捐献:</span>
</p>
<p>
<img src="https://raw.githubusercontent.com/k0204/LuaIde/master/images/wechat.png" height="80" width="88" />
</p>
<h2 style="font-family:Simsun;">
<br />
</h2>
<p style="text-align:left;">
<strong></strong><strong><br />
<br />
</strong>
</p>

<script>
var _mtac = {};
(function () {
var mta = document.createElement("script");
mta.src = "http://pingjs.qq.com/h5/stats.js?v2.0.4";
mta.setAttribute("name", "MTAH5");
mta.setAttribute("sid", "500419886");
mta.setAttribute("cid", "500420053");
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(mta, s);
})();
</script>
</body>
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added luadebug/.DS_Store
Binary file not shown.
127 changes: 127 additions & 0 deletions luadebug/DevSyncCode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
--开发模式同步代码工具
local DevSyncCode = {}
function DevSyncCode:ctor()
--所以需要更新的代码实例
self.classInstances = {}

end
function DevSyncCode:addInstances(ins)
table.insert( self.classInstances,ins)
end
--读取修改后的lua 文件并修改内存
function DevSyncCode:updateLuaCode(packageName)
if (packageName == nil or packageName == "") then return end

local oldInfo = package.loaded[packageName]
if(oldInfo == nil) then
return
end

local package1 = package

package.loaded[packageName] = nil
--先存储所以得全局变量
local temp_G = {}
for k,v in ipairs(package.loaded._G) do
temp_G[k] = v
end
local newInfo = nil
--重新require
local requireUpdateLua=function ( ... )
newInfo = require(packageName)
end

tryCatch=function(fun)
local ret,errMessage=pcall(fun);
if(ret == false) then
package.loaded[packageName] = oldInfo
local _g = package.loaded._G
for k,v in ipairs(temp_G) do
if(k ~= "CSBTableCache") then
_g[k] = v
end

end
print("存在错误不处理:"..packageName)
elseif(ret) then


--重新require 后把所以得全局变量都还原
--这么做的原因是因为 如果不做这样的处理 会导致 已经修改过的全局变量 会在
--require 时 更新成初始的值 所以本工具不支持修改代码中的值直接生效
--所以得更改都应该在代码中去进行 才能及时生效
local _g = package.loaded._G
for k,v in ipairs(temp_G) do
_g[k] = v
end


--先把原有的信息在package 中删除 不然没法重新require
local tempInfo = {}
if(type(oldInfo) == "table") then
for k,v in pairs(oldInfo) do
if(type(v) ~= "function") then
tempInfo[k] = v
else
self:replaceEventManagerHandler(oldInfo,v,newInfo[k])
end
end
end
local infoType = type(newInfo)
if (infoType == "table") then

--如果为table 那么需要替换以前的
for k,v in pairs(newInfo) do

local typestr = type(v)
if(typestr == "function") then
oldInfo[k] = v
end
end
local currentInfo = oldInfo
if(newInfo.__ctype) then
package.loaded[packageName] = oldInfo
else
currentInfo =newInfo
end
--将现有的值进行赋值达到只替换代码逻辑而不修改值得效果
for k,v in pairs(tempInfo) do
if(type(v) ~= "function") then
currentInfo[k] = v
end
end
--下面这些是修改创建出来的userdata 数据
if (newInfo.__ctype == 1) then
local delTable = {}

for k,v in ipairs(__dscInstances__) do

if (not tolua.isnull(v)) then
local itype = type(v)
if (itype == "userdata") then
if (iskindof(v,newInfo.__cname)) then
self:replaceInfo(v,newInfo)
end
end
else
table.insert(delTable,v)
end
end
self:delTables(__dscInstances__,delTable)

end

end
print("处理完毕:"..packageName)
end
end

tryCatch(requireUpdateLua);




end


return DevSyncCode
File renamed without changes.
Loading

0 comments on commit abd7ca3

Please sign in to comment.