Open sammcj opened 3 years ago
Currently, the newest version mvdan/sh:v3.2.4
has darwin_arm64 build. So we need to bump shfmt dependency to v3.2.4
.
@foxundermoon generally, this ticket can be closed. However, VSCodium users won't see the fix until someone updates the available release of your extension on VSCodium's marketplace.
@foxundermoon is this going to be released any time soon? Would much appreciate it as this blocks all MacBook users who upgraded to M-chips :)
For anyone needing a dirty quick-fix right now, update
~/.{vscode|vscode-oss}/extensions/foxundermoon.shell-format-7.0.1-universal/dist/extension.js
```javascript
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";function i(){}function r(e,t,n,i,r){for(var o=0,s=t.length,a=0,l=0;oe.length?n:e})),u.value=e.join(c)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(l+=u.count)}}var d=t[s-1];return s>1&&"string"==typeof d.value&&(d.added||d.removed)&&e.equals("",d.value)&&(t[s-2].value+=d.value,t.pop()),t}function o(e){return{newPos:e.newPos,components:e.components.slice(0)}}t.__esModule=!0,t.default=i,i.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.callback;"function"==typeof n&&(i=n,n={}),this.options=n;var s=this;function a(e){return i?(setTimeout((function(){i(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var l=(t=this.removeEmpty(this.tokenize(t))).length,u=e.length,f=1,c=l+u,d=[{newPos:-1,components:[]}],h=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=l&&h+1>=u)return a([{value:this.join(t),count:t.length}]);function p(){for(var n=-1*f;n<=f;n+=2){var i=void 0,c=d[n-1],h=d[n+1],p=(h?h.newPos:0)-n;c&&(d[n-1]=void 0);var g=c&&c.newPos+1"),t.push(i(r.value)),r.added?t.push(""):r.removed&&t.push("")}return t.join("")}},function(e,t){e.exports=require("https")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config={shfmtVersion:"v3.2.4",needCheckInstall:!0}}]);
//# sourceMappingURL=extension.js.map
```
I manually edited in the changes from saltchang's PR to the file.
At present this plugin fails on the new generation Apple machines with the Apple Silicon M1 (ARM) processor.
It appears to be trying to download
shfmt
but it doesn't have adarwin_arm
package available (see https://github.com/mvdan/sh/issues/642) thus breaking this plugin for M1 users.Error details:
https://github.com/mvdan/sh/releases