yandeu / five-server-vscode

⚡ VSCode Extension for Five Server.
https://marketplace.visualstudio.com/items?itemName=yandeu.five-server
Other
121 stars 9 forks source link

Activate Extension on Specific Files or Languages #5

Closed YaduAhuja closed 3 years ago

YaduAhuja commented 3 years ago

Can't we change * to onlanguage activation-events to support the languages that can be run with five-server and ignore every other language so that VSCode's startup speed is Increased?

Currently, Five-Server on my System is using near about 1 sec to run even when I am running CPP or Java files and it will be great if this feature is added.

Below is the Screenshot of Runtime:

Running

yandeu commented 3 years ago

What about just lazy loading five-server? It reduced the startup time for me to only 10 - 50ms.

# /src/extension.ts

  if (!fiveServer) {
-   fiveServer = new FiveServer();
+   const FiveServer = await import("five-server");
+   fiveServer = new FiveServer.default();
    startWorkers = true;
}
yandeu commented 3 years ago

See https://github.com/yandeu/five-server-vscode/commit/51c184b008e7d6886c63ec1a66e38615651c7b61

YaduAhuja commented 3 years ago

Thank You!! now the startup time has been reduced to 13ms. Also when will this update reflect in vscode marketplace or I download and compile extension myself?

Screenshot (5)

yandeu commented 3 years ago

Nice!!

I don't know when the next version will be released.

Yes, probably you should compile it yourself (using the same release version) and wait for the official update 👍