2014-08-11 22:15:07 +02:00
|
|
|
/// <reference path="fourslash.ts"/>
|
|
|
|
|
2017-11-21 20:27:26 +01:00
|
|
|
////// 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()[| {
|
|
|
|
////
|
|
|
|
//// }|]
|
|
|
|
//// }|])
|
2014-09-29 07:33:00 +02:00
|
|
|
////switch(1)[| {
|
2020-03-13 18:52:27 +01:00
|
|
|
//// case 1:[| break;|]
|
2014-09-29 07:33:00 +02:00
|
|
|
////}|]
|
|
|
|
////
|
|
|
|
////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
|
2017-11-21 20:27:26 +01:00
|
|
|
////class ClassFooWithTrivia[| /* some comments */
|
2014-08-11 22:15:07 +02:00
|
|
|
//// /* more trivia */ {
|
2017-11-21 20:27:26 +01:00
|
|
|
////
|
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
|
2017-10-04 22:48:08 +02:00
|
|
|
////var nest =[| [[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[[|[
|
|
|
|
//// [|[
|
|
|
|
//// [
|
|
|
|
//// [
|
|
|
|
//// [
|
|
|
|
//// [
|
2017-11-21 20:27:26 +01:00
|
|
|
//// 1,2,3
|
|
|
|
//// ]
|
2017-10-04 22:48:08 +02:00
|
|
|
//// ]
|
|
|
|
//// ]
|
|
|
|
//// ]
|
|
|
|
//// ]|]
|
|
|
|
////]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|]]|];
|
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
|
|
|
|
2018-05-04 01:28:55 +02:00
|
|
|
verify.outliningSpansInCurrentFile(test.ranges(), "code");
|