Comments (10)
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.
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.
Thanks for checking each of these extension versions. Does anything look out of place in the "Output" tab (after selecting "Motoko Language Server")?
from vscode-motoko.
I see that it calls mops sources
for each nested package that was created for testing)
and some of them (which didn't run mops install
) get these errors:
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
whenmops sources
is called - In the extension, cache
mops sources
result based onmops.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.
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.
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.
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.
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.
I found some additional ways to improve performance in #171 and #172; let me know if this ends up helping.
from vscode-motoko.
Glad to hear. Closing for now, and happy to reopen if needed.
from vscode-motoko.
Related Issues (20)
- Do you support showing an outline? HOT 1
- performance improvements HOT 8
- extension don't see mops packages HOT 8
- multi line strings HOT 2
- extension does not recognize canister alias when project is in subdirectory HOT 5
- keyword `catch` is not highlighted HOT 1
- [Request] Please add option to disable context menu "Motoko: Deploy (20 Minutes)" HOT 2
- How to disable autoformating of comments? HOT 3
- Import can't find files HOT 9
- Continuous "Reference not found from AST node:" errors HOT 5
- Motoko deploy command ERROR HOT 2
- No wigglies on https://github.dev HOT 2
- No wigglies on https://github.dev HOT 1
- management canister did file not found HOT 7
- Language server not working/Heap out of memory HOT 8
- Error while importing a canister HOT 19
- Cannot find module '@napi-rs/lzma-linux-x64-gnu' in WSL HOT 2
- Autocomplete non-functional. HOT 2
- Feature Request: Data type on variable hover HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-motoko.