On Sun, Sep 27, 2015 at 9:21 AM, Bas van den Berg
<[email protected]> wrote:
> Hi,
>
> I'm developing a C-like language, called C2 (c2lang.org). Now the compiler is
> roughly working, I am working on a vim plugin called c2tags. The 'tags' file
> is generated by a compiler plugin, so is completely correct (well it should
> be) and all symbol references are indexed.
>
> What I'm trying to do:
> + create basic plugin that call c2tags with current file, line, col and
> symbol (DONE)
> + have c2tags open data file and do lookup. Currently it prints the resulting
> file, line and col to stdout.
> - have the vim plugin read the result somehow
> - have the vim plugin jump to the correct location and push it on the tags
> stack
>
> The first 2 parts are working, but I have trouble finding a way to return
> data from an external tool back into the plugin. Ctags seems to be reading
> the data file itself (from what I understand from reading the code).
>
> For the 2nd part, I have a way to jump to line, col, but haven't found a good
> way to jump to another file and to push it to the location stack (so that
> ctrl-t pops it again)
>
> Any hints would be very welcome,
>
> Cheers,
> Bas
Ctags reads the source to generate the tags file. IIUC it is possible
to define a new language for Exuberant Ctags but I'm not sure how. If
you generate your tags file some other way you probably don't need it,
unless you want to merge your tags file with tag definitions for
sources in languages other than yours and residing in the same
directory.
About quickfix lists and location lists, see
:help quickfix.txt
and in particular
:help compiler-select
:help error-file-format
To jump to a specific line in another file, replacing the current
editfile if not modified,
:e +1234 filename.ext
should work (with, of course, 1234 and filename.ext replaced by the
correct values). Or you could use a quickfix list, and use one or more
of the commands
:cnext
:cprev
:cnfile
:cpfile
:cfirst
:clast
:copen
:cclose
or the corresponding commands for the window-local location list.
Quickfix lists are typically used to browse the source lines
corresponding to compiler errors and warnings, or the results of the
:grep, :vimgrep and :helpgrep commands. For each compiler there should
be a corresponding compiler plugin to Vim, to define the corresponding
'errorformat' and (IIUC) 'errorfile' options.
Best regards,
Tony.
--
--
You received this message from the "vim_dev" 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 because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.