Skip to content

Commit

Permalink
Adding DiagnosticCollection extension issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lostintangent committed Apr 24, 2018
1 parent 451461c commit d24b5db
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/reference/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Creative Commons Attribution 4.0 License (International): https://creativecommon

# Extensions and Ecosystem Support

One of the primary goals of Visual Studio Live Share is to enable developers to collaborate with each other, from the comfort of their favorite, and [**highly-customized**](https://marketplace.visualstudio.com/) tools. This way, ad-hoc interactions can occur frequently, while remaining visually familiar and ergonomic, regardless what you're helping with. To achieve this, it's critical that participants within a collaboration session are able to continue using any extensions which support their [personal preferences and workflows](#user-specific-extensions) (e.g. color themes, key bindings, editor productivity enhancers).
One of the primary goals of Visual Studio Live Share is to enable developers to collaborate with each other, from the comfort of their favorite, and [**highly-customized**](https://marketplace.visualstudio.com/) tools. This way, ad-hoc interactions can occur frequently, while remaining visually familiar and ergonomic, regardless what you're helping with. To achieve this, it's critical that participants within a collaboration session are able to continue using any extensions which support their [personal preferences and workflows](#user-specific-extensions) (e.g. color/icons themes, key bindings, editor productivity enhancers).

Additionally, to make the act of joining a collaboration session as instant as possible, while remaining highly-productive, the goal of Visual Studio Live Share is to enable guests to automatically leverage the project-specific tooling their host has shared. This way, you can simply click a link, launch your tool of choice, and begin collaborating, without any extra setup. To achieve this, it is critical that extensions, which power the core [edit, build and debug workflow](#project-specific-extensions), are transparently "remoted" from the host to the guest, so that things like auto-completion, go-to-definition, and debugging "just work".

Expand All @@ -40,7 +40,7 @@ Extensions that support user-specific customizations **must** work for the host,
| Key bindings | [Vim](https://marketplace.visualstudio.com/items?itemName=vscodevim.vim), [IntelliJ IDEA Keybindings](https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings), [Emacs Friendly Keymap](https://marketplace.visualstudio.com/items?itemName=lfs.vscode-emacs-friendly) || *N/A* |
| Snippets | [Angular v5 Snippets](https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2), [HTML Snippets](https://marketplace.visualstudio.com/items?itemName=abusaidm.html-snippets), [SVG Icons](https://marketplace.visualstudio.com/items?itemName=idleberg.svg-icons), [File Header](https://marketplace.visualstudio.com/items?itemName=mikey.vscode-fileheader) || *N/A* <sup>1</sup> |
| Organization | [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync), [Project Manager](https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager), [Timeit](https://marketplace.visualstudio.com/items?itemName=smulyono.timeit), [Checkpoints](https://marketplace.visualstudio.com/items?itemName=micnil.vscode-checkpoints), [TODO Parser](https://marketplace.visualstudio.com/items?itemName=minhthai.vscode-todo-parser), [Favorites](https://marketplace.visualstudio.com/items?itemName=kdcro101.favorites) (❌), [Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks) (❌) | ✅ <sup>2</sup> | *N/A* <sup>3</sup> |
| Productivity | [Auto-Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag), [Code Outline](https://github.com/patrys/vscode-code-outline), [Color Highlight](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight), [Increment Selection](https://marketplace.visualstudio.com/items?itemName=albymor.increment-selection), [Bracketeer](https://marketplace.visualstudio.com/items?itemName=pustelto.bracketeer), [Image Preview](https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-gutter-preview), [JSON Helper](https://marketplace.visualstudio.com/items?itemName=zhoufeng.json-helper) (Hover), [Color Picker](https://marketplace.visualstudio.com/items?itemName=anseki.vscode-color), [Copy Word in Cursor](https://marketplace.visualstudio.com/items?itemName=alefragnani.copy-word), [CodeMetrics](https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-codemetrics) (CodeLens), [Git Co-Authors](https://github.com/rjimenezda/vscode-coauthor), [JavaScript Booster](https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster) (CodeActions), [Turbo Console Log](https://marketplace.visualstudio.com/items?itemName=ChakrounAnas.turbo-console-log), [Auto-scroll](https://github.com/PejmanNik/vscode-autoScroll?files=1), [NPM Import Version](https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-npm-import-package-version) (❌), [Import Cost](https://github.com/wix/import-cost) (❌), [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) (❌) | ✅ <sup>2</sup> | ❌ <sup>3</sup> |
| Productivity | [Auto-Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag), [Code Outline](https://github.com/patrys/vscode-code-outline), [Color Highlight](https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight), [Increment Selection](https://marketplace.visualstudio.com/items?itemName=albymor.increment-selection), [Bracketeer](https://marketplace.visualstudio.com/items?itemName=pustelto.bracketeer), [Image Preview](https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-gutter-preview), [JSON Helper](https://marketplace.visualstudio.com/items?itemName=zhoufeng.json-helper) (Hover), [Color Picker](https://marketplace.visualstudio.com/items?itemName=anseki.vscode-color), [Copy Word in Cursor](https://marketplace.visualstudio.com/items?itemName=alefragnani.copy-word), [CodeMetrics](https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-codemetrics) (CodeLens), [Git Co-Authors](https://github.com/rjimenezda/vscode-coauthor), [JavaScript Booster](https://marketplace.visualstudio.com/items?itemName=sburg.vscode-javascript-booster) (CodeActions), [Turbo Console Log](https://marketplace.visualstudio.com/items?itemName=ChakrounAnas.turbo-console-log), [Goto Next/Previous Member](https://marketplace.visualstudio.com/items?itemName=mishkinf.goto-next-previous-member), [Auto-scroll](https://github.com/PejmanNik/vscode-autoScroll?files=1), [NPM Import Version](https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-npm-import-package-version) (❌), [Import Cost](https://github.com/wix/import-cost) (❌), [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) (❌) | ✅ <sup>2</sup> | ❌ <sup>3</sup> |
| REPLs | [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client), [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner), [Quokka.js](https://marketplace.visualstudio.com/items?itemName=WallabyJs.quokka-vscode), [R](https://marketplace.visualstudio.com/items?itemName=Ikuyadeu.r) | ✅ <sup>4</sup> | ❌ <sup>3</sup> |
| Resource Managers | [mssql](https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql), [ftp-simple](https://marketplace.visualstudio.com/items?itemName=humy2833.ftp-simple), [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions), [Docker](https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker), [Brew Services](https://marketplace.visualstudio.com/items?itemName=beauallison.brew-services) | ✅ <sup>5</sup> | ❌ <sup>3</sup> |

Expand Down Expand Up @@ -96,15 +96,16 @@ The following are currently known extension issues, that could prevent them from
| Issue | Reason | Workaround |
|-|-|-|
| Using the Node.js `fs` module to detect/read files (e.g. a config file), or enumerate directories (and you aren't a language service). | Guests don't have local file access. | 1. Gracefully degrade the user-experience *(if possible).*<br /><br />2. Use the `openTextDocument` and `findFiles` workspace APIs to read and enumerate files. |
| Using the Node.js `fs` module to create or write files | *Same as above* | *N/A* You can use the `openTextDocument(Uri)` API to create an "untitled" file, but you can't save it directly to the file system, at a specific path. |
| Using the Node.js `fs` module to create or write files | *Same as above* | *N/A* You can use the `openTextDocument(Uri)` API to create an `untitled` file, but you can't save it directly to the file system, at a specific path. |
| Depending on a project-bundled library or tool | *Same as above* | 1. Bundle a fallback version of the dependency with the extension<br><br> 2. Support global installation to unblock guests if they choose to explicitly install it.<br><br> 3. Remote the state/action if possible, since the host would have the right dependencies available. |
| Using the Node.js `fs` module to create a directory | *Same as above* | *N/A* |
| Restricting functionality to documents that use the `file` scheme. | Files on the guest's side use the `vsls` scheme. | Add support for `vsls` documents ([example](https://github.com/CoenraadS/BracketPair/pull/73)) |
| Using the `Uri.file` method and/or `Uri.fsPath`/`TextDocument.fileName` members to serialize/parse URIs | *Same as above* | Use `Uri.parse` and `Url.toString()` instead, which maintain and respect file schemes ([example](https://github.com/micnil/vscode-checkpoints/pull/2)) |
| Using the `workspace.openTextDocument` method with a file path instead of a Uri | *Same as above* | Provide a `Uri` instance instead of a raw file path string ([example](https://github.com/micnil/vscode-checkpoints/pull/2)) |
| Using the `workspace.openTextDocument` method with a file path instead of a `Uri` | *Same as above* | Provide a `Uri` instance instead of a raw file path string ([example](https://github.com/micnil/vscode-checkpoints/pull/2)) |
| Using the `workspace.rootPath` property to detect the presence of a workspace | The `workspace.rootPath` property calls `Uri.fsPath` on the first `workspaceFolder` in the `worspace`, which has the same issue mentioned above | Use the `workspace.workspaceFolders` property to detect the presence of a workspace instead, and if needed, look at each `workspaceFolder`'s `Uri.scheme` to determine if it's local or not |
| Guests see duplicate entries when viewing completion lists, quick info, etc. | Guests receive the language service results from both their local extensions, and the host | Restrict the language client to only `file` and `untitled` schemes ([example](https://github.com/vuejs/vetur/pull/756/files)) |
| Guests see duplicated task definitions when both they and the host have an extension installed | Guests display all remote and local tasks | Only return `Tasks` for `WorkspaceFolder`s whose `Uri.scheme` === `file` ([example](https://github.com/Microsoft/vscode-eslint/blob/0fdb7c74b093cae9dc08355e7235582a254f24c2/client/src/tasks.ts#L42)) |
| Not specifying a document scheme when registering language services (either via a `LanguageClient`, or the `languages.register*` methods) | Guests receive the language service results from both their local extensions, and the host, and therefore, if both participants have the same language service extension installed, guests will see duplicate entries for certain things (e.g. auto-completion, code actions) | Restrict the language services to only `file` and `untitled` schemes ([example](https://github.com/vuejs/vetur/pull/756/files)) |
| Not checking a document's `Uri.scheme` before populating a `DiagnosticCollection` for it | *Same as above* | Only generate `Diagnostics` for `documents` whose `Uri.scheme` === `file` ([example](https://github.com/Huachao/vscode-restclient/pull/196)) |
| Not checking for workspace scheme when returning `Tasks` from a custom `TaskProvider` | Guests display all remote and local tasks, and therefore, would display duplicates if both participants had the same extension installed | Only return `Tasks` for `WorkspaceFolder`s whose `Uri.scheme` === `file` ([example](https://github.com/Microsoft/vscode-eslint/blob/0fdb7c74b093cae9dc08355e7235582a254f24c2/client/src/tasks.ts#L42)) |

## Extensibility API

Expand Down

0 comments on commit d24b5db

Please sign in to comment.