=======
The Codewind language server for Node.js profiling annotates your Node.js code with code highlighting. Code highlighting uses the profiling data gathered through Codewind load testing to highlight and show the relative time that is spent in JavaScript functions.
- Open a local project that you created with Codewind and profiled by using the performance test feature. Opening the project creates profiling data in a
load-test/[datestamp]/profiling.json
file in your Codewind project. - In VS Code, open a JavaScript file in your project. The extension highlights any lines that it finds in the profiling data and annotates them to show how often they were seen and where they were called from.
- Clone the
codewind-node-profiler
repository locally. - Run
npm install
in the clonedcodewind-node-profiler
folder. This command installs all necessary npm modules in both the client and server folder. - Open the clone of the
codewind-node-profiler
repository in VS Code. - Press Ctrl+Shift+B on Windows or Cmd+Shift+B on Mac to compile the client and server.
- Switch to the Debug view.
- Click Launch Client from the menu and click the Run icon.
- If you want to debug the server and use the launch configuration, click Attach to Server.
To enable testing, run the npm install
command in the codewind-node-profiler
folder.
Complete the following steps to test in VS Code:
- Press Ctrl+Shift+B on Windows or Cmd+Shift+B on Mac to compile the client and server.
- Run
npm run prepare-tests
in thevscode/client
folder. - Switch to the Debug view.
- Select Language Server E2E Test from the menu.
- Run the test configuration.
- Another editor opens while the tests are run. It automatically closes after the tests are complete.
- Switch to the Output view with Ctrl+Shift+U on Windows and Cmd+Shift+U on Mac to see the test results.
Complete the following steps to build a .vsix
extension package that can then be installed and published:
- Run
npm install
in thecodewind-node-profiler
folder. - Install the
vsce
package globally withnpm install -g vsce
. - Run
vsce package
in thecodewind-node-profiler
folder. Avsix
file is generated.
- The Codewind extension (available here) installed in Visual Studio Code.
- A Node.js project bound to Codewind.
- Open your Node.js project's Performance Dashboard by right-clicking on the project in the Codewind section of Visual Studio Code and selecting
Open Performance Dashboard
. - Once the Performance Dashboard opens, click
Run Load Test
. - This will create profiling data in a
load-test/[datestamp]/profiling.json
file in your Codewind project. - In Visual Studio Code open a JavaScript file in your project.
- The extension will highlight any lines which were found in the profiling data and annotate them to show how often they were seen and where they were called from. =======
Complete the following steps to install the extension:
- Run
code --install-extension <name of generated vsix file>
in thecodewind-node-profiler
folder. - Restart Visual Studio Code. The extension appears in your list of installed extensions.
For more information, see Publishing Extension on the VS Code website.