Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/languageservice/services/yamlCodeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class YamlCodeActions {
const textBuff = new TextBuffer(document);
const processedLine: number[] = [];
for (const diag of diagnostics) {
if (diag.message === 'Using tabs can lead to unpredictable results') {
if (diag.message === 'Tabs are not allowed as indentation') {
if (processedLine.includes(diag.range.start.line)) {
continue;
}
Expand Down
10 changes: 5 additions & 5 deletions test/yamlCodeActions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('CodeActions Tests', () => {
describe('Convert TAB to Spaces', () => {
it('should add "Convert TAB to Spaces" CodeAction', () => {
const doc = setupTextDocument('foo:\n\t- bar');
const diagnostics = [createExpectedError('Using tabs can lead to unpredictable results', 1, 0, 1, 1, 1, JSON_SCHEMA_LOCAL)];
const diagnostics = [createExpectedError('Tabs are not allowed as indentation', 1, 0, 1, 1, 1, JSON_SCHEMA_LOCAL)];
const params: CodeActionParams = {
context: CodeActionContext.create(diagnostics),
range: undefined,
Expand All @@ -123,7 +123,7 @@ describe('CodeActions Tests', () => {

it('should support current indentation chars settings', () => {
const doc = setupTextDocument('foo:\n\t- bar');
const diagnostics = [createExpectedError('Using tabs can lead to unpredictable results', 1, 0, 1, 1, 1, JSON_SCHEMA_LOCAL)];
const diagnostics = [createExpectedError('Tabs are not allowed as indentation', 1, 0, 1, 1, 1, JSON_SCHEMA_LOCAL)];
const params: CodeActionParams = {
context: CodeActionContext.create(diagnostics),
range: undefined,
Expand All @@ -139,7 +139,7 @@ describe('CodeActions Tests', () => {

it('should provide "Convert all Tabs to Spaces"', () => {
const doc = setupTextDocument('foo:\n\t\t\t- bar\n\t\t');
const diagnostics = [createExpectedError('Using tabs can lead to unpredictable results', 1, 0, 1, 3, 1, JSON_SCHEMA_LOCAL)];
const diagnostics = [createExpectedError('Tabs are not allowed as indentation', 1, 0, 1, 3, 1, JSON_SCHEMA_LOCAL)];
const params: CodeActionParams = {
context: CodeActionContext.create(diagnostics),
range: undefined,
Expand Down Expand Up @@ -188,8 +188,8 @@ describe('CodeActions Tests', () => {

describe('Convert to Block Style', () => {
it(' should generate action to convert flow map to block map ', () => {
const yaml = `host: phl-42
datacenter: {location: canada , cab: 15}
const yaml = `host: phl-42
datacenter: {location: canada , cab: 15}
animals: [dog , cat , mouse] `;
const doc = setupTextDocument(yaml);
const diagnostics = [
Expand Down