ctags icon indicating copy to clipboard operation
ctags copied to clipboard

Clojure improvements

Open aartaka opened this issue 1 year ago • 3 comments

The name of the parser: clojure

Ctags only supports functions and namespaces in Clojure, lacking e.g. types and variables.

Find the examples of def and defonce for variables; defmacro for macros; defmulti for multimethods and defmethod for methods; deftype and defrecord for types; defprotocol and definterface for Clojure and Java interfaces respectively.

I cannot provide examples beyond these posts because most of the Clojure I do it private/proprietary :see_no_evil:

The version of ctags:

$ ctags --version
Universal Ctags 6.1.0(p6.1.20241117.0), Copyright (C) 2015-2023 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Nov 18 2024, 17:31:59
  URL: https://ctags.io/
  Output version: 0.0
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc, +optscript, +pcre2

How do you get ctags binary: pacman on Arch Linux

aartaka avatar Nov 20 '24 15:11 aartaka

I will accept pull requests to solve this issue. However, I will not work on this issue directly; I would like to solve it using a Sexp-based meta parser.

HOWEVER, '.b' test cases are welcome. People requesting to add parsers supporting new languages and/or to enhance parsers expect ctags developers to know the target languages. The expectation is wrong. The developers know only a tiny subset of the languages that ctags supports. Generally, the developers postpone the tasks related to unknown languages.

Preparing test cases is one of the ways to drive the developers. The test cases help the developers by reducing the time to learn the target language. See https://github.com/universal-ctags/ctags/issues/4065.

The value of test cases is immeasurable. We can add code to extract def* from the current implementation. I will call the code a direct solution. I want to avoid the direct solution. I want to implement a Sexp-based meta-parser that can be used as reusable routines to reimplement Lisp, EmacsLisp, Scheme, and Clojure parsers. I will call supporting def* in a new Close parser based on the meta parser an indirect solution. The test cases can be used in both solutions. A test case is an implementation neutral.

masatake avatar Nov 20 '24 19:11 masatake

Fair, I'll come up with test cases :+1:

aartaka avatar Nov 20 '24 21:11 aartaka

Thank you. I would like you to read https://docs.ctags.io/en/latest/testing-parser.html#units-test-facility .

masatake avatar Nov 20 '24 22:11 masatake