{"id":17377365,"url":"https://github.com/kieran-ryan/pyprojectsort-vscode","last_synced_at":"2026-01-19T13:32:39.623Z","repository":{"id":213202852,"uuid":"659418309","full_name":"kieran-ryan/pyprojectsort-vscode","owner":"kieran-ryan","description":"VSCode extension for pyprojectsort","archived":false,"fork":false,"pushed_at":"2024-04-18T23:48:02.000Z","size":65,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T00:24:36.476Z","etag":null,"topics":["formatter","pyproject","python","vscode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kieran-ryan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-27T19:44:44.000Z","updated_at":"2023-07-16T19:40:35.000Z","dependencies_parsed_at":"2024-02-29T03:28:51.731Z","dependency_job_id":"e73e769d-ae82-4ba6-a5d2-494755425e74","html_url":"https://github.com/kieran-ryan/pyprojectsort-vscode","commit_stats":null,"previous_names":["kieran-ryan/pyprojectsort-vscode"],"tags_count":0,"template":false,"template_full_name":"microsoft/vscode-python-tools-extension-template","purl":"pkg:github/kieran-ryan/pyprojectsort-vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-ryan%2Fpyprojectsort-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-ryan%2Fpyprojectsort-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-ryan%2Fpyprojectsort-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-ryan%2Fpyprojectsort-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kieran-ryan","download_url":"https://codeload.github.com/kieran-ryan/pyprojectsort-vscode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kieran-ryan%2Fpyprojectsort-vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28569220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["formatter","pyproject","python","vscode"],"created_at":"2024-10-16T05:05:38.589Z","updated_at":"2026-01-19T13:32:39.605Z","avatar_url":"https://github.com/kieran-ryan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Template for VS Code python tools extensions\n\nThis is a template repository to get you started on building a VS Code extension for your favorite python tool. It could be a linter, formatter, or code analysis, or all of those together. This template will give you the basic building blocks you need to build a VS Code extension for it.\n\n## Programming Languages and Frameworks\n\nThe extension template has two parts, the extension part and language server part. The extension part is written in TypeScript, and language server part is written in Python over the [_pygls_][pygls] (Python language server) library.\n\nFor the most part you will be working on the python part of the code when using this template. You will be integrating your tool with the extension part using the [Language Server Protocol](https://microsoft.github.io/language-server-protocol). [_pygls_][pygls] currently works on the [version 3.16 of LSP](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/).\n\nThe TypeScript part handles working with VS Code and its UI. The extension template comes with few settings pre configured that can be used by your tool. If you need to add new settings to support your tool, you will have to work with a bit of TypeScript. The extension has examples for few settings that you can follow. You can also look at extensions developed by our team for some of the popular tools as reference.\n\n## Requirements\n\n1. VS Code 1.64.0 or greater\n1. Python 3.7 or greater\n1. node \u003e= 14.19.0\n1. npm \u003e= 8.3.0 (`npm` is installed with node, check npm version, use `npm install -g npm@8.3.0` to update)\n1. Python extension for VS Code\n\nYou should know to create and work with python virtual environments.\n\n## Getting Started\n\n1. Use this [template to create your repo](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).\n1. Check-out your repo locally on your development machine.\n1. Create and activate a python virtual environment for this project in a terminal. Be sure to use the minimum version of python for your tool. This template was written to work with python 3.7 or greater.\n1. Install `nox` in the activated environment: `python -m pip install nox`.\n1. Add your favorite tool to `requirements.in`\n1. Run `nox --session setup`.\n1. **Optional** Install test dependencies `python -m pip install -r src/test/python_tests/requirements.txt`. You will have to install these to run tests from the Test Explorer.\n1. Open `package.json`, look for and update the following things:\n    1. Find and replace `\u003cpytool-module\u003e` with module name for your tool. This will be used internally to create settings namespace, register commands, etc. Recommendation is to use lower case version of the name, no spaces, `-` are ok. For example, replacing `\u003cpytool-module\u003e` with `pylint` will lead to settings looking like `pylint.args`. Another example, replacing `\u003cpytool-module\u003e` with `black-formatter` will make settings look like `black-formatter.args`.\n    1. Find and replace `\u003cpytool-display-name\u003e` with display name for your tool. This is used as the title for the extension in market place, extensions view, output logs, etc. For example, for the `black` extension this is `Black Formatter`.\n1. Install node packages using `npm install`.\n\n## Features of this Template\n\nAfter finishing the getting started part, this template would have added the following. Assume `\u003cpytool-module\u003e` was replaced with `mytool`, and `\u003cpytool-display-name\u003e` with`My Tool`:\n\n1. A command `My Tool: Restart Server` (command Id: `mytool.restart`).\n1. Following setting:\n    - `mytool.args`\n    - `mytool.path`\n    - `mytool.importStrategy`\n    - `mytool.interpreter`\n    - `mytool.showNotification`\n1. Following triggers for extension activation:\n    - On Language `python`.\n    - On File with `.py` extension found in the opened workspace.\n1. Following commands are registered:\n    - `mytool.restart`: Restarts the language server.\n1. Output Channel for logging `Output` \u003e `My Tool`\n\n## Adding features from your tool\n\nOpen `bundled/tool/lsp_server.py`, here is where you will do most of the changes. Look for `TODO` comments there for more details.\n\nAlso look for `TODO` in other locations in the entire template:\n\n- `bundled/tool/lsp_runner.py` : You may need to update this in some special cases.\n- `src/test/python_tests/test_server.py` : This is where you will write tests. There are two incomplete examples provided there to get you started.\n- All the markdown files in this template have some `TODO` items, be sure to check them out as well. That includes updating the LICENSE file, even if you want to keep it MIT License.\n\nReferences, to other extension created by our team using the template:\n\n- Protocol reference: \u003chttps://microsoft.github.io/language-server-protocol/specifications/specification-3-16/\u003e\n- Implementation showing how to handle Linting on file `open`, `save`, and `close`. [Pylint](https://github.com/microsoft/vscode-pylint/tree/main/bundled/tool)\n- Implementation showing how to handle Formatting. [Black Formatter](https://github.com/microsoft/vscode-black-formatter/tree/main/bundled/tool)\n- Implementation showing how to handle Code Actions. [isort](https://github.com/microsoft/vscode-isort/blob/main/bundled/tool)\n\n## Building and Run the extension\n\nRun the `Debug Extension and Python` configuration form VS Code. That should build and debug the extension in host window.\n\nNote: if you just want to build you can run the build task in VS Code (`ctrl`+`shift`+`B`)\n\n## Debugging\n\nTo debug both TypeScript and Python code use `Debug Extension and Python` debug config. This is the recommended way. Also, when stopping, be sure to stop both the Typescript, and Python debug sessions. Otherwise, it may not reconnect to the python session.\n\nTo debug only TypeScript code, use `Debug Extension` debug config.\n\nTo debug a already running server or in production server, use `Python Attach`, and select the process that is running `lsp_server.py`.\n\n## Logging and Logs\n\nThe template creates a logging Output channel that can be found under `Output` \u003e `mytool` panel. You can control the log level running the `Developer: Set Log Level...` command from the Command Palette, and selecting your extension from the list. It should be listed using the display name for your tool. You can also set the global log level, and that will apply to all extensions and the editor.\n\nIf you need logs that involve messages between the Language Client and Language Server, you can set `\"mytool.server.trace\": \"verbose\"`, to get the messaging logs. These logs are also available `Output` \u003e `mytool` panel.\n\n## Adding new Settings or Commands\n\nYou can add new settings by adding details for the settings in `package.json` file. To pass this configuration to your python tool server (i.e, `lsp_server.py`) update the `settings.ts` as need. There are examples of different types of settings in that file that you can base your new settings on.\n\nYou can follow how `restart` command is implemented in `package.json` and `extension.ts` for how to add commands. You cam also contribute commands from Python via the Language Server Protocol.\n\n## Testing\n\nSee `src\\test\\python_tests\\test_server.py` for starting point. See, other referred projects here for testing various aspects of running the tool over LSP.\n\nIf you have installed the test requirements you should be able to see the tests in the test explorer.\n\nYou can also run all tests using `nox --session tests` command.\n\n## Linting\n\nRun `nox --session lint` to run linting on both Python and TypeScript code. Please update the nox file if you want to use a different linter and formatter.\n\n## Packaging and Publishing\n\n1. Update various fields in `package.json`. At minimum, check the following fields and update them accordingly. See [extension manifest reference](https://code.visualstudio.com/api/references/extension-manifest) to add more fields:\n    - `\"publisher\"`: Update this to your publisher id from \u003chttps://marketplace.visualstudio.com/\u003e.\n    - `\"version\"`: See \u003chttps://semver.org/\u003e for details of requirements and limitations for this field.\n    - `\"license\"`: Update license as per your project. Defaults to `MIT`.\n    - `\"keywords\"`: Update keywords for your project, these will be used when searching in the VS Code marketplace.\n    - `\"categories\"`: Update categories for your project, makes it easier to filter in the VS Code marketplace.\n    - `\"homepage\"`, `\"repository\"`, and `\"bugs\"` : Update URLs for these fields to point to your project.\n    - **Optional** Add `\"icon\"` field with relative path to a image file to use as icon for this project.\n1. Make sure to check the following markdown files:\n    - **REQUIRED** First time only: `CODE_OF_CONDUCT.md`, `LICENSE`, `SUPPORT.md`, `SECURITY.md`\n    - Every Release: `CHANGELOG.md`\n1. Build package using `nox --session build_package`.\n1. Take the generated `.vsix` file and upload it to your extension management page \u003chttps://marketplace.visualstudio.com/manage\u003e.\n\nTo do this from the command line see here \u003chttps://code.visualstudio.com/api/working-with-extensions/publishing-extension\u003e\n\n## Upgrading Dependencies\n\nDependabot yml is provided to make it easy to setup upgrading dependencies in this extension. Be sure to add the labels used in the dependabot to your repo.\n\nTo manually upgrade your local project:\n\n1. Create a new branch\n1. Run `npm update` to update node modules.\n1. Run `nox --session setup` to upgrade python packages.\n\n## Troubleshooting\n\n### Changing path or name of `lsp_server.py` something else\n\nIf you want to change the name of `lsp_server.py` to something else, you can. Be sure to update `constants.ts` and `src\\test\\python_tests\\lsp_test_client\\session.py`.\n\nAlso make sure that the inserted paths in `lsp_server.py` are pointing to the right folders to pick up the dependent packages.\n\n### Module not found errors\n\nThis can occurs if `bundled/libs` is empty. That is the folder where we put your tool and other dependencies. Be sure to follow the build steps need for creating and bundling the required libs.\n\nCommon one is [_pygls_][pygls] module not found.\n\n# TODO: The maintainer of this repo has not yet edited this file\n\n**Repo Owner** Make sure you update this. As a repository owner you will need to update this file with specific instructions for your extension.\n\n[pygls]: https://github.com/openlawlibrary/pygls\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieran-ryan%2Fpyprojectsort-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkieran-ryan%2Fpyprojectsort-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieran-ryan%2Fpyprojectsort-vscode/lists"}