-
Notifications
You must be signed in to change notification settings - Fork 37
Scala Syntax extension should not be installed globally #224
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
Conversation
@@ -8,6 +8,9 @@ | |||
"engines": { | |||
"vscode": "^1.5.0" | |||
}, | |||
"extensionKind": [ | |||
"workspace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS this 100% needed? I wonder if it will not cause additional issue for using remote with VS Code?
The Scala syntax extension is pretty simple, so is there a drawback to having it enabled globally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the documentation it would seem that what we want is to have "ui"
first
https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location says
- "extensionKind": ["ui", "workspace"] — Indicates the extension prefers to run as a UI extension, but does not have any hard requirements on local assets, devices, or capabilities. When using VS Code, the extension will run in VS Code's local extension host if it exists locally and means the user does not have to install the extension on the remote. Otherwise, the extension will run in VS Code's workspace extension host if it exists there. When using VS Code for the Web with Codespaces, it will run in the remote extension host always (as no local extension host is available).
I believe we also need "web"
to support https://github.dev/.
It seems that the default "ui","workspace","web"
is what we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"extensionKind": ["workspace"] — Indicates the extension requires access to workspace contents and therefore needs to run where the workspace is located. That can be on the local machine or on the remote machine or Codespace. Most extensions fall into this category.
According to the document, the difference between ui,workspace,web
and workspace
is about the preference, not the capability. In other words, whether we want to enable this plugin for a non-Scala project by default.
If we don't sure about the preference, workspace
should be the default option, and workspace
plugins can be on the local machine or on the remote machine or Codespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension documentation seems to mention local vs remote workspaces, not workspaces that are language-specific.
This plugin is only enabled on .scala
files and not per workspace. Is there a use-case where someone would not want to highlight a .scala
file with Scala highlighting?
We clearly want to run this on the local machine to avoid extra network traffic for something that does not require the remote machine and can be done locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This plugin is only enabled on .scala files and not per workspace. Is there a use-case where someone would not want to highlight a .scala file with Scala highlighting?
I think we should always highlight on Scala files, so especially that the extension works only on Scala files I don't think the change is needed.
In #210, we removed
extensionKind
, so theextensionKind
becomes the default valueui,workspace,web
, which is not correct, becauseui
means it will be installed globally, while this extension should be enable for Scala workspaces only.This PR changes
extensionKind
toworkspace
, allowing the extension being selectively enabled according to workspace languages.