TypeScript/tests/cases/fourslash/getOutliningSpans.ts

120 lines
2.3 KiB
TypeScript
Raw Normal View History

2014-08-11 22:15:07 +02:00
/// <reference path="fourslash.ts"/>
////// interface
2014-08-11 22:15:07 +02:00
////interface IFoo[| {
//// getDist(): number;
////}|]
////
////// class members
////class Foo[| {
//// constructor()[| {
//// }|]
////
//// public foo(): number[| {
//// return 0;
//// }|]
////
//// public get X()[| {
//// return 1;
//// }|]
////
//// public set X(v: number)[| {
//// }|]
////
//// public member = function f()[| {
////
//// }|]
////}|]
2018-12-31 23:11:08 +01:00
////// class expressions
//// (new class[| {
//// bla()[| {
////
//// }|]
//// }|])
////switch(1)[| {
//// case 1:[| break;|]
////}|]
////
////var array =[| [
//// 1,
//// 2
////]|]
2014-08-11 22:15:07 +02:00
////
////// modules
////module m1[| {
//// module m2[| { }|]
//// module m3[| {
//// function foo()[| {
////
//// }|]
////
//// interface IFoo2[| {
////
//// }|]
////
//// class foo2 implements IFoo2[| {
////
//// }|]
//// }|]
////}|]
////
////// function declaration
////function foo(): number[| {
//// return 0;
////}|]
////
////// function expressions
////(function f()[| {
////
////}|])
////
////// trivia handeling
////class ClassFooWithTrivia[| /* some comments */
2014-08-11 22:15:07 +02:00
//// /* more trivia */ {
////
2014-08-11 22:15:07 +02:00
////
//// /*some trailing trivia */
////}|] /* even more */
////
////// object literals
2014-08-13 00:47:57 +02:00
////var x =[|{
2014-08-11 22:15:07 +02:00
//// a:1,
//// b:2,
2014-08-13 00:47:57 +02:00
//// get foo()[| {
2014-08-11 22:15:07 +02:00
//// return 1;
//// }|]
////}|]
//////outline with deep nesting
////var nest =[| [[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[
//// [|[
//// [
//// [
//// [
//// [
//// 1,2,3
//// ]
//// ]
//// ]
//// ]
//// ]|]
////]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|];
2014-08-11 22:15:07 +02:00
////
//////outline after a deeply nested node
////class AfterNestedNodes[| {
////}|]
2018-12-31 23:43:56 +01:00
////// function arguments
////function f(x: number[], y: number[])[| {
//// return 3;
////}|]
2020-06-17 16:41:08 +02:00
////f[|(
2018-12-31 23:43:56 +01:00
////// single line array literal span won't render in VS
//// [|[0]|],
//// [|[
//// 1,
//// 2
//// ]|]
2020-06-17 16:41:08 +02:00
////)|];
2018-12-31 23:43:56 +01:00
2014-08-11 22:15:07 +02:00
verify.outliningSpansInCurrentFile(test.ranges(), "code");