astro-vscode 2.16.9-beta.0 → 2.16.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +11 -1
- package/dist/node/server.js +2 -2
- package/package.json +4 -4
- package/test/grammar/test.mjs +1 -1
- package/tsconfig.json +3 -2
- package/dist/.vscode-test.d.ts +0 -2
- /package/dist/{src/client.d.ts → client.d.ts} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> astro-vscode@2.16.9
|
|
2
|
+
> astro-vscode@2.16.9 build /home/runner/work/astro/astro/packages/language-tools/vscode
|
|
3
3
|
> tsc && pnpm prebuild && node scripts/build.mjs -- --minify
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> astro-vscode@2.16.9
|
|
6
|
+
> astro-vscode@2.16.9 prebuild /home/runner/work/astro/astro/packages/language-tools/vscode
|
|
7
7
|
> cd ../ts-plugin && pnpm build
|
|
8
8
|
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# astro-vscode
|
|
2
2
|
|
|
3
|
+
## 2.16.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fix "Find All References" and other TypeScript features by ensuring the plugin bundle is correctly included
|
|
8
|
+
|
|
9
|
+
- [#15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes syntax highlighting sometimes not working when the frontmatter or script tags ended with certain TypeScript constructs
|
|
10
|
+
|
|
11
|
+
- [#15496](https://github.com/withastro/astro/pull/15496) [`eb7cdda`](https://github.com/withastro/astro/commit/eb7cdda6837a8b28e279f668d0fe2a06f02f6990) Thanks [@matthewp](https://github.com/matthewp)! - Fix syntax highlighting for lowercase component tags that start with "style" or "script".
|
|
12
|
+
|
|
3
13
|
## 2.16.9-beta.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -831,7 +841,7 @@ In the background, this update means that we now have to maintain a lot less cod
|
|
|
831
841
|
|
|
832
842
|
### Patch Changes
|
|
833
843
|
|
|
834
|
-
- c4f7a36: Trying
|
|
844
|
+
- c4f7a36: Trying desperately to figure deployment out
|
|
835
845
|
|
|
836
846
|
## 0.26.0
|
|
837
847
|
|
package/dist/node/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var a0e=Object.create;var F0=Object.defineProperty;var l0e=Object.getOwnPropertyDescriptor;var c0e=Object.getOwnPropertyNames;var u0e=Object.getPrototypeOf,d0e=Object.prototype.hasOwnProperty;var we=(t,e)=>()=>(t&&(e=t(t=0)),e);var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Na=(t,e)=>{for(var n in e)F0(t,n,{get:e[n],enumerable:!0})},t8=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c0e(e))!d0e.call(t,i)&&i!==n&&F0(t,i,{get:()=>e[i],enumerable:!(r=l0e(e,i))||r.enumerable});return t};var Nr=(t,e,n)=>(n=t!=null?a0e(u0e(t)):{},t8(e||!t||!t.__esModule?F0(n,"default",{value:t,enumerable:!0}):n,t)),rr=t=>t8(F0({},"__esModule",{value:!0}),t);var n8=P((Krt,h0e)=>{h0e.exports={name:"@astrojs/language-server",version:"2.16.1-beta.1",author:"withastro",license:"MIT",repository:{type:"git",url:"https://github.com/withastro/astro.git",directory:"packages/language-tools/language-server"},type:"commonjs",main:"dist/index.js",files:["bin","dist/**/*.js","dist/**/*.d.ts","types/**/*.d.ts"],bin:{"astro-ls":"./bin/nodeServer.js"},scripts:{build:"tsc",dev:"tsc --watch",test:'astro-scripts test "**/*.test.ts" --teardown-test ./test/misc/teardown.ts --tsx true --setup ./test/setup.js',"test:match":"pnpm run test --match"},dependencies:{"@astrojs/compiler":"^2.13.1","@astrojs/yaml2ts":"^0.2.2","@jridgewell/sourcemap-codec":"^1.5.5","@volar/kit":"~2.4.28","@volar/language-core":"~2.4.28","@volar/language-server":"~2.4.28","@volar/language-service":"~2.4.28","muggle-string":"^0.4.1",tinyglobby:"^0.2.15","volar-service-css":"0.0.68","volar-service-emmet":"0.0.68","volar-service-html":"0.0.68","volar-service-prettier":"0.0.68","volar-service-typescript":"0.0.68","volar-service-typescript-twoslash-queries":"0.0.68","volar-service-yaml":"0.0.68","vscode-html-languageservice":"^5.6.1","vscode-uri":"^3.1.0"},devDependencies:{"@types/node":"^20.9.0","@volar/test-utils":"~2.4.28","@volar/typescript":"~2.4.28",tsx:"^4.21.0",typescript:"^5.9.3","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","astro-scripts":"workspace:*"},peerDependencies:{prettier:"^3.0.0","prettier-plugin-astro":">=0.11.0"},peerDependenciesMeta:{prettier:{optional:!0},"prettier-plugin-astro":{optional:!0}}}});var T0=P(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.thenable=xr.typedArray=xr.stringArray=xr.array=xr.func=xr.error=xr.number=xr.string=xr.boolean=void 0;function f0e(t){return t===!0||t===!1}xr.boolean=f0e;function r8(t){return typeof t=="string"||t instanceof String}xr.string=r8;function p0e(t){return typeof t=="number"||t instanceof Number}xr.number=p0e;function m0e(t){return t instanceof Error}xr.error=m0e;function i8(t){return typeof t=="function"}xr.func=i8;function s8(t){return Array.isArray(t)}xr.array=s8;function g0e(t){return s8(t)&&t.every(e=>r8(e))}xr.stringArray=g0e;function b0e(t,e){return Array.isArray(t)&&t.every(e)}xr.typedArray=b0e;function y0e(t){return t&&i8(t.then)}xr.thenable=y0e});var Ff=P(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.stringArray=wi.array=wi.func=wi.error=wi.number=wi.string=wi.boolean=void 0;function v0e(t){return t===!0||t===!1}wi.boolean=v0e;function o8(t){return typeof t=="string"||t instanceof String}wi.string=o8;function w0e(t){return typeof t=="number"||t instanceof Number}wi.number=w0e;function _0e(t){return t instanceof Error}wi.error=_0e;function S0e(t){return typeof t=="function"}wi.func=S0e;function a8(t){return Array.isArray(t)}wi.array=a8;function C0e(t){return a8(t)&&t.every(e=>o8(e))}wi.stringArray=C0e});var KT=P(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.Message=Be.NotificationType9=Be.NotificationType8=Be.NotificationType7=Be.NotificationType6=Be.NotificationType5=Be.NotificationType4=Be.NotificationType3=Be.NotificationType2=Be.NotificationType1=Be.NotificationType0=Be.NotificationType=Be.RequestType9=Be.RequestType8=Be.RequestType7=Be.RequestType6=Be.RequestType5=Be.RequestType4=Be.RequestType3=Be.RequestType2=Be.RequestType1=Be.RequestType=Be.RequestType0=Be.AbstractMessageSignature=Be.ParameterStructures=Be.ResponseError=Be.ErrorCodes=void 0;var Bd=Ff(),xT;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(xT||(Be.ErrorCodes=xT={}));var Wg=class extends Error{constructor(e,n,r){super(n),this.code=Bd.number(e)?e:xT.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Wg.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Be.ResponseError=Wg;var Vr=class{constructor(e){this.kind=e}static is(e){return e===Vr.auto||e===Vr.byName||e===Vr.byPosition}toString(){return this.kind}};Be.ParameterStructures=Vr;Vr.auto=new Vr("auto");Vr.byPosition=new Vr("byPosition");Vr.byName=new Vr("byName");var qn=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Vr.auto}};Be.AbstractMessageSignature=qn;var kT=class extends qn{constructor(e){super(e,0)}};Be.RequestType0=kT;var AT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.RequestType=AT;var FT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.RequestType1=FT;var TT=class extends qn{constructor(e){super(e,2)}};Be.RequestType2=TT;var ET=class extends qn{constructor(e){super(e,3)}};Be.RequestType3=ET;var MT=class extends qn{constructor(e){super(e,4)}};Be.RequestType4=MT;var DT=class extends qn{constructor(e){super(e,5)}};Be.RequestType5=DT;var IT=class extends qn{constructor(e){super(e,6)}};Be.RequestType6=IT;var RT=class extends qn{constructor(e){super(e,7)}};Be.RequestType7=RT;var PT=class extends qn{constructor(e){super(e,8)}};Be.RequestType8=PT;var OT=class extends qn{constructor(e){super(e,9)}};Be.RequestType9=OT;var NT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.NotificationType=NT;var LT=class extends qn{constructor(e){super(e,0)}};Be.NotificationType0=LT;var qT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.NotificationType1=qT;var zT=class extends qn{constructor(e){super(e,2)}};Be.NotificationType2=zT;var $T=class extends qn{constructor(e){super(e,3)}};Be.NotificationType3=$T;var jT=class extends qn{constructor(e){super(e,4)}};Be.NotificationType4=jT;var WT=class extends qn{constructor(e){super(e,5)}};Be.NotificationType5=WT;var UT=class extends qn{constructor(e){super(e,6)}};Be.NotificationType6=UT;var BT=class extends qn{constructor(e){super(e,7)}};Be.NotificationType7=BT;var HT=class extends qn{constructor(e){super(e,8)}};Be.NotificationType8=HT;var VT=class extends qn{constructor(e){super(e,9)}};Be.NotificationType9=VT;var l8;(function(t){function e(i){let s=i;return s&&Bd.string(s.method)&&(Bd.string(s.id)||Bd.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Bd.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Bd.string(s.id)||Bd.number(s.id)||s.id===null)}t.isResponse=r})(l8||(Be.Message=l8={}))});var JT=P(Xc=>{"use strict";var c8;Object.defineProperty(Xc,"__esModule",{value:!0});Xc.LRUCache=Xc.LinkedMap=Xc.Touch=void 0;var _i;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(_i||(Xc.Touch=_i={}));var E0=class{constructor(){this[c8]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=_i.None){let r=this._map.get(e);if(r)return n!==_i.None&&this.touch(r,n),r.value}set(e,n,r=_i.None){let i=this._map.get(e);if(i)i.value=n,r!==_i.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case _i.None:this.addItemLast(i);break;case _i.First:this.addItemFirst(i);break;case _i.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(c8=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==_i.First&&n!==_i.Last)){if(n===_i.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===_i.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Xc.LinkedMap=E0;var GT=class extends E0{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=_i.AsNew){return super.get(e,n)}peek(e){return super.get(e,_i.None)}set(e,n){return super.set(e,n,_i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Xc.LRUCache=GT});var d8=P(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.Disposable=void 0;var u8;(function(t){function e(n){return{dispose:n}}t.create=e})(u8||(M0.Disposable=u8={}))});var Zc=P(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var YT;function QT(){if(YT===void 0)throw new Error("No runtime abstraction layer installed");return YT}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");YT=n}t.install=e})(QT||(QT={}));XT.default=QT});var Mf=P(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.Emitter=Ef.Event=void 0;var x0e=Zc(),h8;(function(t){let e={dispose(){}};t.None=function(){return e}})(h8||(Ef.Event=h8={}));var ZT=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,x0e.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Tf=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new ZT),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=Tf._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ef.Emitter=Tf;Tf._noop=function(){}});var R0=P(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.CancellationTokenSource=Df.CancellationToken=void 0;var k0e=Zc(),A0e=Ff(),eE=Mf(),D0;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eE.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:eE.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||A0e.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(D0||(Df.CancellationToken=D0={}));var F0e=Object.freeze(function(t,e){let n=(0,k0e.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),I0=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?F0e:(this._emitter||(this._emitter=new eE.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},tE=class{get token(){return this._token||(this._token=new I0),this._token}cancel(){this._token?this._token.cancel():this._token=D0.Cancelled}dispose(){this._token?this._token instanceof I0&&this._token.dispose():this._token=D0.None}};Df.CancellationTokenSource=tE});var f8=P(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.SharedArrayReceiverStrategy=If.SharedArraySenderStrategy=void 0;var T0e=R0(),Ug;(function(t){t.Continue=0,t.Cancelled=1})(Ug||(Ug={}));var nE=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ug.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Ug.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};If.SharedArraySenderStrategy=nE;var rE=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ug.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},iE=class{constructor(e){this.token=new rE(e)}cancel(){}dispose(){}},sE=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new T0e.CancellationTokenSource:new iE(n)}};If.SharedArrayReceiverStrategy=sE});var aE=P(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.Semaphore=void 0;var E0e=Zc(),oE=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,E0e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};P0.Semaphore=oE});var m8=P(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.ReadableStreamMessageReader=eu.AbstractMessageReader=eu.MessageReader=void 0;var cE=Zc(),Rf=Ff(),lE=Mf(),M0e=aE(),p8;(function(t){function e(n){let r=n;return r&&Rf.func(r.listen)&&Rf.func(r.dispose)&&Rf.func(r.onError)&&Rf.func(r.onClose)&&Rf.func(r.onPartialMessage)}t.is=e})(p8||(eu.MessageReader=p8={}));var O0=class{constructor(){this.errorEmitter=new lE.Emitter,this.closeEmitter=new lE.Emitter,this.partialMessageEmitter=new lE.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Rf.string(e.message)?e.message:"unknown"}`)}};eu.AbstractMessageReader=O0;var uE;(function(t){function e(n){let r,i,s,o=new Map,a,l=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,l.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,cE.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:l}}t.fromOptions=e})(uE||(uE={}));var dE=class extends O0{constructor(e,n){super(),this.readable=e,this.options=uE.fromOptions(n),this.buffer=(0,cE.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new M0e.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
2
|
+
var a0e=Object.create;var F0=Object.defineProperty;var l0e=Object.getOwnPropertyDescriptor;var c0e=Object.getOwnPropertyNames;var u0e=Object.getPrototypeOf,d0e=Object.prototype.hasOwnProperty;var we=(t,e)=>()=>(t&&(e=t(t=0)),e);var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Na=(t,e)=>{for(var n in e)F0(t,n,{get:e[n],enumerable:!0})},t8=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c0e(e))!d0e.call(t,i)&&i!==n&&F0(t,i,{get:()=>e[i],enumerable:!(r=l0e(e,i))||r.enumerable});return t};var Nr=(t,e,n)=>(n=t!=null?a0e(u0e(t)):{},t8(e||!t||!t.__esModule?F0(n,"default",{value:t,enumerable:!0}):n,t)),rr=t=>t8(F0({},"__esModule",{value:!0}),t);var n8=P((Krt,h0e)=>{h0e.exports={name:"@astrojs/language-server",version:"2.16.1",author:"withastro",license:"MIT",repository:{type:"git",url:"git+https://github.com/withastro/astro.git",directory:"packages/language-tools/language-server"},type:"commonjs",main:"dist/index.js",files:["bin","dist/**/*.js","dist/**/*.d.ts","types/**/*.d.ts"],bin:{"astro-ls":"./bin/nodeServer.js"},scripts:{build:"tsc",dev:"tsc --watch",test:'astro-scripts test "**/*.test.ts" --teardown-test ./test/misc/teardown.ts --tsx true --setup ./test/setup.js',"test:match":"pnpm run test --match"},dependencies:{"@astrojs/compiler":"^2.13.1","@astrojs/yaml2ts":"^0.2.2","@jridgewell/sourcemap-codec":"^1.5.5","@volar/kit":"~2.4.28","@volar/language-core":"~2.4.28","@volar/language-server":"~2.4.28","@volar/language-service":"~2.4.28","muggle-string":"^0.4.1",tinyglobby:"^0.2.15","volar-service-css":"0.0.68","volar-service-emmet":"0.0.68","volar-service-html":"0.0.68","volar-service-prettier":"0.0.68","volar-service-typescript":"0.0.68","volar-service-typescript-twoslash-queries":"0.0.68","volar-service-yaml":"0.0.68","vscode-html-languageservice":"^5.6.1","vscode-uri":"^3.1.0"},devDependencies:{"@types/node":"^20.9.0","@volar/test-utils":"~2.4.28","@volar/typescript":"~2.4.28",tsx:"^4.21.0",typescript:"^5.9.3","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","astro-scripts":"workspace:*"},peerDependencies:{prettier:"^3.0.0","prettier-plugin-astro":">=0.11.0"},peerDependenciesMeta:{prettier:{optional:!0},"prettier-plugin-astro":{optional:!0}}}});var T0=P(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.thenable=xr.typedArray=xr.stringArray=xr.array=xr.func=xr.error=xr.number=xr.string=xr.boolean=void 0;function f0e(t){return t===!0||t===!1}xr.boolean=f0e;function r8(t){return typeof t=="string"||t instanceof String}xr.string=r8;function p0e(t){return typeof t=="number"||t instanceof Number}xr.number=p0e;function m0e(t){return t instanceof Error}xr.error=m0e;function i8(t){return typeof t=="function"}xr.func=i8;function s8(t){return Array.isArray(t)}xr.array=s8;function g0e(t){return s8(t)&&t.every(e=>r8(e))}xr.stringArray=g0e;function b0e(t,e){return Array.isArray(t)&&t.every(e)}xr.typedArray=b0e;function y0e(t){return t&&i8(t.then)}xr.thenable=y0e});var Ff=P(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.stringArray=wi.array=wi.func=wi.error=wi.number=wi.string=wi.boolean=void 0;function v0e(t){return t===!0||t===!1}wi.boolean=v0e;function o8(t){return typeof t=="string"||t instanceof String}wi.string=o8;function w0e(t){return typeof t=="number"||t instanceof Number}wi.number=w0e;function _0e(t){return t instanceof Error}wi.error=_0e;function S0e(t){return typeof t=="function"}wi.func=S0e;function a8(t){return Array.isArray(t)}wi.array=a8;function C0e(t){return a8(t)&&t.every(e=>o8(e))}wi.stringArray=C0e});var KT=P(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.Message=Be.NotificationType9=Be.NotificationType8=Be.NotificationType7=Be.NotificationType6=Be.NotificationType5=Be.NotificationType4=Be.NotificationType3=Be.NotificationType2=Be.NotificationType1=Be.NotificationType0=Be.NotificationType=Be.RequestType9=Be.RequestType8=Be.RequestType7=Be.RequestType6=Be.RequestType5=Be.RequestType4=Be.RequestType3=Be.RequestType2=Be.RequestType1=Be.RequestType=Be.RequestType0=Be.AbstractMessageSignature=Be.ParameterStructures=Be.ResponseError=Be.ErrorCodes=void 0;var Bd=Ff(),xT;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(xT||(Be.ErrorCodes=xT={}));var Wg=class extends Error{constructor(e,n,r){super(n),this.code=Bd.number(e)?e:xT.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,Wg.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Be.ResponseError=Wg;var Vr=class{constructor(e){this.kind=e}static is(e){return e===Vr.auto||e===Vr.byName||e===Vr.byPosition}toString(){return this.kind}};Be.ParameterStructures=Vr;Vr.auto=new Vr("auto");Vr.byPosition=new Vr("byPosition");Vr.byName=new Vr("byName");var qn=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return Vr.auto}};Be.AbstractMessageSignature=qn;var kT=class extends qn{constructor(e){super(e,0)}};Be.RequestType0=kT;var AT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.RequestType=AT;var FT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.RequestType1=FT;var TT=class extends qn{constructor(e){super(e,2)}};Be.RequestType2=TT;var ET=class extends qn{constructor(e){super(e,3)}};Be.RequestType3=ET;var MT=class extends qn{constructor(e){super(e,4)}};Be.RequestType4=MT;var DT=class extends qn{constructor(e){super(e,5)}};Be.RequestType5=DT;var IT=class extends qn{constructor(e){super(e,6)}};Be.RequestType6=IT;var RT=class extends qn{constructor(e){super(e,7)}};Be.RequestType7=RT;var PT=class extends qn{constructor(e){super(e,8)}};Be.RequestType8=PT;var OT=class extends qn{constructor(e){super(e,9)}};Be.RequestType9=OT;var NT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.NotificationType=NT;var LT=class extends qn{constructor(e){super(e,0)}};Be.NotificationType0=LT;var qT=class extends qn{constructor(e,n=Vr.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Be.NotificationType1=qT;var zT=class extends qn{constructor(e){super(e,2)}};Be.NotificationType2=zT;var $T=class extends qn{constructor(e){super(e,3)}};Be.NotificationType3=$T;var jT=class extends qn{constructor(e){super(e,4)}};Be.NotificationType4=jT;var WT=class extends qn{constructor(e){super(e,5)}};Be.NotificationType5=WT;var UT=class extends qn{constructor(e){super(e,6)}};Be.NotificationType6=UT;var BT=class extends qn{constructor(e){super(e,7)}};Be.NotificationType7=BT;var HT=class extends qn{constructor(e){super(e,8)}};Be.NotificationType8=HT;var VT=class extends qn{constructor(e){super(e,9)}};Be.NotificationType9=VT;var l8;(function(t){function e(i){let s=i;return s&&Bd.string(s.method)&&(Bd.string(s.id)||Bd.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Bd.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Bd.string(s.id)||Bd.number(s.id)||s.id===null)}t.isResponse=r})(l8||(Be.Message=l8={}))});var JT=P(Xc=>{"use strict";var c8;Object.defineProperty(Xc,"__esModule",{value:!0});Xc.LRUCache=Xc.LinkedMap=Xc.Touch=void 0;var _i;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(_i||(Xc.Touch=_i={}));var E0=class{constructor(){this[c8]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=_i.None){let r=this._map.get(e);if(r)return n!==_i.None&&this.touch(r,n),r.value}set(e,n,r=_i.None){let i=this._map.get(e);if(i)i.value=n,r!==_i.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case _i.None:this.addItemLast(i);break;case _i.First:this.addItemFirst(i);break;case _i.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(c8=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==_i.First&&n!==_i.Last)){if(n===_i.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===_i.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};Xc.LinkedMap=E0;var GT=class extends E0{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=_i.AsNew){return super.get(e,n)}peek(e){return super.get(e,_i.None)}set(e,n){return super.set(e,n,_i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Xc.LRUCache=GT});var d8=P(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.Disposable=void 0;var u8;(function(t){function e(n){return{dispose:n}}t.create=e})(u8||(M0.Disposable=u8={}))});var Zc=P(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var YT;function QT(){if(YT===void 0)throw new Error("No runtime abstraction layer installed");return YT}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");YT=n}t.install=e})(QT||(QT={}));XT.default=QT});var Mf=P(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.Emitter=Ef.Event=void 0;var x0e=Zc(),h8;(function(t){let e={dispose(){}};t.None=function(){return e}})(h8||(Ef.Event=h8={}));var ZT=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,x0e.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Tf=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new ZT),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=Tf._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ef.Emitter=Tf;Tf._noop=function(){}});var R0=P(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.CancellationTokenSource=Df.CancellationToken=void 0;var k0e=Zc(),A0e=Ff(),eE=Mf(),D0;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eE.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:eE.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||A0e.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(D0||(Df.CancellationToken=D0={}));var F0e=Object.freeze(function(t,e){let n=(0,k0e.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),I0=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?F0e:(this._emitter||(this._emitter=new eE.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},tE=class{get token(){return this._token||(this._token=new I0),this._token}cancel(){this._token?this._token.cancel():this._token=D0.Cancelled}dispose(){this._token?this._token instanceof I0&&this._token.dispose():this._token=D0.None}};Df.CancellationTokenSource=tE});var f8=P(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.SharedArrayReceiverStrategy=If.SharedArraySenderStrategy=void 0;var T0e=R0(),Ug;(function(t){t.Continue=0,t.Cancelled=1})(Ug||(Ug={}));var nE=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ug.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,Ug.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};If.SharedArraySenderStrategy=nE;var rE=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ug.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},iE=class{constructor(e){this.token=new rE(e)}cancel(){}dispose(){}},sE=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new T0e.CancellationTokenSource:new iE(n)}};If.SharedArrayReceiverStrategy=sE});var aE=P(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.Semaphore=void 0;var E0e=Zc(),oE=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,E0e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};P0.Semaphore=oE});var m8=P(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.ReadableStreamMessageReader=eu.AbstractMessageReader=eu.MessageReader=void 0;var cE=Zc(),Rf=Ff(),lE=Mf(),M0e=aE(),p8;(function(t){function e(n){let r=n;return r&&Rf.func(r.listen)&&Rf.func(r.dispose)&&Rf.func(r.onError)&&Rf.func(r.onClose)&&Rf.func(r.onPartialMessage)}t.is=e})(p8||(eu.MessageReader=p8={}));var O0=class{constructor(){this.errorEmitter=new lE.Emitter,this.closeEmitter=new lE.Emitter,this.partialMessageEmitter=new lE.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Rf.string(e.message)?e.message:"unknown"}`)}};eu.AbstractMessageReader=O0;var uE;(function(t){function e(n){let r,i,s,o=new Map,a,l=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,l.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,cE.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:l}}t.fromOptions=e})(uE||(uE={}));var dE=class extends O0{constructor(e,n){super(),this.readable=e,this.options=uE.fromOptions(n),this.buffer=(0,cE.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new M0e.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
3
|
${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,cE.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};eu.ReadableStreamMessageReader=dE});var w8=P(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.WriteableStreamMessageWriter=tu.AbstractMessageWriter=tu.MessageWriter=void 0;var g8=Zc(),Bg=Ff(),D0e=aE(),b8=Mf(),I0e="Content-Length: ",y8=`\r
|
|
4
4
|
`,v8;(function(t){function e(n){let r=n;return r&&Bg.func(r.dispose)&&Bg.func(r.onClose)&&Bg.func(r.onError)&&Bg.func(r.write)}t.is=e})(v8||(tu.MessageWriter=v8={}));var N0=class{constructor(){this.errorEmitter=new b8.Emitter,this.closeEmitter=new b8.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Bg.string(e.message)?e.message:"unknown"}`)}};tu.AbstractMessageWriter=N0;var hE;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,g8.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,g8.default)().applicationJson.encoder}}t.fromOptions=e})(hE||(hE={}));var fE=class extends N0{constructor(e,n){super(),this.writable=e,this.options=hE.fromOptions(n),this.errorCount=0,this.writeSemaphore=new D0e.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(I0e,r.byteLength.toString(),y8),i.push(y8),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};tu.WriteableStreamMessageWriter=fE});var _8=P(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});L0.AbstractMessageBuffer=void 0;var R0e=13,P0e=10,O0e=`\r
|
|
5
5
|
`,pE=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,s=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];i=0;t:for(;i<c.length;){switch(c[i]){case R0e:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case P0e:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=c.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,l=this.toString(o,"ascii").split(O0e);if(l.length<2)return a;for(let c=0;c<l.length-2;c++){let u=l[c],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
|
|
@@ -838,7 +838,7 @@ Client directives are only available on framework components.`}:t}function zUe(t
|
|
|
838
838
|
$1
|
|
839
839
|
return [];
|
|
840
840
|
}) satisfies GetStaticPaths;`,additionalTextEdits:[Ix.TextEdit.insert(e,`import type { GetStaticPaths } from "astro";
|
|
841
|
-
`)],filterText:"getstaticpaths",insertTextFormat:2},{label:"prerender",kind:Ix.CompletionItemKind.Snippet,labelDetails:{description:"Add prerender export"},documentation:{kind:"markdown",value:["Add prerender export. When [using server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/#enabling-on-demand-rendering), this value will be used to determine whether to prerender the page
|
|
841
|
+
`)],filterText:"getstaticpaths",insertTextFormat:2},{label:"prerender",kind:Ix.CompletionItemKind.Snippet,labelDetails:{description:"Add prerender export"},documentation:{kind:"markdown",value:["Add prerender export. When [using server-side rendering](https://docs.astro.build/en/guides/on-demand-rendering/#enabling-on-demand-rendering), this value will be used to determine whether or not to prerender the page.",`
|
|
842
842
|
`,"[Astro reference](https://docs.astro.build/en/reference/routing-reference/#prerender)"].join(`
|
|
843
843
|
`)},insertText:"export const prerender = ${1|true,false|}",insertTextFormat:2}]}});var Loe=P(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:!0});Rx.create=void 0;var GUe=Qe(),JUe=oc(),Noe=ny(),YUe=Ooe(),QUe=()=>({capabilities:{completionProvider:{resolveProvider:!0}},create(t){return{isAdditionalCompletion:!0,transformCompletionItem(e){return e},provideCompletionItems(e,n,r,i){if(!t||!Noe.isJSDocument||i.isCancellationRequested||r.triggerKind===2)return null;let s=t.decodeEmbeddedDocumentUri(GUe.URI.parse(e.uri)),a=(s&&t.language.scripts.get(s[0]))?.generated?.root;if(!(a instanceof JUe.AstroVirtualCode))return;if(!(0,Noe.isInsideFrontmatter)(e.offsetAt(n),a.astroMeta.frontmatter))return null;let l={items:[],isIncomplete:!1};return l.items.push(...(0,YUe.getSnippetCompletions)(a.astroMeta.frontmatter)),l},resolveCompletionItem(e){return e}}}});Rx.create=QUe});function qh(t,e=!1){let n=t.length,r=0,i="",s=0,o=16,a=0,l=0,c=0,u=0,d=0;function f(v,A){let F=0,I=0;for(;F<v||!A;){let k=t.charCodeAt(r);if(k>=48&&k<=57)I=I*16+k-48;else if(k>=65&&k<=70)I=I*16+k-65+10;else if(k>=97&&k<=102)I=I*16+k-97+10;else break;r++,F++}return F<v&&(I=-1),I}function m(v){r=v,i="",s=0,o=16,d=0}function b(){let v=r;if(t.charCodeAt(r)===48)r++;else for(r++;r<t.length&&Lm(t.charCodeAt(r));)r++;if(r<t.length&&t.charCodeAt(r)===46)if(r++,r<t.length&&Lm(t.charCodeAt(r)))for(r++;r<t.length&&Lm(t.charCodeAt(r));)r++;else return d=3,t.substring(v,r);let A=r;if(r<t.length&&(t.charCodeAt(r)===69||t.charCodeAt(r)===101))if(r++,(r<t.length&&t.charCodeAt(r)===43||t.charCodeAt(r)===45)&&r++,r<t.length&&Lm(t.charCodeAt(r))){for(r++;r<t.length&&Lm(t.charCodeAt(r));)r++;A=r}else d=3;return t.substring(v,A)}function g(){let v="",A=r;for(;;){if(r>=n){v+=t.substring(A,r),d=2;break}let F=t.charCodeAt(r);if(F===34){v+=t.substring(A,r),r++;break}if(F===92){if(v+=t.substring(A,r),r++,r>=n){d=2;break}switch(t.charCodeAt(r++)){case 34:v+='"';break;case 92:v+="\\";break;case 47:v+="/";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+=`
|
|
844
844
|
`;break;case 114:v+="\r";break;case 116:v+=" ";break;case 117:let k=f(4,!0);k>=0?v+=String.fromCharCode(k):d=4;break;default:d=5}A=r;continue}if(F>=0&&F<=31)if(av(F)){v+=t.substring(A,r),d=2;break}else d=6;r++}return v}function w(){if(i="",d=0,s=r,l=a,u=c,r>=n)return s=n,o=17;let v=t.charCodeAt(r);if(pL(v)){do r++,i+=String.fromCharCode(v),v=t.charCodeAt(r);while(pL(v));return o=15}if(av(v))return r++,i+=String.fromCharCode(v),v===13&&t.charCodeAt(r)===10&&(r++,i+=`
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"color": "#17191E",
|
|
25
25
|
"theme": "dark"
|
|
26
26
|
},
|
|
27
|
-
"version": "2.16.9
|
|
27
|
+
"version": "2.16.9",
|
|
28
28
|
"author": "withastro",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"publisher": "astro-build",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"main": "./dist/node/client.js",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/withastro/astro.git",
|
|
40
|
+
"url": "git+https://github.com/withastro/astro.git",
|
|
41
41
|
"directory": "packages/language-tools/vscode"
|
|
42
42
|
},
|
|
43
43
|
"contributes": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"command": "astro.selectTypescriptVersion",
|
|
68
|
-
"title": "Astro: Select
|
|
68
|
+
"title": "Astro: Select TypeScript Version..."
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"command": "astro.openTsConfig",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
]
|
|
237
237
|
},
|
|
238
238
|
"devDependencies": {
|
|
239
|
-
"@astrojs/language-server": "^2.16.1
|
|
239
|
+
"@astrojs/language-server": "^2.16.1",
|
|
240
240
|
"@astrojs/ts-plugin": "^1.10.6",
|
|
241
241
|
"@types/mocha": "^10.0.10",
|
|
242
242
|
"@types/node": "^20.9.0",
|
package/test/grammar/test.mjs
CHANGED
|
@@ -42,7 +42,7 @@ async function snapShotTest() {
|
|
|
42
42
|
'-s',
|
|
43
43
|
'source.astro',
|
|
44
44
|
'./test/grammar/fixtures/**/*.astro',
|
|
45
|
-
...allGrammars.
|
|
45
|
+
...allGrammars.flatMap((path) => ['-g', path]),
|
|
46
46
|
...extraArgs,
|
|
47
47
|
].map((arg) => (isWindows && arg.includes(' ') ? `"${arg}"` : arg));
|
|
48
48
|
|
package/tsconfig.json
CHANGED
package/dist/.vscode-test.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _exports: ((import("@vscode/test-cli").IConfigurationWithGlobalOptions | import("@vscode/test-cli").TestConfiguration | import("@vscode/test-cli").TestConfiguration[]) | Promise<import("@vscode/test-cli").IConfigurationWithGlobalOptions | import("@vscode/test-cli").TestConfiguration | import("@vscode/test-cli").TestConfiguration[]>) | (() => (import("@vscode/test-cli").IConfigurationWithGlobalOptions | import("@vscode/test-cli").TestConfiguration | import("@vscode/test-cli").TestConfiguration[]) | Promise<import("@vscode/test-cli").IConfigurationWithGlobalOptions | import("@vscode/test-cli").TestConfiguration | import("@vscode/test-cli").TestConfiguration[]>);
|
|
2
|
-
export = _exports;
|
|
File without changes
|