From 209fa4ec72c8719d82e049c5d10a06f0a679671c Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 12 Jun 2024 16:07:50 -0400 Subject: Followup changes to ctags These were just hanging around as I was doing other things. Included in this commit are the following: - Configure it in .ctags.d to only index the languages I use - Add support for sources listed in Sources.json - Fix broken link to inspekt3d repo --- .ctags.d/base.ctags | 11 +++++++++++ .ctags.d/nix.ctags | 14 ++++++++++++++ .envrc | 1 + Biz/Bild.nix | 3 ++- Biz/Bild/Deps/inspekt3d.nix | 2 +- Biz/Bild/Sources.json | 4 ++-- 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .ctags.d/base.ctags create mode 100644 .ctags.d/nix.ctags diff --git a/.ctags.d/base.ctags b/.ctags.d/base.ctags new file mode 100644 index 0000000..0bbf5ee --- /dev/null +++ b/.ctags.d/base.ctags @@ -0,0 +1,11 @@ +--languages=Haskell +--languages=+Python +--languages=+C +--languages=+Rust +--languages=+Lisp +--languages=+Scheme +# common excludes +--exclude=.mypy_cache +--exclude=.git +--exclude=.direnv +--exclude=.ruff_cache diff --git a/.ctags.d/nix.ctags b/.ctags.d/nix.ctags new file mode 100644 index 0000000..7a12815 --- /dev/null +++ b/.ctags.d/nix.ctags @@ -0,0 +1,14 @@ +--langdef=nix +--languages=+nix +--langmap=nix:.nix +# packages are "name = " or "pname = " +--kinddef-nix=p,package,package definition +--regex-nix=/[p?]name\s*=\s*"(\w+)"/\1/p/ +# functions have args, so have a : right of the = +--kinddef-nix=f,function,function definition +--regex-nix=/(\S+)\s*=\s+\w+:/\1/f/ +# attrs just have =, but only index if they have >=4 chars +--kinddef-nix=a,attr,attribute definition +--regex-nix=/\s+([a-zA-Z_0-9-]{4,20})\s*=/\1/a/ +# nixpkgs, ignore tests +--exclude=*pkgs/test* diff --git a/.envrc b/.envrc index 08ca0d5..7e9583e 100644 --- a/.envrc +++ b/.envrc @@ -54,6 +54,7 @@ [[ -n "CI" ]] && exit 0 # # create third-party tags + [[ -L "$CODEROOT"/_/src/.ctags.d ]] || ln -s "$CODEROOT"/.ctags.d "$CODEROOT"/_/src/.ctags.d function MakeExternalTags { "$CODEROOT"/Biz/Ide/MakeTags.py --external $(tr ':' '\n' <<< "$ALL_SOURCES") } diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 7d23d6a..e52fa24 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -23,7 +23,7 @@ let (builtins.map lib.attrsets.attrValues) lib.lists.flatten (builtins.filter (pkg: pkg != null)) - (builtins.map (pkg: pkg.src)) + (builtins.map (pkg: if pkg ? src then pkg.src else pkg)) (lib.strings.concatStringsSep ":") ]; @@ -226,6 +226,7 @@ let self.python.packages self.haskell.packages self.c.packages + self.sources ] } ''; diff --git a/Biz/Bild/Deps/inspekt3d.nix b/Biz/Bild/Deps/inspekt3d.nix index a9dac3d..3146350 100644 --- a/Biz/Bild/Deps/inspekt3d.nix +++ b/Biz/Bild/Deps/inspekt3d.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation { meta = with lib; { description = "Lightweight 3D viewer for Libfive written in Guile Scheme"; - homepage = "https://gitlab.com/kavalogic-inc/inspekt3d"; + homepage = "https://sr.ht/~morgansmith/inspekt3d"; license = licenses.gpl3; maintainers = with maintainers; [ bsima ]; platforms = platforms.all; diff --git a/Biz/Bild/Sources.json b/Biz/Bild/Sources.json index 53ac29f..2939283 100644 --- a/Biz/Bild/Sources.json +++ b/Biz/Bild/Sources.json @@ -47,9 +47,9 @@ }, "inspekt3d": { "branch": "master", + "type": "git", "repo": "https://git.sr.ht/~morgansmith/inspekt3d", - "rev": "703f52ccbfedad2bf5240bf8183d1b573c9d54ef", - "type": "git" + "rev": "703f52ccbfedad2bf5240bf8183d1b573c9d54ef" }, "interegular": { "branch": "master", -- cgit v1.2.3