Subject: Re: [9fans] Codebase navigation and using tags files in acme

From: Ole-Hjalmar Kristensen <[email-masked]>
Date: Fri, 20 Aug 2021 12:55:49 +0200

I use clangd. Works very well in general. Using it is simple, you launch
clangd via acme-lsp like this:
acme-lsp -server '(\.h)|(\.cc)$:/home/ole/bin/clangd_10.0.0/bin/clangd
--clang-tidy --background-index --cross-file-rename' -workspaces
/home/ole/xcomtest

On Thu, Aug 19, 2021 at 5:51 AM <[email-masked]> wrote:

> I had never heard of acme-lsp and LSP (except as a Microsoft internal
> thing) until gabi mentioned it earlier in the thread.  I'm interesting in
> playing with acme-lsp for C++.  Which LSP server do you use for C/C++ (I
> see several listed at https://langserver.org/)?
>
>     thanks,
>     Peter
>
> On 2021-08-18 02:26, Ole-Hjalmar Kristensen
> ole.hjalmar.kristensen-at-gmail.com |9fans| wrote:
>
> On linux, you can run ctags -x and postprocess the file to append the line
> number to the file name instead of having i as a separate field. That way,
> you can locate the symbol in the tags file, and right-click on the
> file:linenumber.
>
> Also, on linux, we have acme-lsp, which in principle works with any LSP
> server. I have tested it with go and C/C++.
>
> On Tue, Aug 17, 2021 at 10:22 PM Ben Hancock <[email-masked]> wrote:
>
>> Hello 9fans,
>> 
>> I've just recently started using the acme editor and am really enjoying
>> it, and trying to get the hang of the "acme way" of doing things. One
>> bit of functionality that I'm familiar with from other editors is the
>> ability to easily look up a function or symbol definition within a
>> codebase. In Emacs and vi, this is done by generating tags files (etags
>> or ctags), which those editors can parse and allow you to easily jump to
>> a definition of the symbol under the point/cursor.
>> 
>> What's the preferred method or workflow for achieving this in acme? I
>> have tried passing a selected symbol to 'g -n' in the window's tag,
>> using the Mouse-2 + Mouse-1 chord. That gets me part of the way there
>> but isn't effective if the file where the symbol is defined happens to
>> be in another directory. I feel like I'm missing something.
>> 
>> Many thanks!
>> 
>> - Ben
>> 
>> --
>> Ben Hancock
>> www.benghancock.com
>
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M652caba65026de9632210a05>
>

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M15ec62c316baf8b49043cae2
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

---

From: [email-masked]
Date: Fri, 20 Aug 2021 16:08:40 -0700

I did port Exuberant ctags several years ago when I was
dealing with a large body of unfamiliar code for a
project. Mine is here:
        http://9p.io/sources/contrib/anothy/src/ctags/
It is a pretty straight-forward port, just adding an
output type suitable for acme (file:n). About a year
ago (I think?) someone told me that they did an
updated port, but I can't find the reference quickly.
Personally, I find ctags (and similar tools) useful
only in extreme circumstances, and otherwise rely only
on acme's built-in matching and a few scripts similar
to what's been posted here.

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M32237c6cd7f205230d8b175a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

---

From: Steve Simon <[email-masked]>
Date: Sat, 21 Aug 2021 00:31:35 +0100

I wrote a bit of lex to extract features from c code. being lex it is incomplete to say the least but i found it good enough.

my code used to run every night passed a list of files to parse, and wrote an idenifier, comment, function, #define etc database (2 text files) which i could grep through.

i used it when i worked supporting solaris, it allowed me to find error messages and functions anywhere in the sourcecode quickly.

i haven't run it in years but maybe it is of use to someone.

http://www.quintile.net/pkg/xid.tbz

-Steve

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M5630d14b408680d32b257869
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription