Giter Club home page Giter Club logo

ts-docstr's People

Contributors

dependabot[bot] avatar jcs090218 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ts-docstr's Issues

Python: inserted docstring's indentation off

Hi, thanks for making this package available. I've been looking for something that supports Google-style docstrings for Python and this seems like the most promising choice going forward. I especially like the use of Treesitter underneath. It shows a lot of potential.

Unfortunately I can't quite get the package to work out of the box. I have set it up with 'google style Python docstrings and to trigger on typing """. The result ends up indented twice as much as it should be.

Starting from
image

And after writing """:
image

PS: I noticed you use the word "triggeration" in the README to refer to the activation of a trigger. The usual word for this is simply "triggering". Hope you don't mind the correction.

Support for emacs 29's built-in `treesit` library

Hi!

As you probably know, emacs29 includes built in support for tree-sitter grammars with a library called treesit. Unfortunately it's incompatible with the older out-of-tree tree-sitter.el that this package is based on. Are you interested in porting it / would you accept a patch to port it, which would make this package only work on emacs 29+?

Can't install with the method 1 snippet

Hello,
When I run the straight.el snippet, I get the following backtrace:

Debugger entered--Lisp error: (error "Failed to run \"git\"; see buffer *straight-process*")
  error("Failed to run %S; see buffer %s" "git" "*straight-process*")
  straight--process-output("git" "branch" "-r")
  straight-vc-git--default-remote-branch("origin" "ts-docstr")
  straight-vc-git-clone((:repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el") :package "ts-docstr" :type git :local-repo "ts-docstr") nil)
  apply(straight-vc-git-clone ((:repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el") :package "ts-docstr" :type git :local-repo "ts-docstr") nil))
  straight-vc(clone git (:repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el") :package "ts-docstr" :type git :local-repo "ts-docstr") nil)
  straight-vc-clone((:repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el") :package "ts-docstr" :type git :local-repo "ts-docstr"))
  straight--clone-repository((:repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el") :package "ts-docstr" :type git :local-repo "ts-docstr") nil)
  #f(compiled-function () #<bytecode 0x567b26c3de2ebe7>)()
  straight--transaction-exec(use-package-\"c362823fcddd97fd224e3003d7691faa\"-nil-nil :now #f(compiled-function () #<bytecode 0x567b26c3de2ebe7>))
  straight-use-package((ts-docstr :repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el")))
  (progn (straight-use-package '(ts-docstr :repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el"))) (defvar use-package--warning74 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (if (not (require 'ts-docstr nil t)) (display-warning 'use-package (format "Cannot load %s" 'ts-docstr) :error)) ((debug error) (funcall use-package--warning74 :catch err))))
  (progn (defvar bootstrap-version) (progn (straight-use-package '(ts-docstr :repo "emacs-vs/ts-docstr" :fetcher github :files (:defaults "langs/*.el"))) (defvar use-package--warning74 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (if (not (require 'ts-docstr nil t)) (display-warning 'use-package (format "Cannot load %s" 'ts-docstr) :error)) ((debug error) (funcall use-package--warning74 :catch err)))))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

In the buffer straight-process it says:

$ cd /home/debz/.config/emacs/straight/repos/
$ git clone --origin origin --no-checkout emacs-vs/ts-docstr /home/debz/.config/emacs/straight/repos/ts-docstr/ --no-single-branch

fatal: repository 'emacs-vs/ts-docstr' does not exist

[Return code: 128]

$ cd /home/debz/.config/emacs/straight/repos/ts-docstr/
$ git branch -r

[File error while Setting current directory]

Language is either not supported or WIP... c++mode

This package looks very promising. When I try ts-docstr-at-point I get the error Language is either not supported or WIP... c++mode.

I load tree-sitter and ts-docstr as follows:

(use-package tree-sitter
  :straight (tree-sitter :host github :repo "emacs-tree-sitter/elisp-tree-sitter"))

(use-package tree-sitter-langs
  :straight (tree-sitter-langs :host github :repo "emacs-tree-sitter/tree-sitter-langs"))

(use-package msgu
  :straight (msgu :host github :repo "jcs-elpa/msgu"))

(use-package ts-docstr 
  :straight (ts-docstr :host github :repo "emacs-vs/ts-docstr"))

I then visit a cpp file and call M-x ts-docstr-at-point on a function.

Am I doing this wrong?

Cannot insert docstrings for C functions with struct arguments

If a C function is declared like:

struct point {
    int x;
    int y;
};

int foo(struct point p) {
     return p.x + p.y;
}

ts-docstr-at-point will fail with the error:

user-error: Multiple declarations are invalid, 2.

I think this is triggered by the use of the struct keyword, as a basic or typedef name won't cause this issue.

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.