Git Product home page Git Product logo

Comments (5)

liuchengxu avatar liuchengxu commented on July 26, 2024

As a matter of fact, I just have a fuzzy idea about your proposal and don't exactly know what should be done. It could be better if you can elaborate on this. I'm not a specialist on ctags.

from vista.vim.

Avi-D-coder avatar Avi-D-coder commented on July 26, 2024

The feature I miss most is displaying type signatures.
Currently the parser errors if given extended ctags

ctags:

Lib     src/Lib.hs      1
someFunc        src/Lib.hs      5

ctags extended:

!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_NAME      hasktags
Lib     src/Lib.hs      /^module Lib$/;"        m       line:1  language:Haskell
someFunc        src/Lib.hs      /^someFunc :: IO ()$/;" ft      signature:(IO ())       line:5  language:Haskell

universal-ctags output for rust:

!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE	u-ctags	/u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR	Universal Ctags Team	//
!_TAG_PROGRAM_NAME	Universal Ctags	/Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL	https://ctags.io/	/official site/
!_TAG_PROGRAM_VERSION	0.0.0	/4ab59765/
Change	src/lib.rs	/^pub enum Change<T> {$/;"	g
Changes	src/lib.rs	/^impl<T> From<Vec<Change<T>>> for Changes<T> {$/;"	c
Changes	src/lib.rs	/^impl<T> Into<Vec<Change<T>>> for Changes<T> {$/;"	c
Changes	src/lib.rs	/^struct Changes<T> {$/;"	s
ChangesBuilder	src/lib.rs	/^impl<'l> diffs::Diff for ChangesBuilder<'l, &'l str> {$/;"	c
ChangesBuilder	src/lib.rs	/^struct ChangesBuilder<'l, T>(HashedLines<'l>, Changes<Vec<T>>);$/;"	s
Delete	src/lib.rs	/^    Delete {$/;"	e	enum:Change
EitherOrBoth	src/lib.rs	/^impl<L, R> FromEOB<L, R> for EitherOrBoth<L, R> {$/;"	c
Equal	src/lib.rs	/^    Equal {$/;"	e	enum:Change
Error	src/lib.rs	/^    type Error = ();$/;"	t	implementation:ChangesBuilder
FromEOB	src/lib.rs	/^trait FromEOB<L, R> {$/;"	i
HashDiff	src/lib.rs	/^trait HashDiff<T, I, D> {$/;"	i
HashedLines	src/lib.rs	/^struct HashedLines<'l> {$/;"	s
IndexMapping	src/lib.rs	/^type IndexMapping<'l> = PerfectHasher32<&'l str, Murmur3Hasher_x86_32>;$/;"	t
Insert	src/lib.rs	/^    Insert {$/;"	e	enum:Change
LineDiff	src/lib.rs	/^trait LineDiff<'l> {$/;"	i
Replace	src/lib.rs	/^    Replace {$/;"	e	enum:Change
changed_new	src/lib.rs	/^    changed_new: Vec<Id<u32>>,$/;"	m	struct:HashedLines
changed_old	src/lib.rs	/^    changed_old: Vec<Id<u32>>,$/;"	m	struct:HashedLines
delete	src/lib.rs	/^    fn delete(&mut self, old_index: usize, len: usize) -> Result<(), ()> {$/;"	P	implementation:ChangesBuilder
diff	src/lib.rs	/^    diff: Vec<Change<T>>,$/;"	m	struct:Changes
equal	src/lib.rs	/^    fn equal(&mut self, old_index: usize, new_index: usize, len: usize) -> Result<(), ()> {$/;"	P	implementation:ChangesBuilder
from	src/lib.rs	/^    fn from(diff: Vec<Change<T>>) -> Changes<T> {$/;"	P	implementation:Changes
hash_diff_vec	src/lib.rs	/^    fn hash_diff_vec(self, new: I) -> Vec<D>;$/;"	P	interface:HashDiff
index_map	src/lib.rs	/^    index_map: IndexMapping<'l>,$/;"	m	struct:HashedLines
insert	src/lib.rs	/^    fn insert(&mut self, old_index: usize, new_index: usize, new_len: usize) -> Result<(), ()> {$/;"	P	implementation:ChangesBuilder
into	src/lib.rs	/^    fn into(self) -> Vec<Change<T>> {$/;"	P	implementation:Changes
into_either	src/lib.rs	/^    fn into_either(self) -> Option<Either<L, R>> {$/;"	P	implementation:EitherOrBoth
into_either	src/lib.rs	/^    fn into_either(self) -> Option<Either<L, R>>;$/;"	P	interface:FromEOB
lines_hash_diff	src/lib.rs	/^    fn lines_hash_diff(self, new: &'l str) -> Option<HashedLines> {$/;"	P	implementation:str
lines_hash_diff	src/lib.rs	/^    fn lines_hash_diff(self, new: &'l str) -> Option<HashedLines>;$/;"	P	interface:LineDiff
replace	src/lib.rs	/^    fn replace($/;"	P	implementation:ChangesBuilder
str	src/lib.rs	/^impl<'l> LineDiff<'l> for &'l str {$/;"	c

from vista.vim.

liuchengxu avatar liuchengxu commented on July 26, 2024

This will need some work, I didn't take this into account before.

from vista.vim.

liuchengxu avatar liuchengxu commented on July 26, 2024

I pushed a new branch https://github.com/liuchengxu/vista.vim/tree/refine-ctags-kinds which supports the various kinds and I experimentally added the signature kind. Ensure your ctags supports json output format, you could try it with some rust file.

屏幕快照 2019-03-27 下午10 36 49

My concern is how to work with these kinds properly. As you can see, the signature for function/method is probably very long. You need a broad sidebar to see them all.

It's nice to support language specific kinds for ctags, which is also good for other features, but I haven't figured out how to integrate them decently at present. How do you like?

One more thing, regarding the signature, I think most info provided by the kinds could be obtained from the echoed source line.

from vista.vim.

liuchengxu avatar liuchengxu commented on July 26, 2024

This PR #35 has added the support for the extended ctags. You can see if that fixes this issue.

from vista.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.