Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejected rename promise results in empty message box #37808

Closed
dbaeumer opened this issue Nov 8, 2017 · 4 comments
Closed

Rejected rename promise results in empty message box #37808

dbaeumer opened this issue Nov 8, 2017 · 4 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Nov 8, 2017

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"
    }
}
  • open plain text file
  • execute rename
  • you get an empty message box.

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

@jrieken
Copy link
Member

jrieken commented Nov 8, 2017

That only works when rejecting the promise with a string not with an Error or other types...

@jrieken jrieken added api bug Issue identified by VS Code Team member as probable bug labels Nov 8, 2017
@jrieken jrieken added this to the November 2017 milestone Nov 8, 2017
@dbaeumer
Copy link
Member Author

dbaeumer commented Nov 8, 2017

I tested the string case as well and it produced the same result.

@jrieken
Copy link
Member

jrieken commented Nov 8, 2017

I tested the string case as well and it produced the same result.

Sure about that? TypeScript is implemented and shipping like that and works well with insiders

@jrieken jrieken closed this as completed in 04fc390 Nov 8, 2017
@dbaeumer
Copy link
Member Author

dbaeumer commented Nov 8, 2017

I tested it and it didn't work. I was using the latest insider on latest Electron. This crashed on my so I went back and now the strings case is working.

@Tyriar @bpasero FYI. There seems to be more broken with the new Electron build.

@roblourens roblourens added the verified Verification succeeded label Dec 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants