@influxdata/flux-lsp-cli
Advanced tools
Comparing version 0.3.3 to 0.4.0
let wasm; | ||
const { TextDecoder } = require(String.raw`util`); | ||
let cachegetInt32Memory = null; | ||
function getInt32Memory() { | ||
if (cachegetInt32Memory === null || cachegetInt32Memory.buffer !== wasm.memory.buffer) { | ||
cachegetInt32Memory = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachegetInt32Memory; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
@@ -16,29 +8,54 @@ | ||
let cachegetUint8Memory = null; | ||
function getUint8Memory() { | ||
if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { | ||
cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); | ||
let cachegetUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint8Memory; | ||
return cachegetUint8Memory0; | ||
} | ||
function getStringFromWasm(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); | ||
function getStringFromWasm0(ptr, len) { | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
const heap = new Array(32); | ||
heap.fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
let heap_next = heap.length; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let cachegetInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { | ||
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachegetInt32Memory0; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachegetNodeBufferMemory = null; | ||
function getNodeBufferMemory() { | ||
if (cachegetNodeBufferMemory === null || cachegetNodeBufferMemory.buffer !== wasm.memory.buffer) { | ||
cachegetNodeBufferMemory = Buffer.from(wasm.memory.buffer); | ||
let cachegetNodeBufferMemory0 = null; | ||
function getNodeBufferMemory0() { | ||
if (cachegetNodeBufferMemory0 === null || cachegetNodeBufferMemory0.buffer !== wasm.memory.buffer) { | ||
cachegetNodeBufferMemory0 = Buffer.from(wasm.memory.buffer); | ||
} | ||
return cachegetNodeBufferMemory; | ||
return cachegetNodeBufferMemory0; | ||
} | ||
function passStringToWasm(arg) { | ||
function passStringToWasm0(arg, malloc) { | ||
const len = Buffer.byteLength(arg); | ||
const ptr = wasm.__wbindgen_malloc(len); | ||
getNodeBufferMemory().write(arg, ptr, len); | ||
const ptr = malloc(len); | ||
getNodeBufferMemory0().write(arg, ptr, len); | ||
WASM_VECTOR_LEN = len; | ||
@@ -48,12 +65,4 @@ return ptr; | ||
const heap = new Array(32); | ||
heap.fill(undefined); | ||
heap.push(undefined, null, true, false); | ||
function getObject(idx) { return heap[idx]; } | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
@@ -75,14 +84,8 @@ if (idx < 36) return; | ||
module.exports.parse = function(s) { | ||
const ret = wasm.parse(passStringToWasm(s), WASM_VECTOR_LEN); | ||
var ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.parse(ptr0, len0); | ||
return takeObject(ret); | ||
}; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
/** | ||
@@ -122,3 +125,3 @@ */ | ||
constructor(disable_folding) { | ||
const ret = wasm.server_new(disable_folding); | ||
var ret = wasm.server_new(disable_folding); | ||
return Server.__wrap(ret); | ||
@@ -131,3 +134,5 @@ } | ||
process(msg) { | ||
const ret = wasm.server_process(this.ptr, passStringToWasm(msg), WASM_VECTOR_LEN); | ||
var ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.server_process(this.ptr, ptr0, len0); | ||
return ServerResponse.__wrap(ret); | ||
@@ -158,9 +163,9 @@ } | ||
get_message() { | ||
const retptr = 8; | ||
const ret = wasm.serverresponse_get_message(retptr, this.ptr); | ||
const memi32 = getInt32Memory(); | ||
wasm.serverresponse_get_message(8, this.ptr); | ||
var r0 = getInt32Memory0()[8 / 4 + 0]; | ||
var r1 = getInt32Memory0()[8 / 4 + 1]; | ||
let v0; | ||
if (memi32[retptr / 4 + 0] !== 0) { | ||
v0 = getStringFromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice(); | ||
wasm.__wbindgen_free(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 1); | ||
if (r0 !== 0) { | ||
v0 = getStringFromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
} | ||
@@ -173,9 +178,9 @@ return v0; | ||
get_error() { | ||
const retptr = 8; | ||
const ret = wasm.serverresponse_get_error(retptr, this.ptr); | ||
const memi32 = getInt32Memory(); | ||
wasm.serverresponse_get_error(8, this.ptr); | ||
var r0 = getInt32Memory0()[8 / 4 + 0]; | ||
var r1 = getInt32Memory0()[8 / 4 + 1]; | ||
let v0; | ||
if (memi32[retptr / 4 + 0] !== 0) { | ||
v0 = getStringFromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice(); | ||
wasm.__wbindgen_free(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 1); | ||
if (r0 !== 0) { | ||
v0 = getStringFromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
} | ||
@@ -188,3 +193,3 @@ return v0; | ||
module.exports.__wbindgen_json_parse = function(arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm(arg0, arg1)); | ||
var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
@@ -194,5 +199,5 @@ }; | ||
module.exports.__wbindgen_throw = function(arg0, arg1) { | ||
throw new Error(getStringFromWasm(arg0, arg1)); | ||
throw new Error(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
wasm = require('./flux-lsp-node_bg'); | ||
{ | ||
"name": "@influxdata/flux-lsp-cli", | ||
"version": "0.3.3", | ||
"version": "0.4.0", | ||
"description": "Flux cli LSP server", | ||
@@ -24,3 +24,3 @@ "repository": { | ||
"dependencies": { | ||
"@influxdata/flux-lsp-node": "^0.1.0", | ||
"@influxdata/flux-lsp-node": "^0.2.0", | ||
"yargs": "^15.0.2" | ||
@@ -27,0 +27,0 @@ }, |
@@ -71,2 +71,3 @@ #!/usr/bin/env node | ||
const input = `\n\n${JSON.stringify(data)}` | ||
log(`REQUEST: ${input}\n`) | ||
const resp = server.process(input) | ||
@@ -73,0 +74,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2172794
6227
+ Added@influxdata/flux-lsp-node@0.2.2(transitive)
- Removed@influxdata/flux-lsp-node@0.1.0(transitive)