Skip to content

Code Convert ​

Command Name: aide.codeConvert

Use AI to convert an entire file or selected code from one programming language to another. Supports any language. Most languages support highlighting.

You can enter any language or file extension. If it is not in the language list, it might not support syntax highlighting, but it can still be converted.

Scenarios:

  • You can understand unfamiliar project code using a language you are familiar with.
  • By mastering just one language, you can understand all code and get references for code migration.
  • You can convert Python code to JavaScript code.
  • You can convert C/C++ code to Rust code.
  • You can convert Vue2 code to Vue3 code.
  • More features await your imagination...

Usage:

  • Select the code in the editor.
  • Click the paper icon at the top right or right-click and select ✨ Aide: Code Convert.

TIP

If the output is interrupted, you can click the original paper icon or right-click and select ✨ Aide: Code Convert to continue.

Language + Additional Description Support

After entering the language, you can add a space and then a supplementary description. For example, if you want to migrate a Vue2 project to Vue3 setup, you can enter:

vue vue2 to vue3 <script setup> syntax

This will be parsed as:

Target Language: vue

Additional Description: vue2 to vue3 <script setup> syntax

The rule is: Target Language + Space + Additional Description

Related Configuration:

  • By default, the editor will remember your language mappings in the current project's .vscode/settings.json file under the aide.convertLanguagePairs configuration, so you don't need to select the languages again next time you convert.

  • You can control whether to automatically remember language mappings by modifying the aide.autoRememberConvertLanguagePairs configuration.

Released under the MIT License.