This Visual Studio Code extension leverages a pre-trained machine learning model to classify code. Originally designed to distinguish between Python 2 and Python 3 scripts, it can also classify other programming languages such as Java, or differentiate between Python and Java, provided the appropriate model is supplied. Additionally, it highlights code segments responsible for the classification, offering insights into specific syntax or constructs.
Features
Direct code analysis within Visual Studio Code.
Automatic loading and application of pre-trained machine learning models.
Flexible to support various programming languages with custom models.
Highlighting of specific code parts identified based on the model’s classification.
Installation
To install the Py2vsPy3 Classifier from the Visual Studio Marketplace, follow these steps:
Open Visual Studio Code.
Navigate to the Extensions view by clicking on the square icon on the sidebar, or pressing Ctrl+Shift+X.
Search for "Py2vsPy3_Classifier".
Click on the 'Install' button to install the extension.
Usage
Follow these steps to analyze your code:
Open any script within Visual Studio Code.
Activate the Command Palette by pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS).
Type 'Analyze Code' and select it from the list to start the analysis.
Choose the explainer type and window size for the analysis when prompted.
Optionally, customize the model or explainer path by going to File > Preferences > Settings > Extensions > Py2vsPy3_Classifier and entering the path to your local model or explainer.
Configuration
cext.modelPath: Customize the path to the machine learning model file. If not set, the default model is used. Access this setting through File > Preferences > Settings, then search for 'Py2vsPy3_Classifier' to specify your custom model path.
License
This project is currently unlicensed and all rights are reserved. This means you are not granted rights to reproduce, distribute, or create derivative works from this software.