{"id":32123795,"url":"https://github.com/saltudelft/type4py-vscode-ext","last_synced_at":"2026-02-19T13:33:36.136Z","repository":{"id":42575080,"uuid":"371757448","full_name":"saltudelft/type4py-vscode-ext","owner":"saltudelft","description":"VSCode Extension of Type4Py","archived":false,"fork":false,"pushed_at":"2022-03-31T07:22:31.000Z","size":6226,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-20T21:26:40.045Z","etag":null,"topics":["autocompletion","deeplearning","machinelearning","ml4code","ml4se","python","type4py","typeannotations","typeinference","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saltudelft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-28T16:19:46.000Z","updated_at":"2024-08-15T14:35:44.000Z","dependencies_parsed_at":"2022-09-11T09:10:39.240Z","dependency_job_id":null,"html_url":"https://github.com/saltudelft/type4py-vscode-ext","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/saltudelft/type4py-vscode-ext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Ftype4py-vscode-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Ftype4py-vscode-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Ftype4py-vscode-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Ftype4py-vscode-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saltudelft","download_url":"https://codeload.github.com/saltudelft/type4py-vscode-ext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltudelft%2Ftype4py-vscode-ext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocompletion","deeplearning","machinelearning","ml4code","ml4se","python","type4py","typeannotations","typeinference","vscode","vscode-extension"],"created_at":"2025-10-20T21:15:26.189Z","updated_at":"2026-02-19T13:33:36.129Z","avatar_url":"https://github.com/saltudelft.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VSCode Extension of Type4Py\n[![vsm-version](https://img.shields.io/visual-studio-marketplace/v/saltud.type4py?style=flat\u0026label=VS%20Marketplace\u0026logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=saltud.type4py)\n![GH-workflow](https://github.com/saltudelft/type4py-vscode-ext/actions/workflows/extension_test.yaml/badge.svg)\n\nThis extension provides machine learning-based type autocompletion for Python, which assists developers to gradually add type annotations to their existing codebases.\n\n- [Core Features](#core-features)\n- [Usage](#usage)\n  - [Quick Start](#quick-start)\n  - [Step-by-Step](#step-by-step)\n  - [Considerations](#considerations)\n- [Installation](#installation)\n- [Settings](#settings)\n- [Privacy](#privacy)\n- [Support](#support)\n- [Development](#development)\n- [Roadmap](#roadmap)\n- [Contributors](#contributors)\n- [Acknowledgements](#acknowledgements)\n\n# Core Features\n- **Machine learning**-based type prediction (powered by [Type4Py](https://github.com/saltudelft/type4py))\n- It can be used with a **local model** on your machine (No data sharing) \n- Improved **autocompletion** for Python type annotations (based on [Python Type Hint](https://github.com/njqdev/vscode-python-typehint))\n- Type autocompletion for **parameters**, **return types** of functions, and **variables**.\n- Simple, fairly fast and easy to use.\n\n# Usage\n## Quick Start\n![](images/extension-quick-start.gif)\n\n## Step-by-Step\n1. In VSCode, select a Python source file of your interest.\n2. Go to `View -\u003e Command Palette -\u003e Type4Py: Infer type annotations`.\n3. Depending on the file size, after a couple of seconds, you can see the in-progress/completed requests at the bottom left of VSCode. \u003cp align=\"center\"\u003e\u003cimg src=\"images/status-bar.png\" alt=\"Type4Py's status bar\" width=375/\u003e\u003c/p\u003e\n4. After the completion of your request, you can now start adding predicted type annotations to your code, similar to the [Quick Start](#quick-start) example above.\n\n\u003e **Tip:** At the bottom left of VSCode, click on the status bar of Type4py to see the extension's logs and errors.\n\n\u003e **Tip:** To use the local model for type inference instead of our server, see [settings](#settings).\n\n\u003e **Tip:** You can also enable automatic type inference when opening Python files. To do so, see [settings](#settings).\n\n\u003e **Tip:** The same above steps are also applicable to the web version of the extension.\n\n## Considerations\n- Do not edit the selected source file after running the Type4Py extension. That is, add the relevant predicted types to the code, save the file and then edit as you wish. We will drop this consideration once the [caching solution](#roadmap) is implemented.\n- Make sure that the selected source file does not have syntax or parse errors before running the extension. In VSCode, Python linters warn about such errors.\n- Concerning variables' redeclaration, type predictions are available for the last redeclaration of variables. \n\n# Installation\n\u003e **NOTE:** Update VSCode before installing the extension.\n\nThe latest version of the extension can be installed from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=saltud.type4py). The extension is also compatible with the **web version** of VSCode.\n\n# Settings\n| Name \t| Description \t| Default \t|\n|---\t|---\t|---\t|\n| workspace.localModelEnabled | If enabled, it uses Type4Py's local model on your machine. NOTE THAT you need to pull and run Type4Py's Docker image first. See [here](https://github.com/saltudelft/type4py/wiki/Type4Py's-Local-Model) for more info. | false |\n| workspace.autoInferEnabled | If enabled, it automatically infers type annotations when opening a Python source file. Note that automatic inference works only once for a newly opened file. | false |\n| workspace.filterPredictionsEnabled \t| If enabled, based on the file's imported names, irrelevent type predictions will be filtered out. Disable this setting if you would like to get all the predicted types regardless of relevancy. \t| true \t|\n| workspace.shareAcceptedPredictions | If enabled, accepted type predictions will be shared with us for research purposes and improving our Type4Py model. Note that the value of VSCode Telemetry overrides this setting. Read our privacy statement [here](PRIVACY.md). | false\n\n\u003c!-- | workspace.typeCheckEnabled \t| **[NOT SUPPORTED YET!]** If enabled, type checking will be performed for predicted types. This will result in longer waiting times, but will lead to more precise type suggestions. | false \t| --\u003e\n\n# Privacy\nPrivacy is very prominent for us. You can read our privacy statements [here](PRIVACY.md).\n\n\u003c!-- # Limitations\nTo accommodate fair use and availability for all users, the extension has currently the following limitations:\n- **Rate limit**: 5 requests per hour and 100 requests per day.\n- **File size**: Python source files of up to 1K LoC can be processed. --\u003e\n\n\u003c!-- # Known Issues --\u003e\n\n# Support\nIssues and errors can be reported [here](https://github.com/saltudelft/type4py-vscode-ext/issues).\n\n# Development\nExternal contributions are welcome such as bug fixes and improvements! Feel free to send a pull request.\n## Running the extension from source\n1. Build the package \u0026 install dependencies using `npm install`\n2. Compile the extension using `npm run compile`\n3. Open `src/extension.ts` in VSCode, open *\"Select Environment\"*, and run in *\"VS Code Extension Development\"*\n4. Open a Python source code file, open the Command Palette, and run the *\"Type4Py: Infer type annotations\"* command. \n5. After a success message pops up, fill function annotations as usual (e.g. `x:` or `def ...) -\u003e`), and type completion items will show up (if available)\n\n## Running tests\n1. Make sure that all instances of VSCode are closed on the machine.\n2. Run `npm run test-compile`\n\n## Web version\nTo develop and test the web version of the extension, run the following commands at the root of the project:\n```\nnpm install \u0026\u0026 npm run compile-web\nnpx vscode-test-web --browserType=chromium --extensionDevelopmentPath=.\n```\nThis opens up the VSCode Web at `localhost:3000` with the extension.\n\n# Roadmap\nHere are the desirable features for future releases.\n- Implementing a caching solution to preserve type predictions when source files change.\n- Enabling the type-checking process for the Type4Py's predictions using [mypy](https://github.com/python/mypy), preferably at the client-side.\n- Fine-tuning the (pre-trained) Type4Py model on users' projects to learn project-specific types.\n\n# Contributors\n- Amir M. Mir (@mir-am)\n- Evaldas Latoškinas (@elatoskinas)\n- Sebastian Proksch (@proksch)\n- Georgios Gousios (@gousiosg)\n\n# Acknowledgements\nThe Type4Py model and its VSCode extension are designed and developed in [SERG](https://se.ewi.tudelft.nl/) at the Delft University of Technology.\n\n\u003cimg src=\"images/tudlogo.png\" alt=\"TUD_logo\" width=\"200\"/\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltudelft%2Ftype4py-vscode-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaltudelft%2Ftype4py-vscode-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltudelft%2Ftype4py-vscode-ext/lists"}