glutinum-org / cli

https://glutinum.net/
59 stars 6 forks source link

Error generating types for VS Code #152

Open NatElkins opened 4 days ago

NatElkins commented 4 days ago

Running the following:

npx @glutinum/cli ./node_modules/@types/vscode/index.d.ts

Results in the following error:

Generating binding file for ./node_modules/@types/vscode/index.d.ts
/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:16488
  return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
                                                ^

TypeError: Cannot read properties of undefined (reading 'text')
    at getSourceTextOfNodeFromSourceFile (/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:16488:49)
    at getTextOfNode (/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:16516:10)
    at entityNameToString (/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:17285:56)
    at formatJSDocLink (/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:15171:28)
    at /Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:15167:138
    at Array.map (<anonymous>)
    at Object.getTextOfJSDocComment (/Users/nat/Projects/fable-vscode-bindings/node_modules/typescript/lib/typescript.js:15167:85)
    at file:///Users/nat/Projects/fable-vscode-bindings/node_modules/@glutinum/cli/dist/Glutinum.Converter/Reader/Documentation.js:110:70
    at file:///Users/nat/Projects/fable-vscode-bindings/node_modules/@glutinum/cli/dist/fable_modules/fable-library-js.4.14.0/Seq.js:378:20
    at Enumerator_FromFunctions$1.next (file:///Users/nat/Projects/fable-vscode-bindings/node_modules/@glutinum/cli/dist/fable_modules/fable-library-js.4.14.0/Seq.js:251:32)

Curiously when I paste it into the web tool it seems to work:

image