提交 0f458523 编写于 作者: A Alex Dima

Add helpful error messages to deprecated "auto" values in editor.tabSize and editor.insertSpaces

上级 1fa8bcdf
......@@ -106,7 +106,7 @@ export class ASTNode {
if ((<string[]>schema.type).indexOf(this.type) === -1) {
validationResult.warnings.push({
location: { start: this.start, end: this.end },
message: localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}', (<string[]>schema.type).join(', '))
message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}', (<string[]>schema.type).join(', '))
});
}
}
......@@ -114,7 +114,7 @@ export class ASTNode {
if (this.type !== schema.type) {
validationResult.warnings.push({
location: { start: this.start, end: this.end },
message: localize('typeMismatchWarning', 'Incorrect type. Expected "{0}"', schema.type)
message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected "{0}"', schema.type)
});
}
}
......
......@@ -752,12 +752,14 @@ configurationRegistry.registerConfiguration({
'type': 'number',
'default': DEFAULT_INDENTATION.tabSize,
'minimum': 1,
'description': nls.localize('tabSize', "The number of spaces a tab is equal to.")
'description': nls.localize('tabSize', "The number of spaces a tab is equal to."),
'errorMessage': nls.localize('tabSize.errorMessage', "Expected 'number'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
},
'editor.insertSpaces' : {
'type': 'boolean',
'default': DEFAULT_INDENTATION.insertSpaces,
'description': nls.localize('insertSpaces', "Insert spaces when pressing Tab.")
'description': nls.localize('insertSpaces', "Insert spaces when pressing Tab."),
'errorMessage': nls.localize('insertSpaces.errorMessage', "Expected 'boolean'. Note that the value \"auto\" has been replaced by the `editor.detectIndentation` setting.")
},
'editor.detectIndentation' : {
'type': 'boolean',
......
......@@ -105,7 +105,7 @@ export class ASTNode {
if (Arrays.contains(<string[]> schema.type, this.type) === false) {
validationResult.warnings.push({
location: { start: this.start, end: this.end },
message: nls.localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}', (<string[]> schema.type).join())
message: schema.errorMessage || nls.localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}', (<string[]> schema.type).join())
});
}
}
......@@ -113,7 +113,7 @@ export class ASTNode {
if (this.type !== schema.type) {
validationResult.warnings.push({
location: { start: this.start, end: this.end },
message: nls.localize('typeMismatchWarning', 'Incorrect type. Expected "{0}"', schema.type)
message: schema.errorMessage || nls.localize('typeMismatchWarning', 'Incorrect type. Expected "{0}"', schema.type)
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册