Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2718539

Browse filesBrowse files
committed
Added more test cases for highlighting abstract keyword
1 parent fc47329 commit 2718539
Copy full SHA for 2718539

2 files changed

+33-2Lines changed: 33 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎…ases/fourslash/getOccurrencesAbstract.ts‎ ‎…es/fourslash/getOccurrencesAbstract01.ts‎tests/cases/fourslash/getOccurrencesAbstract.ts renamed to tests/cases/fourslash/getOccurrencesAbstract01.ts tests/cases/fourslash/getOccurrencesAbstract.ts renamed to tests/cases/fourslash/getOccurrencesAbstract01.ts

Copy file name to clipboardExpand all lines: tests/cases/fourslash/getOccurrencesAbstract01.ts
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/// <reference path='fourslash.ts' />
22

33
////[|abstract|] class Animal {
4+
//// [|abstract|] prop1; // Does not compile
5+
//// [|abstract|] abstract();
46
//// [|abstract|] walk(): void;
57
//// [|abstract|] makeSound(): void;
68
////}
@@ -12,11 +14,11 @@
1214

1315
const ranges = test.ranges();
1416

15-
for(let r of ranges) {
17+
for (let r of ranges) {
1618
goTo.position(r.start);
1719
verify.occurrencesAtPositionCount(ranges.length);
1820

19-
for(let range of ranges) {
21+
for (let range of ranges) {
2022
verify.occurrencesAtPositionContains(range, false);
2123
}
2224
}
Collapse file
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////// Not valid TS (abstract methods can only appear in abstract classes)
4+
////class Animal {
5+
//// [|abstract|] walk(): void;
6+
//// [|abstract|] makeSound(): void;
7+
////}
8+
////// abstract cannot appear here, won't get highlighted
9+
////let c = /*1*/abstract class Foo {
10+
//// /*2*/abstract foo(): void;
11+
//// abstract bar(): void;
12+
////}
13+
14+
const ranges = test.ranges();
15+
16+
for (let r of ranges) {
17+
goTo.position(r.start);
18+
verify.occurrencesAtPositionCount(ranges.length);
19+
20+
for (let range of ranges) {
21+
verify.occurrencesAtPositionContains(range, false);
22+
}
23+
}
24+
25+
goTo.marker("1");
26+
verify.occurrencesAtPositionCount(0);
27+
28+
goTo.marker("2");
29+
verify.occurrencesAtPositionCount(2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.