-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Collecting Feedback for Extensibility Documentation #58226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It would be great to have code examples! |
@nathfreder We do have samples: https://github.com/Microsoft/vscode-extension-samples. Did you have trouble finding that repo? |
Fixing this would probably be one of the biggest improvements for me. Some suggestions:
|
Apologies if this isn’t in scope since it’s not an “extension”, but I’d love a better way to see what part of the Code UI corresponds to a workbench color customization. I like tinkering around with different color changes but often find it difficult to see which element is which. |
@fabiospampinato I agree with most of what you said. Just to make sure, the one on |
@octref So I am wanting documentation on examples for Unit Tests for extensions and it has already been issued on microsoft/vscode-extension-samples#91 and I personally would be willing to write up an example here on how to do such. |
|
@octref keybindings, commands, views, all of them, the syntax is just undocumented. At first I thought it was just some |
@octref: It would be great if the limitations of extensibility were documented. For example files larger than a given size are not synced to the extension host, but the extension only sees that The VS Code API docs does not state in which circumstances I had to find out this when searching for related issues, and found #3147, which contains some information, however it is not even up to date. |
I love looking at the vscode extension examples, however I feel like the examples are not commented at all, and it can be hard to follow along with the code. For example, I'm currently trying to follow along with the multi-step input example. Here is the extension.ts
this line alone I have a ton of trouble following
Let me tell you the things I do like about the dev documentation experience so far
|
@qcz That makes sense. One of my original motivation was to extract scattered information on GitHub into a central place that's searchable and more well-organized. @YurkaninRyan Thanks for the feedback. We can certainly look into making the sample code easier to understand. |
I would really like a glossary of all the terms used by developers to describe the components. When someone wants to create an extension, they need to understand what the editor is capable of and how these capabilities are labeled. Acquiring -- and subsequently retaining -- this information is made increasingly difficult with each additional feature. Extension developers periodically need to append new words to their already large repertoire of definitions without any sort of direct reference. Frequently, I believe, someone will also have an idea for an extension, but their limited vocabulary will prohibit them from progressing to a point where the extension is functional. Throughout discussions, I've seen these words and others used ambigously or interchangeably:
Here's a list from https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesmenus detailing contribution points for menus:
The above may seem quite intuitive for experienced vscode developers, but what about the perspective of a newbie trying to create his/her first extension? An aggregation of terminology used throughout the community and their associated meanings would make the extension ecosystem much more friendly. Even better would be the usage of screenshots or other visual objects to enhance the definitions. |
+1
…On Sun, Sep 9, 2018, 2:02 AM Nealot ***@***.***> wrote:
I would really like a glossary of all the terms used by developers to
describe the components. When someone wants to create an extension, they
need to understand what the editor is capable of and how these capabilities
are labeled. Acquiring -- and subsequently retaining -- this information is
made increasingly difficult with each additional feature. Extension
developers periodically need to append new words to their already large
repertoire of definitions without any sort of direct reference. Frequently,
I believe, someone will also have an idea for an extension, but their
limited vocabulary will prohibit them from progressing to a point where the
extension is functional.
Throughout discussions, I've seen these words and others used ambigously
or interchangeably:
- widget
- window
- peek
- preview/webview
- panel
- view
- explorer
- sidebar
- quick open
- editor
- menu
- viewlet
Here's a list from
https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesmenus
detailing contribution points for menus:
The global Command Palette - commandPalette
The Explorer context menu - explorer/context
The editor context menu - editor/context
The editor title menu bar - editor/title
The editor title context menu - editor/title/context
The debug callstack view context menu - debug/callstack/context
The SCM title menu - scm/title
SCM resource groups menus - scm/resourceGroup/context
SCM resources menus - scm/resource/context
SCM change title menus - scm/change/title
The View title menu - view/title
The View item menu - view/item/context
The above may seem quite intuitive for experienced vscode developers, but
what about the perspective of a newbie trying to create his/her first
extension?
An aggregation of terminology used throughout the community and their
associated meanings would make the extension ecosystem much more friendly.
Even better would be the usage of screenshots or other visual objects to
enhance the definitions.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58226 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVPRpc4N6eNvB7JY-r1dh6cWs-ZDltJYks5uZEx4gaJpZM4WfiGo>
.
|
I only have limited extension authoring experience, but here are some pain points I ran into:
BTW, I interestingly didn't have a hard time following or finding something in the API docs (as others have mentioned), but that could be because I have only used few APIs. In any case, the overall experience of authoring and publishing an extension was pretty enjoyable 💯 |
@nealot I feel your pain. That was an issue when I was trying to learn VS Code too. I don't think the issue only applies to extensibility doc though — a clear description & illustration of VS Code UI would help regular users getting onboard with the editor too. I opened microsoft/vscode-docs#1842.
When I was writing the docs for Language Server I made this distinction: https://code.visualstudio.com/docs/extensions/example-language-server#_testing-the-language-server, but I guess in the general Testing page section could have some doc for that too.
Did you have a look this page? https://code.visualstudio.com/docs/extensions/testing-extensions |
Another big one is documenting menu/command callbacks -- Each context a menu/command is executed from (https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesmenus) returns a different set of arguments. For some extra context: #25716 and #34048. I honestly find dealing with commands the most challenging part of the vscode api. |
@octref 👍
Yes 😁 |
@eamodio From what I read in that issue, if you are using the same command for multiple contexts you should prepare for different arguments. You can always register different commands for different contexts, can't you? |
Complex Commands should provide clearly formatted, linked types for the parameters and returns as in the "vscode namespace API" doc. |
@KamasamaK I agree. Many people feel the name "complex command" is confusing too. |
@octref yeah, I could have different commands for each context (and I might start doing that). But I avoided that because that causes SO much duplication in the package.json. For something like GitLens which has lots of commands, it now multiplies them by the number of contexts (which is many and growing). And it requires that I keep them in sync (typo's, renames, etc). And it can be confusing to a user, because now which command do they bind a keyboard shortcut to because there are now 5 versions of many commands. It gets nuts fast once you move past a small number of commands. EDIT: Just to dive in a tad more on the keyboard bindings thing -- since a user can assign a binding for any command -- that command can get executed from contexts it wasn't expecting depending on how the user executes that command -- which adds a significant challenge even when trying to use a specific command for each context. |
Looking back at the code, was it because the code itself includes many new JS/TS features that it's hard to understand? Because I don't think the code itself is complex — it merely assigns 4 functions as the value of an option, later passed to
@eamodio That might be a result of the complexity of GitLens's features. You can try opening new issues to persuade @jrieken. One downside of adding a context object to each command's signature might be that it adds unnecessary arguments to commands for single contexts. |
@octref I actually pulled it down and fiddled with it and eventually figured it out! I was going there to try and understand how to create the multi step input. I thought the whole repo was just doing that usecase, but in actuality, it was a few different examples that could be selected from a dropdown, and one of those examples was the multi step input. I had problems figuring out:
If there was any commenting or direction pointing it would of helped a lot. I had similar struggles in most of the examples. I wasn't sure what to look at, or why I was looking at it. |
As you've already come across, the complex commands page needs improvement.
My biggest pain point in extension development has been surrounding the fact that on opening a folder in the current window, the current extension host process is shutdown, and so you have to activate the extension on the new window/folder in order to access it (i.e. to call createTerminal). I'd appreciate some further documentation surrounding how vscode handles folders, workspaces etc, for extensions that want to create, open and close folders. |
I agree with previous posts about "where" for menus/commands. It was the biggest problem for me when I was creating some extensions in the past.
|
@visualzoran Thanks — extension can expose its own API is something that even I didn't know it existed. I'll include it as a topic in the new extensibility doc. |
I too just recently learned about extensions exposing public APIs by seeing the git extension do it, and would be interested in learning more. |
Thanks a lot for all your valuable feedback! We have created an internal plan to address most of the issues. In the next one or two iterations, we'll do the minimal work possible to publish the new extension authoring doc. After publishing the new docs, we'll write new topics, edit old ones and make improvements to pages such as the API reference. |
Generally speaking the more documentation, the better. The webview documentation was great and it would be nice to see stuff like that for other parts of the API. For example, there are no guides on how to add telemetry to your extension. so I wrote my own: adding telemetry with azure and setting up email alerts. Because of the outstanding bug with the innacurate download counts telemetry is important to see how many users you have. @lannonbr also wrote some good guides on decorations and unit testing. |
One other thing I forgot to mention and haven't seen anyone else mention is that the API and complex command references are lacking an indication of what version the item was added at. |
minor but helpful things:
🙏 |
another one: the docs for the docs: warning: @octref is there a better place to log these types of things since this issue is now closed? |
@busticated Can you post a new issue under https://github.com/microsoft/vscode-docs/issues? I'll tackle it there. The two issues you listed above for the API doc — we have a huge backlog for that page. We'll do it from scratch and I've taken notes, so no need for new issues on those two. |
d'oh! posted to the wrong issues queue - recreated over here: |
Hey all, as some of you might have noticed, we had a multi month effort to refresh our Extension API doc. The work is near complete and will be published soon. A preview is available at https://vscode-ext-docs.azurewebsites.net/api. If you have any feedback, feel free to open an issue at https://github.com/microsoft/vscode-docs and mention me. The update focused on making structure changes that make the doc easy to navigate and find information from. We also added new topics such as Extension API Overview, Extension Capability Overview to help you better utilize the vast extensibility system, and new guides/samples such as Tree View / Color Theme / Textmate Grammar. From the writers & contributors' perspective, this update makes it easier to add new topics and make changes. This should lay down a good foundation for us to address the extensibility issues in vscode-docs repo. We'll continue to refresh the Extension API doc, and we welcome your contribution too 😉. |
As some of you might have noticed in the freshly baked September Iteration Plan, one of our focus this month is extensibility documentation. Which comprise of:
Some of the issues we are already aware of:
We'll try to address those issues. But we also want to hear from you, the extension authors.
While you are trying to write VS Code extensions, which doc page is hard to understand? What are the issues you run into? On what topic were you unable to find useful information? How can we make the process more enjoyable for you?
The text was updated successfully, but these errors were encountered: