Skip to content

Commit

Permalink
Inlined filenames and bodies.
Browse files Browse the repository at this point in the history
  • Loading branch information
SCWells72 committed Dec 10, 2024
1 parent 724841b commit 11fdfb2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public TypeScriptCodeBlockProviderTest() {
}

public void testCodeBlocks() {
String testFilename = "demo.ts";

// language=json
String mockFoldingRangesJson = """
[
Expand All @@ -40,7 +38,7 @@ public void testCodeBlocks() {
""";

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo {
demo() {<start>
Expand All @@ -52,7 +50,7 @@ export class Demo {
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo {<start>
<caret>demo() {
Expand All @@ -64,7 +62,7 @@ export class Demo {<start>
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo {<caret><start>
demo() {
Expand All @@ -76,7 +74,7 @@ export class Demo {<caret><start>
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo <caret>{<start>
demo() {
Expand All @@ -88,7 +86,7 @@ export class Demo <caret>{<start>
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo {<start>
demo() {
Expand All @@ -100,7 +98,7 @@ export class Demo {<start>
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class Demo {<start>
demo() {
Expand All @@ -112,7 +110,7 @@ export class Demo {<start>
);

assertCodeBlock(
testFilename,
"demo.ts",
"""
export class <caret><start><end>Demo {
demo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@
*/
public class TypeScriptSelectionRangeTest extends LSPSelectionRangeFixtureTestCase {

private static final String DEMO_TS_FILE_NAME = "demo.ts";
// language=typescript
private static final String DEMO_TS_FILE_BODY = "console.log('message');";

public TypeScriptSelectionRangeTest() {
super("*.ts");
}

public void testSelectionRanges_qualifierExpression() {
assertSelectionRanges(
DEMO_TS_FILE_NAME,
DEMO_TS_FILE_BODY,
"demo.ts",
// language=typescript
"console.log('message');",
// Start on the qualifier
"console",
// language=json
Expand Down Expand Up @@ -94,8 +91,9 @@ public void testSelectionRanges_qualifierExpression() {

public void testSelectionRanges_callExpression() {
assertSelectionRanges(
DEMO_TS_FILE_NAME,
DEMO_TS_FILE_BODY,
"demo.ts",
// language=typescript
"console.log('message');",
// Start at the call to log
"log",
// language=json
Expand Down Expand Up @@ -160,8 +158,9 @@ public void testSelectionRanges_callExpression() {

public void testSelectionRanges_stringLiteral() {
assertSelectionRanges(
DEMO_TS_FILE_NAME,
DEMO_TS_FILE_BODY,
"demo.ts",
// language=typescript
"console.log('message');",
// Start in the string literal
"message",
// language=json
Expand Down

0 comments on commit 11fdfb2

Please sign in to comment.