Giter Site home page Giter Site logo

Auto-detect annotation types about neogen HOT 7 CLOSED

danymat avatar danymat commented on August 17, 2024
Auto-detect annotation types

from neogen.

Comments (7)

danymat avatar danymat commented on August 17, 2024

Hello! thanks for chiming in !

vim-doge doesn't need to specify the type to annotate.
Could we have similar features?

In theory we could indeed, but we need to do it well if we're about to do it.
Just for you to know, atm, in order to generate the annotations we:

  • call the annotator function with a specified type
  • search the first upper node that matches the type
  • Generate the annotations for the node

I think it is not a problem if we only have classes, and functions annotations (and templates too). What happens if we have the cursor on a type annotation ? Like this:

local function test()
  local test_var = do_smt() --> cursor on this line will generate a type annotation just before this line
  -- this is a comment  
end

from neogen.

meijieru avatar meijieru commented on August 17, 2024

I think the behavior in the comment is decent.

from neogen.

danymat avatar danymat commented on August 17, 2024

Sorry for putting this feat on hold, as it was the holidays season. I'm thinking about it right now:

Do you know what's the logic behind vim-doge automatic selection ? Or better, what do you think will be the best:

  • Going up in the tree until we stop on a first matching node, no matter what the type?
  • Having a priority list of types, that we will loop until we stop on a matching node, i.e:
priority = { "func", "class", "type", ...}

from neogen.

meijieru avatar meijieru commented on August 17, 2024

I am not familiar with the vim-doge's logic.
Personally, I prefer the second option.
Maybe some polls may help.

from neogen.

danymat avatar danymat commented on August 17, 2024

This will have the same complexity (mostly) as this issue (point 2): #53 (comment)

I will try to keep this open for a while, in case someone wants to comment

from neogen.

danymat avatar danymat commented on August 17, 2024

@meijieru I recommend following and testing #74

from neogen.

danymat avatar danymat commented on August 17, 2024

#116 Implemented this feature, see Neogen 2.11 !

from neogen.

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.