提交 e9d40e44 编写于 作者: M Martin Aeschlimann

Provide detailed argument error message on registerDefaultLanguageCommand

上级 f22b10e4
......@@ -134,13 +134,16 @@ export module CommonEditorRegistry {
registerLanguageCommand(id, function (accessor, args) {
const {resource, position} = args;
if (!(resource instanceof URI) || !Position.isIPosition(position)) {
throw illegalArgument();
if (!(resource instanceof URI)) {
throw illegalArgument('resource');
}
if (!Position.isIPosition(position)) {
throw illegalArgument('position');
}
const model = accessor.get(IModelService).getModel(resource);
if (!model) {
throw illegalArgument();
throw illegalArgument('Can not find open model for ' + resource);
}
const editorPosition = Position.lift(position);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册