Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This extension blocks the outline view of large markdown files #464

Open
vibl opened this issue Nov 21, 2022 · 7 comments
Open

This extension blocks the outline view of large markdown files #464

vibl opened this issue Nov 21, 2022 · 7 comments

Comments

@vibl
Copy link

vibl commented Nov 21, 2022

This extension blocks the outline view of large markdown files.

I have no idea why...

All I can say is that the Extension Bisect feature of VSCode proved that this extension was the culprit.

@alexanderniebuhr
Copy link
Member

Please add more information.

@vibl
Copy link
Author

vibl commented Nov 22, 2022

To recap the issue: when this extension is the only one activated (all others are deactivated), the Outline View becomes excessively slow for large markdown files: the VSCode threads goes 100% CPU (core) for a few minutes and the Outline View is stuck displaying "Loading document symbols..."

Here are some more information below.

Feel free to ask for more specific information.

Extension version: WindiCSS Intellisense v0.21.6

VSCode About page

Version: 1.73.1
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T03:54:53.913Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-52-generic
Sandboxed: No

@vibl
Copy link
Author

vibl commented Nov 22, 2022

Here is an example of a big markdown file (with many headings): https://gist.github.com/vibl/3f5a98990c7155669d98de36a2724bb7

@mrm007
Copy link

mrm007 commented Dec 17, 2022

I can share my own experience, with a large JavaScript file. I went a step further and recorded a profile of the extension. The biggest culprit seems to be this RegExp:

const regex = /(?<=@apply\s+)[^;]+(?=\s+!important)|(?<=@apply\s+)[^;]+(?=;)/igm;

image

You can download the CPU profile I recorded, extract it from zip and load it in VS Code or any Chrome DevTools:
extension host.zip

@alexanderniebuhr
Copy link
Member

@mrm007 thank you so much. I hope to get the token issue sorted soon. If that is an option for you, could you share the JavaScript file with me, you can also do this privately in Discord. I could use to test an update.

@mrm007
Copy link

mrm007 commented Dec 18, 2022

@alexanderniebuhr I certainly can — it's the biggest of the Vite 4 chunks and it's around 2MB in size.

You can install [email protected] locally or you can clone this repo and navigate to node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-2285ba4f.js. That's actually how I encountered the issue: it was making the CodeTour I recorded very slow/unresponsive.

@mrm007
Copy link

mrm007 commented Dec 18, 2022

Somewhat related, if you or anyone knows a way to disable extensions based on path (e.g. node_modules) that would be great. This StackOverflow answer from 5 years ago suggests there isn't such a mechanism in VS Code (and it's up to extensions to provide a way to deactivate), but things might have changed in the mean time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants