GithubHelp home page GithubHelp logo

Comments (6)

foxundermoon avatar foxundermoon commented on July 23, 2024

Out of the box and to manually configure a tradeoff

In order to meet the user's ease of use, I tried to add an automatic download function.

All code in the plugin is open source, public, and auditable. The binaries source URL is also pointing to the author's release page.


But yours is a good suggestion

Before the automatic download, we can add the user approval process and add the hash check of the downloaded file.user can choose auto download or manual download and config.

from vs-shell-format.

foxundermoon avatar foxundermoon commented on July 23, 2024

Bug: Detecting existing shfmt

The logic to identify if shfmt is available on local machine/path is broken - it didn't detect the installed/available version of shfmt on the system.

I understand what this extension is trying to do (make it easy for this extension to work), but its breaking some cardinal security rules. Implementing some of the safety check (checksum executable) would not change this - extensions shouldn't source arbitrary binaries.

In order to ensure that the version of the binary file is upgraded with the plugin, the future version will not check the PATH. If you need to specify it manually, you can configure the shellformat.path and specify the version update in the changelog.

from vs-shell-format.

iyerusad avatar iyerusad commented on July 23, 2024

On the positive side, placing within extension folder is at least reasonable place to store it (as opposed to system bin). This is a reasonable compromise.

I would strongly suggest taking advantage of established paradigms (e.g. $PATH), but I understand you are seeing shfmt is not widely available on user systems and they are complaining about the extension not working. Frustrating to read those reviews.

Something to think about - Which are you building?

  • package manager's functionality within VS Code extension (but only for one package)?
  • extension to hook up shfmt to VS Code?

Closing this issue - I think existing behavior is inline with other VS Code extensions (including Microsoft's Azure extensions - they also download binaries, but they do own/build them)

from vs-shell-format.

foxundermoon avatar foxundermoon commented on July 23, 2024

I also tried to package the files into the plugin and package them into different plugins according to different platforms, but vscode does not have such a mechanism.

from vs-shell-format.

iyerusad avatar iyerusad commented on July 23, 2024

package the files into the plugin...into different plugins according to different platforms
vscode does not have such a mechanism.

You wouldn't want to do that. Taking advantage of a concept like $PATH is one way that would allow you to maintain one extension that would work on various operating systems and environments. This allows you as the extension developer to focus on the extension, and operating system developers to focus on integrating a functioning $PATH (or whatever concept you utilize to achieve portability across platforms).

If you go esoteric, you might find people running VS Code on atypical architectures: ARM, within a browser, or remote shell sessions - its nice if extension works in all those scenarios.

That being said, I have seen a major multi-million (billion?) invested architecture (e.g. ARM) have a global total of less than 10 active users.... So I wouldn't be too focused on being that portable.

from vs-shell-format.

foxundermoon avatar foxundermoon commented on July 23, 2024

thanks suggest

from vs-shell-format.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.