diff --git a/playground/build b/playground/build index 8092c9d..861788c 100755 --- a/playground/build +++ b/playground/build @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash mkdir -p public echo copy newt -#cp ../lsp.js src/newt.js -(cd .. && make lsp) +(cd .. && make lsp.js) +cp ../lsp.js src/newt.js echo build newt worker esbuild src/worker.ts --bundle --format=esm --platform=browser > public/worker.js esbuild src/frame.ts --bundle --format=esm --platform=browser > public/frame.js diff --git a/playground/src/fs.ts b/playground/src/fs.ts new file mode 100644 index 0000000..0140062 --- /dev/null +++ b/playground/src/fs.ts @@ -0,0 +1,6 @@ +import {shim} from './emul'; + +// Shim was dumping stuff globally and we've shifted to imports, so I'm adapting it here for now. + +export const {readFileSync, writeFileSync, writeFile, writeSync, readSync } = shim.fs; +export default {readFileSync, writeFileSync, writeFile, writeSync, readSync }; diff --git a/playground/src/newt.d.ts b/playground/src/newt.d.ts new file mode 100644 index 0000000..a2166db --- /dev/null +++ b/playground/src/newt.d.ts @@ -0,0 +1,7 @@ +import { Diagnostic, HoverResult, CodeAction } from './ipc' + +export function LSP_updateFile(name: string, content: string): any; +export function LSP_checkFile(name: string): Diagnostic[]; +export function LSP_hoverInfo(name: string, row: number, col: number): HoverResult | boolean | null; +export function LSP_codeActionInfo(name: string, row: number, col: number): CodeAction[] | null; +export function LSP_compileJS(name: string): string;