mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Addressing PR comments and adding unit tests
This commit is contained in:
parent
7fcbb8c9a0
commit
049b8fb2d0
@ -1,14 +1,14 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////[|/*
|
||||
//// Comment before module:
|
||||
//// Block comment at the beginning of the file before module:
|
||||
//// line one of the comment
|
||||
//// line two of the comment
|
||||
//// line three
|
||||
//// line four
|
||||
//// line five
|
||||
////*/|]
|
||||
////module Sayings [|{
|
||||
////module Sayings[| {
|
||||
//// [|/*
|
||||
//// Comment before class:
|
||||
//// line one of the comment
|
||||
@ -17,7 +17,7 @@
|
||||
//// line four
|
||||
//// line five
|
||||
//// */|]
|
||||
//// export class Greeter [|{
|
||||
//// export class Greeter[| {
|
||||
//// [|/*
|
||||
//// Comment before a string identifier
|
||||
//// line two of the comment
|
||||
@ -27,17 +27,17 @@
|
||||
//// constructor
|
||||
//// parameter message as a string
|
||||
//// */|]
|
||||
//// /* This is a single line block comment style. Should not be collapsed*/
|
||||
////
|
||||
//// [|/*
|
||||
//// Multiple comments should be collapsed individually
|
||||
//// */|]
|
||||
//// constructor(message: string /* do not collapse single lines*/) [|{
|
||||
//// constructor(message: string /* do not collapse this */)[| {
|
||||
//// this.greeting = message;
|
||||
//// }|]
|
||||
//// [|/*
|
||||
//// method of a class
|
||||
//// */|]
|
||||
//// greet() [|{
|
||||
//// greet()[| {
|
||||
//// return "Hello, " + this.greeting;
|
||||
//// }|]
|
||||
//// }|]
|
||||
@ -45,7 +45,7 @@
|
||||
////
|
||||
////[|/*
|
||||
//// Block comment for interface. The ending can be on the same line as the declaration.
|
||||
////*/|]interface IFoo [|{
|
||||
////*/|]interface IFoo[| {
|
||||
//// [|/*
|
||||
//// Multiple block comments
|
||||
//// */|]
|
||||
@ -95,10 +95,11 @@
|
||||
//// [|/*
|
||||
//// Over a function in an object literal
|
||||
//// */|]
|
||||
//// get foo() [|{
|
||||
//// get foo()[| {
|
||||
//// return 1;
|
||||
//// }|]
|
||||
////}|]
|
||||
debugger;
|
||||
verify.outliningSpansInCurrentFile(test.ranges());
|
||||
|
||||
|
||||
|
||||
81
tests/cases/fourslash/getOutliningForSingleLineComments.ts
Normal file
81
tests/cases/fourslash/getOutliningForSingleLineComments.ts
Normal file
@ -0,0 +1,81 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////[|// Single line comments at the start of the file
|
||||
////// line 2
|
||||
////// line 3
|
||||
////// line 4|]
|
||||
////module Sayings[| {
|
||||
////
|
||||
//// [|/*
|
||||
//// */|]
|
||||
//// [|// A sequence of
|
||||
//// // single line|]
|
||||
//// [|/*
|
||||
//// and block
|
||||
//// */|]
|
||||
//// [|// comments
|
||||
//// //|]
|
||||
//// export class Sample[| {
|
||||
//// }|]
|
||||
////}|]
|
||||
////
|
||||
////interface IFoo[| {
|
||||
//// [|// all consecutive single line comments should be in one block regardless of their number or empty lines/spaces inbetween
|
||||
////
|
||||
//// // comment 2
|
||||
//// // comment 3
|
||||
////
|
||||
//// //comment 4
|
||||
//// /// comment 5
|
||||
//// ///// comment 6
|
||||
////
|
||||
//// //comment 7
|
||||
//// ///comment 8
|
||||
//// // comment 9
|
||||
//// // //comment 10
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
////
|
||||
//// // // //comment 11
|
||||
//// // comment 12
|
||||
//// // comment 13
|
||||
//// // comment 14
|
||||
//// // comment 15
|
||||
////
|
||||
//// // comment 16
|
||||
//// // comment 17
|
||||
//// // comment 18
|
||||
//// // comment 19
|
||||
//// // comment 20
|
||||
//// // comment 21|]
|
||||
////
|
||||
//// getDist(): number; // One single line comment should not be collapsed
|
||||
////}|]
|
||||
////
|
||||
////// One single line comment should not be collapsed
|
||||
////class WithOneSingleLineComment[| {
|
||||
////}|]
|
||||
|
||||
|
||||
|
||||
|
||||
verify.outliningSpansInCurrentFile(test.ranges());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user