* [9fans] Codebase navigation and using tags files in acme @ 2021-08-17 20:22 Ben Hancock 2021-08-18 6:52 ` sirjofri 2021-08-18 9:26 ` Ole-Hjalmar Kristensen 0 siblings, 2 replies; 18+ messages in thread From: Ben Hancock @ 2021-08-17 20:22 UTC (permalink / raw) To: 9fans 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: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M693d75f3d4f4ad66ecaa27e0 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-17 20:22 [9fans] Codebase navigation and using tags files in acme Ben Hancock @ 2021-08-18 6:52 ` sirjofri 2021-08-18 9:12 ` Richard Miller 2021-08-18 9:13 ` Nick Owens 2021-08-18 9:26 ` Ole-Hjalmar Kristensen 1 sibling, 2 replies; 18+ messages in thread From: sirjofri @ 2021-08-18 6:52 UTC (permalink / raw) To: 9fans Hello Ben, 17.08.2021 22:22:09 Ben Hancock <ben@benghancock.com>: > 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. The original developers of Plan 9 software were people who made simple things even simpler so they can understand them. Imagine your codebase is so small that you can know many symbols and have other symbols open or at least know where to look. Using g(rep) in the parent directory of your project and your brain should be enough. If it isn't your project might be too complex/large. (That's different when reading other code or revisiting code after a long time, but then you are supposed to read it again so you can understand it anyway.) > 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. I doubt you are missing something. People used to use text editor since there were no IDEs, and keep in mind that the core of unix was written with ed, maybe even on teletypes. It's like writing code on paper, and it works. My advise is, read and produce good clean code. If you need syntax highlighting and fancy IDE stuff your codebase is probably too large. With more training you can work with larger codebases, but still they to keep it simple and small. If you really need to work with extremely complex codebases you likely won't find success using plan9 at all. Many plan9 tools are one C file only. In acme you can jump between selected text by right clicking it, which works very well in these cases. Right clicking included files opens them and you can search there. These are basically the tools you have. I'm personally very happy reading man pages and searching the plan 9 source with g(rep) and plumbing the results. I hope this helps. Oh, and you can always write your own tools and call them using middle-click in acme. You could write an rc-script that cd..s to your project home directory (if it's a git repo, the one containing .git) and invokes g, for example. sirjofri ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M01a99fa6f5ef08418c3e312f Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 6:52 ` sirjofri @ 2021-08-18 9:12 ` Richard Miller 2021-08-18 9:17 ` Gabriel Diaz Lopez de la Llave via 9fans 2021-08-18 9:13 ` Nick Owens 1 sibling, 1 reply; 18+ messages in thread From: Richard Miller @ 2021-08-18 9:12 UTC (permalink / raw) To: 9fans > If you really need to work with extremely > complex codebases you likely won't find success using plan9 at all. When I need to scrabble around in the go source tree, I usually have something like this in a window (it could go in an acme guide file) grep -n 'func XXX' `{du -a | awk '/\.go$/ {print $2}'} . which I edit and execute as needed. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M6dcc6863b957346e931b418a Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 9:12 ` Richard Miller @ 2021-08-18 9:17 ` Gabriel Diaz Lopez de la Llave via 9fans 2021-08-18 9:25 ` Rob Pike 0 siblings, 1 reply; 18+ messages in thread From: Gabriel Diaz Lopez de la Llave via 9fans @ 2021-08-18 9:17 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 827 bytes --] Hello You might be interested in <https://github.com/fhs/acme-lsp> which implements a laguange server protocol client for acme. gabi On Wed, Aug 18, 2021 at 10:12, Richard Miller <9fans@hamnavoe.com> wrote: >> If you really need to work with extremely >> complex codebases you likely won't find success using plan9 at all. > > When I need to scrabble around in the go source tree, I usually have > something like this in a window (it could go in an acme guide file) > > grep -n 'func XXX' `{du -a | awk '/\.go$/ {print $2}'} . > > which I edit and execute as needed. > ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-Mce7cbdc1e9a228a51d608ea7 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 1802 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 9:17 ` Gabriel Diaz Lopez de la Llave via 9fans @ 2021-08-18 9:25 ` Rob Pike 2021-08-18 16:01 ` Ben Hancock 2021-08-19 11:44 ` Maurizio Boriani 0 siblings, 2 replies; 18+ messages in thread From: Rob Pike @ 2021-08-18 9:25 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 521 bytes --] % cat bin/f #!/bin/sh 9 grep -i -n '^func (\([^)]+\) )?'$1'\(' *.go /dev/null % cat bin/t #!/bin/sh 9 grep -i -n '^type '$1' ' *.go /dev/null % cat bin/cf #!/bin/sh csearch -n -f '\.go$' '^func (\([^)]+\) )?'$1'\(' % cat bin/ct #!/bin/sh csearch -n -f '\.go$' '^type '$1 ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-Mbdc5ec4006124565e51d51f5 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 1136 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 9:25 ` Rob Pike @ 2021-08-18 16:01 ` Ben Hancock 2021-08-19 11:44 ` Maurizio Boriani 1 sibling, 0 replies; 18+ messages in thread From: Ben Hancock @ 2021-08-18 16:01 UTC (permalink / raw) To: 9fans Hi all, My sincere thanks to everyone on the thread for their helpful tips and perspective, with special gratitude to Rob Pike for sharing his handy scripts -- and for creating sam and acme! Best, - Ben -- Ben Hancock www.benghancock.com ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-Me89c407474e415c5457260c5 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 9:25 ` Rob Pike 2021-08-18 16:01 ` Ben Hancock @ 2021-08-19 11:44 ` Maurizio Boriani 2021-08-19 11:49 ` Gorka Guardiola 2021-08-19 18:59 ` unobe 1 sibling, 2 replies; 18+ messages in thread From: Maurizio Boriani @ 2021-08-19 11:44 UTC (permalink / raw) To: 9fans Rob Pike writes: > % cat bin/cf > #!/bin/sh > > csearch -n -f '\.go$' '^func (\([^)]+\) )?'$1'\(' thanks a lot! But... what's csearch? best, -- Maurizio Boriani GPG key: 0xCC0FBF8F ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M341eca52c04374b097f4693b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 11:44 ` Maurizio Boriani @ 2021-08-19 11:49 ` Gorka Guardiola 2021-08-19 18:59 ` unobe 1 sibling, 0 replies; 18+ messages in thread From: Gorka Guardiola @ 2021-08-19 11:49 UTC (permalink / raw) To: baux; +Cc: 9fans [-- Attachment #1: Type: text/plain, Size: 624 bytes --] I am guessing: https://github.com/google/codesearch/blob/master/cmd/csearch/csearch.go On Thu, Aug 19, 2021, 13:44 Maurizio Boriani <baux@boriani.cloud> wrote: > > Rob Pike writes: > > > % cat bin/cf > > #!/bin/sh > > > > csearch -n -f '\.go$' '^func (\([^)]+\) )?'$1'\(' > > thanks a lot! But... what's csearch? > > best, > > -- > Maurizio Boriani > GPG key: 0xCC0FBF8F ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M7158507c2960444d94482c79 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 2003 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 11:44 ` Maurizio Boriani 2021-08-19 11:49 ` Gorka Guardiola @ 2021-08-19 18:59 ` unobe 2021-08-19 19:00 ` unobe 1 sibling, 1 reply; 18+ messages in thread From: unobe @ 2021-08-19 18:59 UTC (permalink / raw) To: 9fans Quoth Maurizio Boriani <baux@boriani.cloud>: > > Rob Pike writes: > > > % cat bin/cf > > #!/bin/sh > > > > csearch -n -f '\.go$' '^func (\([^)]+\) )?'$1'\(' > > thanks a lot! But... what's csearch? Possibly https://manpages.debian.org/testing/codesearch/csearch.1.en.html ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M37ca51e4b6b1b0b862ecebb4 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 18:59 ` unobe @ 2021-08-19 19:00 ` unobe 2021-08-19 20:41 ` Rob Pike 0 siblings, 1 reply; 18+ messages in thread From: unobe @ 2021-08-19 19:00 UTC (permalink / raw) To: 9fans Quoth unobe@cpan.org: > Quoth Maurizio Boriani <baux@boriani.cloud>: > > thanks a lot! But... what's csearch? > > Possibly https://manpages.debian.org/testing/codesearch/csearch.1.en.html Igonre--the other post, mentioning the go package is more likely. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M59304d85ee713b1f0c1851b6 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 19:00 ` unobe @ 2021-08-19 20:41 ` Rob Pike 0 siblings, 0 replies; 18+ messages in thread From: Rob Pike @ 2021-08-19 20:41 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 646 bytes --] It is Russ Cox's code search suite: https://github.com/google/codesearch On Fri, Aug 20, 2021 at 5:02 AM <unobe@cpan.org> wrote: > Quoth unobe@cpan.org: > > Quoth Maurizio Boriani <baux@boriani.cloud>: > > > thanks a lot! But... what's csearch? > > > > Possibly > https://manpages.debian.org/testing/codesearch/csearch.1.en.html > > Igonre--the other post, mentioning the go package is more likely. > ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-Meb10a04b846212b33436bd54 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 2112 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 6:52 ` sirjofri 2021-08-18 9:12 ` Richard Miller @ 2021-08-18 9:13 ` Nick Owens 1 sibling, 0 replies; 18+ messages in thread From: Nick Owens @ 2021-08-18 9:13 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 3171 bytes --] that's a long winded way of saying 'use the plumber' On Tue, Aug 17, 2021, 23:54 sirjofri <sirjofri+ml-9fans@sirjofri.de> wrote: > Hello Ben, > > 17.08.2021 22:22:09 Ben Hancock <ben@benghancock.com>: > > 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. > > The original developers of Plan 9 software were people who made simple > things even simpler so they can understand them. Imagine your codebase is > so small that you can know many symbols and have other symbols open or at > least know where to look. Using g(rep) in the parent directory of your > project and your brain should be enough. If it isn't your project might > be too complex/large. > > (That's different when reading other code or revisiting code after a long > time, but then you are supposed to read it again so you can understand it > anyway.) > > > 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. > > I doubt you are missing something. People used to use text editor since > there were no IDEs, and keep in mind that the core of unix was written > with ed, maybe even on teletypes. It's like writing code on paper, and it > works. > > My advise is, read and produce good clean code. If you need syntax > highlighting and fancy IDE stuff your codebase is probably too large. > With more training you can work with larger codebases, but still they to > keep it simple and small. If you really need to work with extremely > complex codebases you likely won't find success using plan9 at all. > > Many plan9 tools are one C file only. In acme you can jump between > selected text by right clicking it, which works very well in these cases. > Right clicking included files opens them and you can search there. These > are basically the tools you have. > > I'm personally very happy reading man pages and searching the plan 9 > source with g(rep) and plumbing the results. > > I hope this helps. > > Oh, and you can always write your own tools and call them using > middle-click in acme. You could write an rc-script that cd..s to your > project home directory (if it's a git repo, the one containing .git) and > invokes g, for example. > > sirjofri ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M8b0bad52403f628bb89eebec Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 4810 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-17 20:22 [9fans] Codebase navigation and using tags files in acme Ben Hancock 2021-08-18 6:52 ` sirjofri @ 2021-08-18 9:26 ` Ole-Hjalmar Kristensen 2021-08-19 3:51 ` 6o205zd02 1 sibling, 1 reply; 18+ messages in thread From: Ole-Hjalmar Kristensen @ 2021-08-18 9:26 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 1620 bytes --] 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 <ben@benghancock.com> 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: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-Mb6807aa0e9520cbbc2e097ad Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 3049 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-18 9:26 ` Ole-Hjalmar Kristensen @ 2021-08-19 3:51 ` 6o205zd02 2021-08-19 7:29 ` igor 2021-08-20 10:55 ` Ole-Hjalmar Kristensen 0 siblings, 2 replies; 18+ messages in thread From: 6o205zd02 @ 2021-08-19 3:51 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 3003 bytes --] 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 <ben@benghancock.com > <mailto:ben@benghancock.com>> 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 <http://www.benghancock.com> > > ------------------------------------------ > 9fans: 9fans > Permalink: > https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M693d75f3d4f4ad66ecaa27e0 > <https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M693d75f3d4f4ad66ecaa27e0> > Delivery options: > https://9fans.topicbox.com/groups/9fans/subscription > <https://9fans.topicbox.com/groups/9fans/subscription> > > *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-Mb6807aa0e9520cbbc2e097ad> > ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M652caba65026de9632210a05 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription [-- Attachment #2: Type: text/html, Size: 4491 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 3:51 ` 6o205zd02 @ 2021-08-19 7:29 ` igor 2021-08-20 10:55 ` Ole-Hjalmar Kristensen 1 sibling, 0 replies; 18+ messages in thread From: igor @ 2021-08-19 7:29 UTC (permalink / raw) To: 9fans; +Cc: igor Quoth 6o205zd02@sneakemail.com: > 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/)? ccls works with acme-lsp. You might find this useful for the LSP/C++/acme use case: - https://9lab.org/9port/acme-with-lsp/ ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf8ceac12df9da674-M0348f16ace38fc0148a2045e Delivery options: https://9fans.topicbox.com/groups/9fans/subscription ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-19 3:51 ` 6o205zd02 2021-08-19 7:29 ` igor @ 2021-08-20 10:55 ` Ole-Hjalmar Kristensen 2021-08-20 23:08 ` a 1 sibling, 1 reply; 18+ messages in thread From: Ole-Hjalmar Kristensen @ 2021-08-20 10:55 UTC (permalink / raw) To: 9fans [-- Attachment #1: Type: text/plain, Size: 2778 bytes --] 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 <6o205zd02@sneakemail.com> 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 <ben@benghancock.com> 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 [-- Attachment #2: Type: text/html, Size: 4779 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-20 10:55 ` Ole-Hjalmar Kristensen @ 2021-08-20 23:08 ` a 2021-08-20 23:31 ` Steve Simon 0 siblings, 1 reply; 18+ messages in thread From: a @ 2021-08-20 23:08 UTC (permalink / raw) To: 9fans 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 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] Codebase navigation and using tags files in acme 2021-08-20 23:08 ` a @ 2021-08-20 23:31 ` Steve Simon 0 siblings, 0 replies; 18+ messages in thread From: Steve Simon @ 2021-08-20 23:31 UTC (permalink / raw) To: 9fans 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 ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2021-08-20 23:31 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-08-17 20:22 [9fans] Codebase navigation and using tags files in acme Ben Hancock 2021-08-18 6:52 ` sirjofri 2021-08-18 9:12 ` Richard Miller 2021-08-18 9:17 ` Gabriel Diaz Lopez de la Llave via 9fans 2021-08-18 9:25 ` Rob Pike 2021-08-18 16:01 ` Ben Hancock 2021-08-19 11:44 ` Maurizio Boriani 2021-08-19 11:49 ` Gorka Guardiola 2021-08-19 18:59 ` unobe 2021-08-19 19:00 ` unobe 2021-08-19 20:41 ` Rob Pike 2021-08-18 9:13 ` Nick Owens 2021-08-18 9:26 ` Ole-Hjalmar Kristensen 2021-08-19 3:51 ` 6o205zd02 2021-08-19 7:29 ` igor 2021-08-20 10:55 ` Ole-Hjalmar Kristensen 2021-08-20 23:08 ` a 2021-08-20 23:31 ` Steve Simon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).