Open TurboCooler opened 1 year ago
Same for me. Any resolution?
Works with macOS Intel, Linux x64
Same for me. Not working on windows 11. On Linux is OK
I'm also on Windows getting this error. Any chance of getting this to run on Windows, seeing as it appears to be NodeJS that generally could work on Windows?
Describe the bug
I have a SQL file with a .pgsql extension. I click on the file to view it and the language server crashes
Expected Behavior
Should work without crashing
Current Behavior
Extension crashes
Steps to Reproduce
Environment
Error: node-loader: Error: c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\fd51af29867b810570dc552fae6adee4.node is not a valid Win32 application.
c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\fd51af29867b810570dc552fae6adee4.node at 5375 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:1:143) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 2737 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:13179) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 3630 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:1:13410) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 5844 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:30:598) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 1245 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:24:2048) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) [Info - 5:43:16 PM] Connection to server got closed. Server will restart. c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:1 (()=>{var e={5375:(e,t,n)=>{e=n.nmd(e);try{process.dlopen(e,dirname+n(1017).sep+n.p+"fd51af29867b810570dc552fae6adee4.node")}catch(e){throw new Error("node-loader:\n"+e)}},9262:(e,t)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.FILE_QUERY_COMMAND=void 0,t.FILE_QUERY_COMMAND={title:"PL/pgSQL: Execute the Current File Query",name:"plpgsql-lsp.executeFileQuery",execute:async function(e,t,n){const r=await e.connect();try{await r.query(t.getText())}catch(e){throw n.error(e.message),e}finally{await r.release()}}}},5409:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.COMMAND_TITLE_MAP=t.COMMAND_NAMES=t.COMMANDS=void 0;const r=n(9262);t.COMMANDS=[r.FILE_QUERY_COMMAND],t.COMMAND_NAMES=t.COMMANDS.map((e=>e.name)),t.COMMAND_TITLE_MAP=Object.fromEntries(t.COMMANDS.map((e=>[e.name,e.title])))},2241:(e,t)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.ExecuteFileQueryCommandDisabledError=t.CannotExecuteCommandWithQueryParametersError=t.WrongCommandArgumentsError=t.CommandNotFoundError=t.PostgresPoolNotFoundError=t.DisableLanguageServerError=t.NotCoveredFileError=t.NeverReachError=t.PlpgsqlLanguageServerError=void 0;class n extends Error{get name(){return this.constructor.name}}t.PlpgsqlLanguageServerError=n,t.NeverReachError=class extends n{},t.NotCoveredFileError=class extends n{constructor(){super("This file is not covered by Language Server.")}},t.DisableLanguageServerError=class extends n{constructor(){super("Disable Language Server.")}},t.PostgresPoolNotFoundError=class extends n{constructor(){super("PostgresPool not found.")}},t.CommandNotFoundError=class extends n{constructor(e){super(
Command '${e}' not found
)}},t.WrongCommandArgumentsError=class extends n{constructor(){super("Arguments of the command are wrong.")}},t.CannotExecuteCommandWithQueryParametersError=class extends n{constructor(){super("Cannot execute the command with query parameters.")}},t.ExecuteFileQueryCommandDisabledError=class extends n{constructor(){super('"enableExecuteFileQueryCommand" is false.')}}},9699:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.getPool=void 0;var r=n(6421);Object.defineProperty(t,"getPool",{enumerable:!0,get:function(){return r.getPool}})},854:(e,t)=>{"use strict";var n;Object.defineProperty(t,"esModule",{value:!0}),t.PostgresKind=void 0,(n=t.PostgresKind||(t.PostgresKind={}))[n.Schema=0]="Schema",n[n.Table=1]="Table",n[n.View=2]="View",n[n.MaterializedView=3]="MaterializedView",n[n.Type=4]="Type",n[n.Domain=5]="Domain",n[n.Index=6]="Index",n[n.Function=7]="Function",n[n.Trigger=8]="Trigger"},5256:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.sanitizeFileWithDefaultQueryParameters=t.getDefaultQueryParameterInfo=void 0;const r=n(3902),i=n(8906),o=n(6652);t.getDefaultQueryParameterInfo=function(e,t,n){const r=(0,i.getFirstLine)(e);for(const n of[/^ -- +plpgsql-language-server:use-query-parameter $/,/^ \/* +plpgsql-language-server:use-query-parameter +\\/$/])if(null!==r.match(n)){const n=new RegExp(t,"g");return{type:"default",queryParameters:Array.from(new Set([...(0,i.getTextAfterFirstLine)(e).matchAll(n)].map((e=>e[0])))),queryParameterPattern:t}}return null},t.sanitizeFileWithDefaultQueryParameters=function(e,t,n){const i=new Set(t.queryParameters);for(const[t,n]of Array.from(i.values()).entries())e=e.replace(new RegExp((0,r.escapeRegex)(n),"g"),(0,o.makePositionalParamter)(t,n));return[e,i.size]}},6652:(e,t)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.makePositionalParamter=void 0,t.makePositionalParamter=function(e,t){let n=$${e+1}
;return n+=" ".repeat(Math.max(0,t.length-n.length)),n}},284:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.sanitizeFileWithQueryParameters=t.getQueryParameterInfo=void 0;const r=n(5809),i=n(3471),o=n(8906),s=n(5256),a=n(3554),c=n(1339);t.getQueryParameterInfo=function(e,t,n){let i;if(i=(0,s.getDefaultQueryParameterInfo)(e,t.queryParameterPattern,n),null!==i)return i;if(i=(0,c.getPositionalQueryParameterInfo)(e,n),null!==i)return i;try{i=(0,a.getKeywordQueryParameterInfo)(e,t.keywordQueryParameterPattern,n)}catch(t){if(t instanceof a.KeywordQueryParameterPatternNotDefinedError)return{severity:r.DiagnosticSeverity.Error,range:(0,o.getTextAllRange)(e),message:t.message}}return null!==i?i:null},t.sanitizeFileWithQueryParameters=function(e,t,n){if(null===t)return[e,0];{const r=t.type;switch(r){case"default":return(0,s.sanitizeFileWithDefaultQueryParameters)(e,t,n);case"position":return(0,c.sanitizeFileWithPositionalQueryParameters)(e,t,n);case"keyword":return(0,a.sanitizeFileWithKeywordQueryParameters)(e,t,n);default:{const e=r;(0,i.neverReach)("${e}" is unknown "queryParameterInfo.type".
)}}}}},3554:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.sanitizeFileWithKeywordQueryParameters=t.getKeywordQueryParameterInfo=t.KeywordQueryParameterPatternNotDefinedError=void 0;const r=n(3902),i=n(8906),o=n(6652);class s extends Error{constructor(){super("'plpgsqlLanguageServer.keywordQueryParameterPattern' does not set in the settings."),this.name="KeywordQueryParameterPatternNotDefinedError"}}t.KeywordQueryParameterPatternNotDefinedError=s,t.getKeywordQueryParameterInfo=function(e,t,n){const r=(0,i.getFirstLine)(e);for(const n of[/^ -- +plpgsql-language-server:use-keyword-query-parameter( +keywords=[ ([A-Za-z][A-Za-z0-9])?((, ([A-Za-z][A-Za-z0-9]))),? ])? $/,/^ \/* +plpgsql-language-server:use-keyword-query-parameter( +keywords=[ ([A-Za-z][A-Za-z0-9])?((, ([A-Za-z][A-Za-z0-9]))),? ])? +*\/$/]){const o=r.match(n);if(null!==o){if(void 0===t)throw new s;let n=[];const r=o[2],a=o[3];if(void 0!==r)n.push(t.replace("{keyword}",r)),""!==a&&a.split(",").map((e=>e.trim())).filter((e=>""!==e)).forEach((e=>{n.push(t.replace("{keyword}",e))}));else{const r=new RegExp(t.replace("{keyword}","[A-Za-z][A-Za-z0-9]"),"g");n=Array.from(new Set([...(0,i.getTextAfterFirstLine)(e).matchAll(r)].map((e=>e[0]))))}return{type:"keyword",keywordParameters:n,keywordQueryParameterPattern:t}}}return null},t.sanitizeFileWithKeywordQueryParameters=function(e,t,n){const i=new Set(t.keywordParameters);for(const[t,n]of Array.from(i.values()).entries())e=e.replace(new RegExp((0,r.escapeRegex)(n),"g"),(0,o.makePositionalParamter)(t,n));return[e,i.size]}},1339:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.sanitizeFileWithPositionalQueryParameters=t.getPositionalQueryParameterInfo=void 0;const r=n(8906);t.getPositionalQueryParameterInfo=function(e,t){const n=(0,r.getFirstLine)(e);for(const t of[/^ -- +plpgsql-language-server:use-positional-query-parameter( +number=[1-9][0-9])? $/,/^ \/* +plpgsql-language-server:use-positional-query-parameter( +number=[1-9][0-9])? +*\/$/]){const r=n.match(t);if(null!==r){const t=r[1];if(void 0!==t)return{type:"position",parameterNumber:Number(t.replace(/^ +number=/,""))};{const t=new Set([...e.getText().matchAll(/(\$[1-9][0-9])/g)].map((e=>e[0])));return{type:"position",parameterNumber:t.size}}}}return null},t.sanitizeFileWithPositionalQueryParameters=function(e,t,n){return[e,t.parameterNumber]}},3469:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.parseMaterializedViewCreateStatements=t.parseTriggerCreateStatements=t.parseIndexCreateStatements=t.parseFunctionCreateStatements=t.parseDomainCreateStatements=t.parseTypeCreateStatements=t.parseViewCreateStatements=t.parseTableCreateStatements=t.parseCreateStatements=void 0;const r=n(854),i=n(8906);function o(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateStmt;if(void 0===s)return[];const a=s.relation.schemaname,c=s.relation.relname,u=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Table,schema:a,name:c,targetRange:(0,i.getRangeFromBuffer)(e,u,u+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,s.relation.location,s.relation.location+(void 0!==a?(a+".").length:0)+c.length)}]}function s(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.ViewStmt;if(void 0===s)return[];const a=s.view.schemaname,c=s.view.relname,u=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.View,schema:a,name:c,targetRange:(0,i.getRangeFromBuffer)(e,u,u+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,s.view.location,s.view.location+(void 0!==a?(a+".").length:0)+c.length)}]}function a(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CompositeTypeStmt;if(void 0===s)return[];const a=s.typevar.relname,c=s.typevar.schemaname,u=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Type,schema:c,name:a,targetRange:(0,i.getRangeFromBuffer)(e,u,u+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,s.typevar.location,s.typevar.location+a.length)}]}function c(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateDomainStmt;if(void 0===s)return[];let a,c;const u=s.domainname.filter((e=>"String"in e)).map((e=>e.String.str));if(1===u.length)c=u[0];else{if(2!==u.length)return[];a=u[0],c=u[1]}const l=u.join("."),d=(0,i.findIndexFromBuffer)(e,l,t.stmt_location),h=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Domain,schema:a,name:c,targetRange:(0,i.getRangeFromBuffer)(e,h,h+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,d,d+l.length)}]}function u(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateFunctionStmt;if(void 0===s)return[];let a,c;const u=s.funcname.filter((e=>"String"in e)).map((e=>e.String.str));if(1===u.length)c=u[0];else{if(2!==u.length)return[];a=u[0],c=u[1]}const l=u.join("."),d=(0,i.findIndexFromBuffer)(e,l,t.stmt_location),h=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Function,schema:a,name:c,targetRange:(0,i.getRangeFromBuffer)(e,h,h+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,d,d+l.length)}]}function l(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.IndexStmt;if(void 0===s)return[];const a=s.idxname,c=(0,i.findIndexFromBuffer)(e,a,t.stmt_location),u=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Index,schema:void 0,name:a,targetRange:(0,i.getRangeFromBuffer)(e,u,u+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,c,c+a.length)}]}function d(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateTrigStmt;if(void 0===s)return[];const a=s.trigname,c=(0,i.findIndexFromBuffer)(e,a,t.stmt_location),u=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.Trigger,schema:void 0,name:a,targetRange:(0,i.getRangeFromBuffer)(e,u,u+t.stmt_len),targetSelectionRange:(0,i.getRangeFromBuffer)(e,c,c+a.length)}]}function h(e,t){var n,o;const s=null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateTableAsStmt;if(void 0===s)return[];const a=s.into.rel.schemaname,c=s.into.rel.relname,u=(0,i.findIndexFromBuffer)(e,c,t.stmt_location),l=null!==(o=t.stmt_location)&&void 0!==o?o:0;return[{kind:r.PostgresKind.MaterializedView,schema:a,name:c,targetRange:(0,i.getRangeFromBuffer)(e,l,l+t.stmtlen),targetSelectionRange:(0,i.getRangeFromBuffer)(e,u,u+c.length)}]}t.parseCreateStatements=function(e,t){return t.flatMap((t=>{var n,r,i,f,p,m,g,y,v,;return void 0!==(null===(n=null==t?void 0:t.stmt)||void 0===n?void 0:n.CreateStmt)?o(e,t):void 0!==(null===(r=null==t?void 0:t.stmt)||void 0===r?void 0:r.ViewStmt)?s(e,t):void 0!==(null===(i=null==t?void 0:t.stmt)||void 0===i?void 0:i.CompositeTypeStmt)?a(e,t):void 0!==(null===(f=null==t?void 0:t.stmt)||void 0===f?void 0:f.CreateDomainStmt)?c(e,t):void 0!==(null===(p=null==t?void 0:t.stmt)||void 0===p?void 0:p.CreateFunctionStmt)?u(e,t):void 0!==(null===(m=null==t?void 0:t.stmt)||void 0===m?void 0:m.CreateTrigStmt)?d(e,t):void 0!==(null===(g=null==t?void 0:t.stmt)||void 0===g?void 0:g.IndexStmt)?l(e,t):void 0!==(null===(y=null==t?void 0:t.stmt)||void 0===y?void 0:y.CreateTableAsStmt)&&"OBJECTMATVIEW"===(null===(=null===(v=null==t?void 0:t.stmt)||void 0===v?void 0:v.CreateTableAsStmt)||void 0===?void 0:.relkind)?h(e,t):[]}))},t.parseTableCreateStatements=o,t.parseViewCreateStatements=s,t.parseTypeCreateStatements=a,t.parseDomainCreateStatements=c,t.parseFunctionCreateStatements=u,t.parseIndexCreateStatements=l,t.parseTriggerCreateStatements=d,t.parseMaterializedViewCreateStatements=h},9162:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.parseFunctions=void 0;const r=n(284),i=n(3630),o=n(8906);t.parseFunctions=async function(e,t,n){const s=await(0,o.readFileFromUri)(e);if(null===s)return[];const[a]=(0,r.sanitizeFileWithQueryParameters)(s,t,n),c=await(0,i.parseStmtements)(e,a,n);return void 0===c?[]:c.flatMap((e=>{var t;return void 0!==(null===(t=null==e?void 0:e.stmt)||void 0===t?void 0:t.CreateFunctionStmt)?function(e){var t;const n=null===(t=null==e?void 0:e.stmt)||void 0===t?void 0:t.CreateFunctionStmt;return void 0===n?[]:n.funcname.flatMap((e=>{var t;const r=e.String.str;if(void 0===r)return[];const i=n.options.filter((e=>"as"===e.DefElem.defname)).map((e=>e.DefElem.location));return[{functionName:r,location:null!==(t=null==i?void 0:i[0])&&void 0!==t?t:void 0}]}))}(e):[]}))}},3630:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.parseStmtements=void 0;const r=n(2737);t.parseStmtements=async function(e,t,n){var i;try{return null===(i=await(0,r.parseQuery)(t))||void 0===i?void 0:i.stmts}catch(t){const r=t.message;return void n.error(The "${e}" cannot parse. ${r}
)}}},6421:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.getPool=void 0;const r=n(8955);t.getPool=async function(e,t,n){if(void 0===t.database||void 0===t.user||void 0===t.password)return;const i={host:t.host,port:t.port,database:t.database,user:t.user,password:t.password};let o=e.get(i);if(void 0===o){try{o=new r.Pool(i),await o.query("SELECT 1")}catch(e){return void n.error(e.message)}e.set(i,o)}return o}},2706:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.makeDomainDefinitionText=t.queryDomainDefinitions=void 0;const r=n(7219);t.queryDomainDefinitions=async function(e,t,n,i,o){let s=[];const a=await e.connect();try{s=(await a.query("\n SELECT\n nspname AS schema,\n pg_type.typname AS domain_name,\n base_type.typname AS base_type_name\n FROM\n pg_catalog.pg_type AS pg_type\n JOIN pg_catalog.pg_namespace ON\n pg_namespace.oid = pg_type.typnamespace\n INNER JOIN pg_catalog.pg_type base_type ON\n pg_type.typtype = 'd'\n AND base_type.oid = pg_type.typbasetype\n WHERE\n nspname::text = ANY($1)\n AND $2::text IS NULL OR pg_type.typname = $2::text\n ",[(0,r.makeSchemas)(t,i),null==n?void 0:n.toLowerCase()])).rows.map((e=>({schema:e.schema,domainName:e.domain_name,baseTypeName:e.base_type_name})))}catch(e){o.error(${e.message}
)}finally{a.release()}return s},t.makeDomainDefinitionText=function(e){const{schema:t,domainName:n,baseTypeName:r}=e;returnDOMAIN ${t}.${n} AS ${r}
}},502:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryFileStaticAnalysis=void 0;const r=n(284),i=n(8906);t.queryFileStaticAnalysis=async function(e,t,n,o,s){const a=[],[c,u]=(0,r.sanitizeFileWithQueryParameters)(t.getText(),o.queryParameterInfo,s),l=await e.connect();try{if(await l.query("BEGIN"),await l.query(c,Array(u).fill(null)),0===(await l.query("\n SELECT\n extname\n FROM\n pg_extension\n WHERE\n extname = 'plpgsql_check'\n ")).rowCount)return[];for(const{functionName:e,location:r}of n){const n=(await l.query('\n SELECT\n (pcf).functionid::regprocedure AS procedure,\n (pcf).lineno AS lineno,\n (pcf).statement AS statement,\n (pcf).sqlstate AS sqlstate,\n (pcf).message AS message,\n (pcf).detail AS detail,\n (pcf).hint AS hint,\n (pcf).level AS level,\n (pcf)."position" AS position,\n (pcf).query AS query,\n (pcf).context AS context\n FROM\n plpgsql_check_function_tb($1) AS pcf\n ',[e])).rows;0!==n.length&&n.forEach((e=>{var n;let o;o=void 0===r?(0,i.getTextAllRange)(t):null!==(n=(0,i.getLineRangeFromBuffer)(c,r,e.lineno?e.lineno-1:0))&&void 0!==n?n:(0,i.getTextAllRange)(t),a.push({level:e.level,range:o,message:e.message})}))}}catch(e){o.isComplete&&s.error(StaticAnalysisError: ${e.message}
)}finally{await l.query("ROLLBACK"),l.release()}return a}},3531:(e,t,n)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.queryFileSyntaxAnalysis=void 0;const r=n(8955),i=n(5809),o=n(284),s=n(8906);t.queryFileSyntaxAnalysis=async function(e,t,n,a){var c;const u=[],[l,d]=(0,o.sanitizeFileWithQueryParameters)(t.getText(),n.queryParameterInfo,a),h=await e.connect();try{await h.query("BEGIN"),await h.query(l,Array(d).fill(null))}catch(e){const o=e,d=o.message;let h;if(n.isComplete&&a.error(SyntaxError code: ${null!==(c=o.code)&&void 0!==c?c:"unknown"}, ${e}
),e instanceof r.DatabaseError&&void 0!==e.position){const t=Number(e.position),n=l.slice(0,t).split("\n");h=i.Range.create(n.length-1,(0,s.getNonSpaceCharacter)(n[n.length-1]),n.length-1,n[n.length-1].length)}else h=(0,s.getTextAllRange)(t);u.push({range:h,message:d})}finally{await h.query("ROLLBACK"),h.release()}return u}},2887:function(e,t,n){"use strict";var r=this&&this.importDefault||function(e){return e&&e.esModule?e:{default:e}};Object.defineProperty(t,"esModule",{value:!0}),t.makeInsertFunctionText=t.makeFunctionDefinitionText=t.queryFunctionDefinitions=void 0;const i=r(n(9986)),o=n(7219);t.queryFunctionDefinitions=async function(e,t,n,r,i){let s=[];const a=await e.connect();try{s=(await a.query("\n SELECT\n ns.nspname AS schema,\n p.proname AS function_name,\n string_to_array(\n pg_get_function_arguments(p.oid),\n ', '\n ) as arguments,\n string_to_array(\n pg_get_function_identity_arguments(p.oid),\n ', '\n ) as identity_arguments,\n p.proretset AS is_setof,\n t.typname AS return_type,\n l.lanname AS language_name,\n CASE p.provolatile\n WHEN 'i' THEN\n 'IMMUTABLE'\n WHEN 's' THEN\n 'STABLE'\n WHEN 'v' THEN\n 'VOLATILE'\n ELSE\n NULL\n END AS volatile,\n CASE p.proparallel\n WHEN 's' THEN\n 'PARALLEL SAFE'\n WHEN 'r' THEN\n 'PARALLEL RESTRICTED'\n WHEN 'u' THEN\n 'PARALLEL UNSAFE'\n ELSE\n NULL\n END AS parallel\n FROM\n pg_proc p\n INNER JOIN pg_namespace ns ON\n p.pronamespace = ns.oid\n AND ns.nspname = ANY($1)\n AND ($2::text IS NULL OR p.proname = $2::text)\n INNER JOIN pg_type t ON\n p.prorettype = t.oid\n INNER JOIN pg_language l ON\n p.prolang = l.oid\n ORDER BY\n ns.nspname,\n p.proname\n ",[(0,o.makeSchemas)(t,r),null==n?void 0:n.toLowerCase()])).rows.map((e=>({schema:e.schema,functionName:e.function_name,functionArgs:e.arguments,functionIdentityArgs:e.identity_arguments,isSetOf:e.is_setof,returnType:e.return_type,languageName:e.language_name,volatile:e.volatile,parallel:e.parallel})))}catch(e){i.error(${e.message}
)}finally{a.release()}return s},t.makeFunctionDefinitionText=function(e){const{schema:t,functionName:n,functionArgs:r,returnType:o,isSetOf:s,languageName:a,volatile:c,parallel:u}=e;let l="";return r.length>0&&(l=\n ${r.join(",\n ")}\n
),i.default` ^Error: node-loader: Error: c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\fd51af29867b810570dc552fae6adee4.node is not a valid Win32 application.
c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\fd51af29867b810570dc552fae6adee4.node at 5375 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:1:143) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 2737 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:13179) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 3630 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:1:13410) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 5844 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:30:598) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) at 1245 (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:24:2048) at n (c:\Users\winuser.vscode\extensions\uniquevision.vscode-plpgsql-lsp-2.7.2-win32-x64\server\out\server.js:42:233748) [Error - 5:43:16 PM] Connection to server got closed. Server will not be restarted.