Wednesday, June 30, 2010

Re: question about lua source navigation

thanks Gary. Then I show the code here:
the generated tag has a line looks like this:
TaskHandler.prizeTask .\init\taskHandler.lua /^function TaskHandler.prizeTask(plr, task)$/;" f
and I have a function:
function Task:succeed()
debug_log("Task:succeed")
self.isSucceed = true
TaskHandler.prizeTask(self.owner, self)
self:eventOnSuccess()
if self.spanTimerId > 0 then self:clearSpanTimer() end
self.owner:addFinishedTask(self)
if self.entry.type == taskType.TASK_TYPE_MAIN then
self.owner:setSaveRecord("MainTask", self:getId(), 0)
else
end
if self.entry.nexttask ~= nil and self.entry.nexttask ~= 0 then
debug_log("self.owner:addTask")
self.owner:addTask(self.entry.nexttask)
end
end
 
in the file task.lua in the subdirectory of where the tags file lies. While my cursor on "prizeTask", I press Ctrl-], only to find it shows me an error that can't find the tag: prizeTask. So it is.

On Wed, Jun 30, 2010 at 3:42 PM, Gary Johnson <garyjohn@spocom.com> wrote:
On 2010-06-30, X Heruacles wrote:
> I'm just learning lua and I use vim to navigate some lua projects. I  use ctags
> to generate tags using a map:
>
>     map <F12>  <Esc>:!ctags -R .<CR>
>
> but it rarely helps. When I want to jump to some function definition, it always
> errs. Then I checked the generated tag and it seems fine. So my question is
> just is there a better way to navigate lua project?(esp. jumping to function
> definition?)

I don't know what else might be available for navigating Lua, but
the ctags web page at SourceForge says that it understands Lua, and
you write that the tags appear fine, so I would suggest that you
find out why your Lua tags aren't working as you expect and fix that
problem.  If you post a short file containing Lua code and explain
what you do and what happens when you try to jump to a tag in that
code, we might be able to spot the problem and give you a solution.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment