Giter VIP home page Giter VIP logo

jsdoc.el's People

Contributors

alhassy avatar isamert avatar kevinboyette avatar minikn 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

Watchers

 avatar  avatar  avatar  avatar  avatar

jsdoc.el's Issues

`Wrong type argument: user-ptrp, nil`

It looks like a neato package and I'd love to try it out.

When I try to use the package, as shown in the README, I get a Wrong type argument: user-ptrp, nil error.

Any assistance would be appreciated.

Add syntax highlighting for JSDoc blocks

Continuing the discussion about JSDoc syntax highlighting:

While working on this I thought it would be nice to have some syntax highlighting for jsdoc blocks. There actualls is a grammer for JSDoc. I tried using it but my understanding for tree-sitter is still very limited. As far as I understood it, one has to set ranges for each parser to act upon.. this would mean we need to patch js-ts-mode upstream to implement those ranges... or am I understanding it wrong? Maybe you have a better grasp on it.

Nice idea! I don't really know how *-ts-mode's work, so I looked a bit for js-ts-mode and from my understanding:

  • First, we need to define treesit-font-lock-settings using treesit-font-lock-rules.
  • Then we need to update js--treesit-font-lock-setting to something like the following.

This is the default:

(defvar js--treesit-font-lock-settings
  (treesit-font-lock-rules
    :language 'javascript
    :feature 'comment
    '((comment) @font-lock-comment-face)
   ...

Documentation says instead of a face, we can give a function:

(defvar js--treesit-font-lock-settings
  (treesit-font-lock-rules
    :language 'javascript
    :feature 'comment
    `((comment) (lambda (node override start end &rest _) <somehow fontify the region with jsdoc-ts font lock settings?>)
   ...

The part in angle brackets might be something like this:

(let ((treesit-font-lock-settings <font lock settings we defined for jsdoc-ts>))
  (treesit-font-lock-fontify-region start end))

These are just a mild guess, not quite sure if this is the right way or even if it works or not. I might try when I get a chance.

I don't think the upstream patch would be accepted because not everyone uses JSDoc in their comments. What can be done is simply overriding js--treesit-font-lock-settings with a newly defined one or something similar that has the same effect.

I will take a more closer looking into your suggestions when I have time. This issue can serve as a discussion basis.

TypeScript Support

I love the idea of this package. With the new typescript-ts-mode and eglot in 29 a lot of what tide offers is already in Emacs. However it seems like this package doesn't support TypeScript. Here was the result of me adding docs to a function:

/**
 * 
 * @param {nil} nil - 
 * @param {nil} nil - 
 * @returns {number} - 
 */
function test(param1: string, param2: number): number {
  return 0;
}

Are there any plans to support TypeScript? I doubt TypeScript users care much about the type annotations.

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.