prettier-language-server 0.0.1 → 0.0.2

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ var W=Object.create;var{getPrototypeOf:l,defineProperty:Q,getOwnPropertyNames:w}=Object;var E=Object.prototype.hasOwnProperty;var z=(b,v,i)=>{i=b!=null?W(l(b)):{};let j=v||!b||!b.__esModule?Q(i,"default",{value:b,enumerable:!0}):i;for(let A of w(b))if(!E.call(j,A))Q(j,A,{get:()=>b[A],enumerable:!0});return j};var I=(b,v)=>{for(var i in v)Q(b,i,{get:v[i],enumerable:!0,configurable:!0,set:(j)=>v[i]=()=>j})};var X=(b,v)=>()=>(b&&(v=b(b=0)),v);var Z="0.0.1";var Y=()=>{};var _={};I(_,{createConnection:()=>n});async function n(){let b=await import("node:path"),v=await import("prettier"),{URI:i}=await import("vscode-uri"),{TextDocument:j}=await import("vscode-languageserver-textdocument"),A=await import("vscode-languageserver/node.js"),K=new A.TextDocuments(j),B=A.createConnection(process.stdin,process.stdout);K.listen(B);let L,M,N;async function d(y){M??=await v.resolveConfigFile(y),N??=await v.resolveConfig(y,{editorconfig:!0,useCache:!1,...M&&{config:M}})}async function S(y){if(N)return N;return await v.resolveConfig(y,{editorconfig:!0,useCache:!0})}async function V(y,G,u){let q=i.parse(y).fsPath,s=await S(q);return await v.format(G,{...s,...u,filepath:q})}return B.onInitialize(async({workspaceFolders:y})=>{if(L=y?.[0],L)await d(b.join(i.parse(L.uri).fsPath,"_"));return{capabilities:{textDocumentSync:A.TextDocumentSyncKind.Incremental,documentFormattingProvider:!0,documentRangeFormattingProvider:!0}}}),B.onDocumentFormatting(async(y,G)=>{let u=K.get(y.textDocument.uri);if(!u)return null;let q=u.getText(),s={line:0,character:0},H=u.positionAt(q.length),J=A.Range.create(s,H),O=await V(u.uri,q);return[A.TextEdit.replace(J,O)]}),B.onDocumentRangeFormatting(async(y,G)=>{let u=K.get(y.textDocument.uri);if(!u)return null;let q=u.getText(),s=u.offsetAt(y.range.start),H=u.offsetAt(y.range.end),J=await V(u.uri,q,{rangeStart:s,rangeEnd:H}),O=J.slice(s,H+J.length-q.length);return[A.TextEdit.replace(y.range,O)]}),B}var F={};async function C(){let{parseArgs:b}=await import("node:util"),{createConnection:v}=await Promise.resolve().then(() => _),{values:i}=b({options:{version:{type:"boolean",short:"v"}},strict:!0,allowPositionals:!0});if(i.version)process.stdout.write(Z),process.exit(0);(await v()).listen()}var $=X(()=>{Y();C()});Promise.resolve().then(() => $());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prettier-language-server",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "engines": {
6
6
  "node": ">=13.2.0"
7
7
  },