amir9480 / vscode-laravel-extra-intellisense

This extension adds extra autocompletion for laravel projects to VSCode.
https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.laravel-extra-intellisense
MIT License
3.5k stars 55 forks source link

Extension causes high cpu load #6

Closed itguy614 closed 5 years ago

itguy614 commented 5 years ago

amiralizadeh9480.laravel-extra-intellisense-unresponsive.cpuprofile.txt `

Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load

itguy614 commented 5 years ago

Not really a dupe. Second platform. This started occurring after the latest VSCode update.

itguy614 commented 5 years ago

Removing extension and reinstalling seems to have helped my situation.

amir9480 commented 5 years ago

I using regex to parse function calls. This happens just for special part of codes that causes infinite loop.

Function regex:

/((([A-Za-z0-9_]+)::)?([@A-Za-z0-9_]+)\()((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*)(\)|$)/g

function arguments regex:

/((\s*\,\s*)?)(\[.*\]|array\(.*\)|(\"((\\\")|[^\"])*\")|(\'((\\\')|[^\'])*\'))/g

And Inline functions regex:

/\((([\s\S]*\,)?\s*function\s*\(.*\)\s*\{)([\S\s]*)\}/g
amir9480 commented 5 years ago

duplicate of #4