Coder Social home page Coder Social logo

Comments (5)

marijnh avatar marijnh commented on August 19, 2024

This is the intended behavior. reset flushes the type graph, but keeps the files that were added around. It is indended to be a thing that happens silently in the background when the graph has gotten messy from too many purge/analyze cycles, and shouldn't have visible side effects except for possibly cleaner results in the next request.

from tern.

MiguelCastillo avatar MiguelCastillo commented on August 19, 2024

The primary use case I am looking at is switching projects; most likely data does not carry from project to project. So, I am manually setting server.files = [] when switching projects; I am also calling reset as that seemed like a natural call to make. Perhaps reset and clearing all files (along with whatever else you might want to clean up) can be put in a function? Maybe clear(), clearAll()? I don't your preference.

I am not big into making pull request for such small items, but if you would like I can add a clear function and make a pull request for ya. Or if you have a better approach, I would really like to hear about it.

from tern.

marijnh avatar marijnh commented on August 19, 2024

Create a new server for each project. I don't think there's anything added by being able to re-purpose an existing server object.

from tern.

MiguelCastillo avatar MiguelCastillo commented on August 19, 2024

Alright, simple enough. I am always skeptical about creating new objects that are called "server", which is why I didn't do it before. But if you are suggesting it, then it must be safe to do :-)

Thanks!

from tern.

marijnh avatar marijnh commented on August 19, 2024

Yes, definitely safe. This is not a singleton, and there's no global data involved.

from tern.

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.