Giter VIP home page Giter VIP logo

Comments (3)

alefragnani avatar alefragnani commented on June 16, 2024

Hi @hmijail ,

I wonder why the extension would start the Dafny LS, simply by opening the Bookmarks View, unless the Dafny LS has a hook in the onDidOpenTextDocument event. To check that, use the Bookmarks: List from All Files command instead, and look if the same issue occurs.

What does these two commands execute in the extension? Under the hood, the same thing. Both will loop through all files that contains some bookmark (based on the .vscode/bookmarks.json or in the workspaceState Memento), open them using openTextDocument API, and read the content of the lines where a bookmark has been toggled. No change is made in your files, just reads, in order to display the line content. Based on the documentation, the openTextDocument API knows if a file has been previously opened, and won't do it twice.

I don't know Dafny, and I'm not sure why its LS would suffer from memory leak because another extension opened a file and read content from some of its lines. Maybe it doesn't expect "sharing" a file and ended up opening again.

Hope this helps

from vscode-bookmarks.

hmijail avatar hmijail commented on June 16, 2024

Indeed, Bookmarks: List from All Files causes the same issue.

Looking at the Output tab, Extension Host channel, looks like that command causes extensions to activate because a bookmark in a file with language X will trigger an event of the type onLanguage:X. So this is activating e.g. the ms-dotnettools.csharp and golang.go extensions too, because I have bookmarks on C# and Go files too.

Interestingly, there's also an event for Java, but doesn't seem to have much effect because its extension/LS does a lot of eager-start startup configuration stuff anyway.

(I'm commenting this just FYI. I guess those onLanguage events are produced by the openTextDocument API you mentioned, not directly by Bookmarks)

from vscode-bookmarks.

alefragnani avatar alefragnani commented on June 16, 2024

Yes, that onDidOpenTextDocument event, and consequently on language:xyz is triggered whenever a file is opened.

Coincidentally, this post was raised recently in the VS Code Discussions forum (microsoft/vscode-discussions#1192), but had no comment/answer yet.

from vscode-bookmarks.

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.