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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.

],
"homepage": "https://github.com/scala/vscode-scala-syntax/blob/main/README.md",
"repository": {
"type": "git",
Expand Down