Git Product home page Git Product logo

Comments (10)

rvanasa avatar rvanasa commented on July 22, 2024 1

Looking at the implementation, the extension ignores directories starting with a . (e.g. test/.projects/...). This appears to work as a temporary fix in my local mops repository. I'll also open a PR to include some additional caching for commands such as mops sources.

from vscode-motoko.

ZenVoich avatar ZenVoich commented on July 22, 2024 1

I can see that it only uses CPU on startup, not every time a file is opened or modified.
Also I prefixed the test folders with . and that worked well too. Thank you

from vscode-motoko.

rvanasa avatar rvanasa commented on July 22, 2024

Thanks for checking each of these extension versions. Does anything look out of place in the "Output" tab (after selecting "Motoko Language Server")?

Screenshot 2023-02-02 at 11 49 49 AM

from vscode-motoko.

ZenVoich avatar ZenVoich commented on July 22, 2024

I see that it calls mops sources for each nested package that was created for testing)
image
and some of them (which didn't run mops install) get these errors:
image
All these commands are run every time when I open new motoko file or change motoko file, and loads CPU for 100% for ~13 seconds.

Some possible solutions that I see:

  • In mops, I could remove all these 'testing packages' and replace them with script to generate packages and/or add e2e tests
  • In mops, run mops install when mops sources is called
  • In the extension, cache mops sources result based on mops.toml the md5 hash
  • In the extension, cache the AST of the source files based on the md5 hash
  • In the extension, add setting to exclude some paths

from vscode-motoko.

rvanasa avatar rvanasa commented on July 22, 2024

Gotcha. It looks like the extension is trying to automatically re-check for MOPS packages on file save, which was introduced as a way to fix various issues with users installing Vessel / MOPS without restarting the VS Code language server.

What's your opinion on running mops install upon calling mops sources? This is the default behavior for Vessel, so I originally built the integration around this assumption.

I could also add a setting to deactivate this retry-on-save behavior so that you can add it to your .vscode/settings.json file for this workspace.

In the extension, cache (mops sources result / AST) based on the md5 hash

As a side note, I've considered doing this, but it tends to cause subtle issues when updating packages to new versions (especially for Vessel, which relies heavily on fetching remote config files).

from vscode-motoko.

ZenVoich avatar ZenVoich commented on July 22, 2024

What's your opinion on running mops install upon calling mops sources? This is the default behavior for Vessel, so I originally built the integration around this assumption.

Added running mops install upon calling mops sources in mops cli 0.6.4

from vscode-motoko.

rvanasa avatar rvanasa commented on July 22, 2024

Great; thanks! Does this fix the issue, or would it be helpful for me to also include the retry-on-save setting?

from vscode-motoko.

ZenVoich avatar ZenVoich commented on July 22, 2024

Does this fix the issue

Unfortunately doesn't, but removing all my test packages helps, I will try to remove them in favor of generating packages for testing.

would it be helpful for me to also include the retry-on-save setting?

not sure if this will help

from vscode-motoko.

rvanasa avatar rvanasa commented on July 22, 2024

I found some additional ways to improve performance in #171 and #172; let me know if this ends up helping.

from vscode-motoko.

rvanasa avatar rvanasa commented on July 22, 2024

Glad to hear. Closing for now, and happy to reopen if needed.

from vscode-motoko.

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.