Coder Social home page Coder Social logo

Comments (11)

danymat avatar danymat commented on May 22, 2024

what about just re-doing Neogen command and it does it automatically ? So no need of a sync function?

This will not work because it'll override the annotation

from neogen.

danymat avatar danymat commented on May 22, 2024

Hmm it seems difficult to implement, as how we could retrieve easily the annotation and see if it has been changed

Do you have any ideas ? Maybe with some regex

from neogen.

smackesey avatar smackesey commented on May 22, 2024

Really what's needed is a treesitter grammar for the annotations themselves-- so it would be a feature that relatively few languages support, but IMO definitely worth it for popular ones.

I could implement this for Python google-style docstrings.

from neogen.

danymat avatar danymat commented on May 22, 2024

Really what's needed is a treesitter grammar for the annotations themselves-- so it would be a feature that relatively few languages support, but IMO definitely worth it for popular ones.

You mean creating a grammar for annotations ? That could work indeed, but as of right now, we don't have any.

from neogen.

max397574 avatar max397574 commented on May 22, 2024

you could retrieve the old annotation, create the new one, compare the "fields", see where values are set, set the im the new annotation -> profit :)

from neogen.

danymat avatar danymat commented on May 22, 2024

you could retrieve the old annotation

the problem is: how do you know something is the old annotation ? That's why having a parser for annotations could be a huge benefit, but I don't think it's something easily feasible

from neogen.

max397574 avatar max397574 commented on May 22, 2024

you just get the comment about the function and check if it's kinda like the annotations format e.g. ---in lua

from neogen.

danymat avatar danymat commented on May 22, 2024

you just get the comment about the function and check if it's kinda like the annotations format e.g. ---in lua

Even though, this check is not sufficient, take a look:

--- this is not meant to be an annotation
function test()
end

If we allow this type of behavior, this will mean that everything on top of the function, that has --- will be deleted and replaced with new annotation. I don't think this is a good idea, because the user should be expected to clearly know the result of the command before typing it out.

from neogen.

max397574 avatar max397574 commented on May 22, 2024

hmmm

from neogen.

danymat avatar danymat commented on May 22, 2024

One way to handle this, would be to keep the Information about created annotation (with marks)
But that would mean that exiting neovim will lose the informations

from neogen.

sputnick1124 avatar sputnick1124 commented on May 22, 2024

For reference, it seems like this is possible with bare luasnip (at least for the active session, exiting neovim still poses a problem). LuaSnip's README shows a GIF of this working, but the source code for the demo even admits that it is ugly and fragile. I'm not sure what the existing neogen+luasnip integration looks like, but I'm wondering if some combination of setting history = true in luasnip and using restoreNode would get close?

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.