Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

Atry
Copy link

@Atry Atry commented Nov 5, 2021

In #210, we removed extensionKind, so the extensionKind becomes the default value ui,workspace,web, which is not correct, because ui means it will be installed globally, while this extension should be enable for Scala workspaces only.

This PR changes extensionKind to workspace, allowing the extension being selectively enabled according to workspace languages.

@Atry Atry marked this pull request as draft November 5, 2021 18:48
@Atry Atry marked this pull request as ready for review November 5, 2021 18:52
@@ -8,6 +8,9 @@
"engines": {
"vscode": "^1.5.0"
},
"extensionKind": [
"workspace"
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Author

@Atry Atry Nov 8, 2021

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@nicolasstucki nicolasstucki self-assigned this Nov 8, 2021
@Atry Atry closed this Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants