Home > OS >  vscode: Using the proposed API cannot find "https://raw.githubusercontent.com/microsoft/vscode/
vscode: Using the proposed API cannot find "https://raw.githubusercontent.com/microsoft/vscode/

Time:11-29

I'm trying to use registerInlineCompletionItemProvider proposed API. I'm following the instructions in https://code.visualstudio.com/updates/v1_58 and here https://github.com/microsoft/vscode-extension-samples/tree/main/inline-completions. Both of them ask to copy https://raw.githubusercontent.com/microsoft/vscode/master/src/vs/vscode.proposed.d.ts to your local directory, but that file doesn't exist. Also when I follow the instructions to install the extension I always get an error because it doesn't exist:

Downloading vscode.proposed.d.ts
To:   /home/gussand/vscode-extension-samples/inline-completions/vscode.proposed.d.ts
From: https://raw.githubusercontent.com/microsoft/vscode/master/src/vs/vscode.proposed.d.ts
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Failed to g./package.json:         "download-api": "vscode-dts dev",
./package.json:         "postdownload-api": "vscode-dts main", 

anyone have ideas how to solve this?

thanks!

CodePudding user response:

You need https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.inlineCompletions.d.ts.

The file was split up 13 days ago in a4d426a, tracked in #131165.

Apparently not all docs have been updated.

CodePudding user response:

In response to the question about how to modify the postinstall script for the new proposed api's, I'll post this here since it doesn't fit in a comment. See proposed-api-sample

"scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "lint": "eslint . --ext .ts,.tsx",
    "watch": "tsc -watch -p ./",
    "download-api": "vscode-dts dev",
    "postdownload-api": "vscode-dts main",
    "postinstall": "npm run download-api"
},
  • Related