You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This is a template repository to get you started on building a VS Code extension
4
4
5
5
## Programming Languages and Frameworks
6
6
7
-
The 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` (Python language server) library.
7
+
The 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.
8
8
9
-
For 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` currently works on the [version 3.16 of LSP](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/).
9
+
For 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/).
10
10
11
11
The 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.
12
12
@@ -58,16 +58,16 @@ Open `bundled/tool/server.py`, here is where you will do most of the changes. Lo
58
58
59
59
Also look for `TODO` in other locations in the entire template:
60
60
61
-
-`bundled/tool/runner.py` : You may need to update this in some special cases.
62
-
-`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.
63
-
-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.
61
+
-`bundled/tool/runner.py` : You may need to update this in some special cases.
62
+
-`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.
63
+
- 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.
64
64
65
65
References, to other extension created by our team using the template:
-Implementation showing how to handle Linting on file `open`, `save`, and `close`. [Pylint](https://github.com/microsoft/vscode-pylint/tree/main/bundled/tool)
69
-
-Implementation showing how to handle Formatting. [Black Formatter](https://github.com/microsoft/vscode-black-formatter/tree/main/bundled/tool)
70
-
-Implementation showing how to handle Code Actions. [isort](https://github.com/microsoft/vscode-isort/blob/main/bundled/tool)
- Implementation showing how to handle Linting on file `open`, `save`, and `close`. [Pylint](https://github.com/microsoft/vscode-pylint/tree/main/bundled/tool)
69
+
- Implementation showing how to handle Formatting. [Black Formatter](https://github.com/microsoft/vscode-black-formatter/tree/main/bundled/tool)
70
+
- Implementation showing how to handle Code Actions. [isort](https://github.com/microsoft/vscode-isort/blob/main/bundled/tool)
71
71
72
72
## Building and Run the extension
73
73
@@ -103,21 +103,21 @@ Run `nox --session lint` to run linting on both Python and TypeScript code. Plea
103
103
104
104
## Packaging and Publishing
105
105
106
-
1.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:
107
-
-`"publisher"`: Update this to your publisher id from https://marketplace.visualstudio.com/.
108
-
-`"version"`: See https://semver.org/ for details of requirements and limitations for this field.
109
-
-`"license"`: Update license as per your project. Defaults to `MIT`.
110
-
-`"keywords"`: Update keywords for your project, these will be used when searching in the VS Code marketplace.
111
-
-`"categories"`: Update categories for your project, makes it easier to filter in the VS Code marketplace.
112
-
-`"homepage"`, `"repository"`, and `"bugs"` : Update URLs for these fields to point to your project.
113
-
-**Optional** Add `"icon"` field with relative path to a image file to use as icon for this project.
114
-
1.Make sure to check the following markdown files:
115
-
-**REQUIRED** First time only: `CODE_OF_CONDUCT.md`, `LICENSE`, `SUPPORT.md`, `SECURITY.md`
116
-
-Every Release: `CHANGELOG.md`
117
-
1.Build package using `nox --session build_package`.
118
-
1.Take the generated `.vsix` file and upload it to your extension management page https://marketplace.visualstudio.com/manage.
119
-
120
-
To do this from the command line see here https://code.visualstudio.com/api/working-with-extensions/publishing-extension
106
+
1. 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:
107
+
-`"publisher"`: Update this to your publisher id from <https://marketplace.visualstudio.com/>.
108
+
-`"version"`: See <https://semver.org/> for details of requirements and limitations for this field.
109
+
-`"license"`: Update license as per your project. Defaults to `MIT`.
110
+
-`"keywords"`: Update keywords for your project, these will be used when searching in the VS Code marketplace.
111
+
-`"categories"`: Update categories for your project, makes it easier to filter in the VS Code marketplace.
112
+
-`"homepage"`, `"repository"`, and `"bugs"` : Update URLs for these fields to point to your project.
113
+
-**Optional** Add `"icon"` field with relative path to a image file to use as icon for this project.
114
+
1. Make sure to check the following markdown files:
115
+
-**REQUIRED** First time only: `CODE_OF_CONDUCT.md`, `LICENSE`, `SUPPORT.md`, `SECURITY.md`
116
+
- Every Release: `CHANGELOG.md`
117
+
1. Build package using `nox --session build_package`.
118
+
1. Take the generated `.vsix` file and upload it to your extension management page <https://marketplace.visualstudio.com/manage>.
119
+
120
+
To do this from the command line see here <https://code.visualstudio.com/api/working-with-extensions/publishing-extension>
121
121
122
122
## Upgrading Dependencies
123
123
@@ -129,20 +129,22 @@ To manually upgrade your local project:
129
129
1. Run `npm update` to update node modules.
130
130
1. Run `nox --session setup` to upgrade python packages.
131
131
132
-
# Troubleshooting
132
+
##Troubleshooting
133
133
134
-
## Changing path or name of `server.py` something else.
134
+
###Changing path or name of `server.py` something else
135
135
136
136
If you want to change the name of `server.py` to something else, you can. Be sure to update `constants.ts` and `src\test\python_tests\lsp_test_client\session.py`.
137
137
138
138
Also make sure that the inserted paths in `server.py` are pointing to the right folders to pick up the dependent packages.
139
139
140
-
## Module not found errors.
140
+
###Module not found errors
141
141
142
142
This 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.
143
143
144
-
Common one is `pygls` module not found.
144
+
Common one is [_pygls_][pygls] module not found.
145
145
146
146
# TODO: The maintainer of this repo has not yet edited this file
147
147
148
148
**Repo Owner** Make sure you update this. As a repository owner you will need to update this file with specific instructions for your extension.
0 commit comments