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/grammar/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ export class FontInfo implements IFontInfo {
public startIndex: number,
public endIndex: number,
public fontFamily: string | null,
public fontSize: string | null,
public fontSize: number | null,
public lineHeight: number | null
) { }

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export interface IFontInfo {
/**
* Font size specification
*/
readonly fontSize: string | null;
readonly fontSize: number | null;

/**
* Line height specification
Expand Down
12 changes: 6 additions & 6 deletions src/tests/grammar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ test('Fonts are correctly set', async function () {
scope: 'bar.test',
settings: {
fontFamily: 'monospace',
fontSize: '12px',
lineHeight: 20
fontSize: 1.2,
lineHeight: 3
}
}]
});
Expand All @@ -163,7 +163,7 @@ test('Fonts are correctly set', async function () {
]
});
const result = grammar.tokenizeLine2('bar hello', null, undefined);
assert.deepStrictEqual(result.fonts, [new FontInfo(0, 3, "monospace", "12px", 20)]);
assert.deepStrictEqual(result.fonts, [new FontInfo(0, 3, "monospace", 1.2, 3)]);
} finally {
registry.dispose();
}
Expand All @@ -177,8 +177,8 @@ test('Fonts are correctly set 2', async function () {
scope: 'entity.name.function.ts',
settings: {
fontFamily: 'Times New Roman',
fontSize: '20px',
lineHeight: 40
fontSize: 1.3,
lineHeight: 3
}
}]
});
Expand All @@ -190,7 +190,7 @@ test('Fonts are correctly set 2', async function () {
]
});
const result = grammar.tokenizeLine2('function g() {}', null, undefined);
assert.deepStrictEqual(result.fonts, [new FontInfo(9, 10, 'Times New Roman', "20px", 40)]);
assert.deepStrictEqual(result.fonts, [new FontInfo(9, 10, 'Times New Roman', 1.3, 3)]);
} finally {
registry.dispose();
}
Expand Down
Loading