Real-time TypeScript model generation for FAMIX/Moose analysis. This extension automatically creates and updates FAMIX models of your TypeScript code as you make changes, eliminating manual model generation steps. The models can be imported into the Moose platform for advanced code analysis and visu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ts2famix
└──vscode-extension
├── client
│ ├── src
│ │ └── extension.ts // Client entry point
├── package.json // The extension manifest.
└── server
└── src
└── server.ts // Server entry point
Running the Extension
Building the ts2famix library
Run npm install in the ts2famix folder
Run npm run build in the ts2famix folder to build the project
Building the vscode-extension
Run npm install in the vscode-extension folder. This installs all necessary npm modules in both the client and server folder, then open VS Code on the vscode-extension folder. It should be open as a workspace (root directory):
cd vscode-extension
npm install
code .
Press Ctrl+Shift+B to start compiling the client and server in watch mode.
Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D).
Select Launch Client from the drop down (if it is not already).
Press ▷ to run the launch config (F5).
Manual testing of the extension
In the Extension Development Host instance of VSCode, open a typescript project folder that contains a valid tsconfig.json file
Add the output model path
Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) - this should open the Command Palette.
Start writing and select the Preferences: Open Settings (UI) option. This will open User settings.
Toggle the Extension section. Scroll down, search and select Ts2Famix.
For the Famix model output file path add the output file location where you want your JSON model to be stored. For example, 'C:\Users\User\JSONModels\app.json'
Open any file from this folder that has the .ts file extension
Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) - this should open the Command Palette.
Start writing ts2famix and select the ts2famix: Generate Famix Model option. This will trigger the command
Verify that a file in the specified location was generated
Testing the Extension
Run Tests
To test the extension run the npm run test inside the vscode-extension folder. This will run all the tests for the client and server. For the client it will run the integration and smoke tests, for which it will download (the location of the downloaded files will be /.vscode-tests) and launch a separate instance of VSCode. While downloading the files it may take some time, so it may be a reason of a timeout. If that happens, just run the command again. If there is an error with downloading the file - try to delete the /.vscode-tests folder and run the command again.
Debug Tests
Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D).
Select Integration Tests or Smoke Tests from the drop down (if it is not already).
Press ▷ to run the launch config (F5).
Manual testing
Some manual test cases are described in the test-cases.md file.