LiXizhi / NPL

Lua, NPL, ParaEngine, Language Service
24 stars 10 forks source link

about space before -- #13

Closed LiXizhi closed 7 years ago

LiXizhi commented 7 years ago

The default comment command will generate following comment code

--function FuncExpression:CompileCode(ast)
     --return {ast:tostring()}
--end

which will be formated to

--function FuncExpression:CompileCode(ast)
--return {ast:tostring()}
--end

this makes decomment difficult. how about ignore all spaces before --?

same is true, such as

local a;      -- this is a
DarrenGZY commented 7 years ago

need some time think about this

DarrenGZY commented 7 years ago

I'm thinking of changing comment style rather than formatting style. Put comment string at start of the line.

function FuncExpression:CompileCode(ast)
      return {ast:tostring()}
end

after comment


--function FuncExpression:CompileCode(ast)
--      return {ast:tostring()}
--end