A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/vscode/issues/37808 below:

Rejected rename promise results in empty message box · Issue #37808 · microsoft/vscode · GitHub

Extension code:

'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
	vscode.languages.registerRenameProvider('plaintext', {
		provideRenameEdits: () => {
			return Promise.reject(new Error('Only locals can be renamed'));
		}
	});
}

// this method is called when your extension is deactivated
export function deactivate() {
}

package.json

{
    "name": "rename",
    "displayName": "rename",
    "description": "",
    "version": "0.0.1",
    "publisher": "MS",
    "engines": {
        "vscode": "^1.17.0"
    },
    "categories": [
        "Other"
    ],
    "activationEvents": [
        "onLanguage:plaintext"
    ],
    "main": "./out/extension",
    "contributes": {
        "commands": [{
            "command": "extension.sayHello",
            "title": "Hello World"
        }]
    },
    "scripts": {
        "vscode:prepublish": "npm run compile",
        "compile": "tsc -p ./",
        "watch": "tsc -watch -p ./",
        "postinstall": "node ./node_modules/vscode/bin/install",
        "test": "npm run compile && node ./node_modules/vscode/bin/test"
    },
    "devDependencies": {
        "typescript": "^2.5.3",
        "vscode": "^1.1.5",
        "@types/node": "^7.0.43",
        "@types/mocha": "^2.2.42"
    }
}

I would expect the message that I pass in the Error of the rejected promise.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4