mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 10:58:20 -05:00
Copy smartSelect tests to fourslash
This commit is contained in:
@@ -1529,7 +1529,7 @@ Actual: ${stringify(fullActual)}`);
|
||||
baselineContent.push(masked);
|
||||
selectionRange = selectionRange.parent;
|
||||
}
|
||||
return baselineContent.join(n);
|
||||
return baselineContent.join(fileContent.includes("\n") ? n + n : n);
|
||||
}).join(n.repeat(2) + "=".repeat(80) + n.repeat(2));
|
||||
|
||||
Harness.Baseline.runBaseline(baselineFile, text);
|
||||
|
||||
30
tests/baselines/reference/smartSelection_JSDoc.baseline
Normal file
30
tests/baselines/reference/smartSelection_JSDoc.baseline
Normal file
@@ -0,0 +1,30 @@
|
||||
// Not a JSDoc comment
|
||||
/**
|
||||
* @param {number} x The number to square
|
||||
*/
|
||||
function /**/square(x) {
|
||||
return x * x;
|
||||
}
|
||||
|
||||
|
||||
square
|
||||
|
||||
|
||||
function square(x) {
|
||||
return x * x;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} x The number to square
|
||||
*/
|
||||
function square(x) {
|
||||
return x * x;
|
||||
}
|
||||
|
||||
// Not a JSDoc comment
|
||||
/**
|
||||
* @param {number} x The number to square
|
||||
*/
|
||||
function square(x) {
|
||||
return x * x;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
let/**/ x: string
|
||||
|
||||
let
|
||||
let x: string
|
||||
@@ -0,0 +1,27 @@
|
||||
const { /**/x, y: a, ...zs = {} } = {};
|
||||
|
||||
x
|
||||
x, y: a, ...zs = {}
|
||||
{ x, y: a, ...zs = {} }
|
||||
const { x, y: a, ...zs = {} } = {};
|
||||
|
||||
================================================================================
|
||||
|
||||
const { x, y: /**/a, ...zs = {} } = {};
|
||||
|
||||
a
|
||||
y: a
|
||||
x, y: a, ...zs = {}
|
||||
{ x, y: a, ...zs = {} }
|
||||
const { x, y: a, ...zs = {} } = {};
|
||||
|
||||
================================================================================
|
||||
|
||||
const { x, y: a, .../**/zs = {} } = {};
|
||||
|
||||
zs
|
||||
...zs
|
||||
...zs = {}
|
||||
x, y: a, ...zs = {}
|
||||
{ x, y: a, ...zs = {} }
|
||||
const { x, y: a, ...zs = {} } = {};
|
||||
12
tests/baselines/reference/smartSelection_complex.baseline
Normal file
12
tests/baselines/reference/smartSelection_complex.baseline
Normal file
@@ -0,0 +1,12 @@
|
||||
type X<T, P> = IsExactlyAny<P> extends true ? T : ({ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[/**/K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>)
|
||||
|
||||
K
|
||||
P[K]
|
||||
K extends keyof T ? T[K] : P[K]
|
||||
IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]
|
||||
[K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K];
|
||||
{ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]; }
|
||||
{ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>
|
||||
({ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>)
|
||||
IsExactlyAny<P> extends true ? T : ({ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>)
|
||||
type X<T, P> = IsExactlyAny<P> extends true ? T : ({ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>)
|
||||
140
tests/baselines/reference/smartSelection_emptyRanges.baseline
Normal file
140
tests/baselines/reference/smartSelection_emptyRanges.baseline
Normal file
@@ -0,0 +1,140 @@
|
||||
class HomePage {
|
||||
componentDidMount(/**/) {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}↲
|
||||
|
||||
|
||||
class HomePage {
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
class HomePage {
|
||||
componentDidMount() {
|
||||
if (this.props.username/**/) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••••if (this.props.username) {
|
||||
return '';
|
||||
}↲
|
||||
••
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}↲
|
||||
|
||||
|
||||
class HomePage {
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
class HomePage {
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '/**/';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
''
|
||||
|
||||
|
||||
return '';
|
||||
|
||||
|
||||
↲
|
||||
••••••return '';↲
|
||||
••••
|
||||
|
||||
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••••if (this.props.username) {
|
||||
return '';
|
||||
}↲
|
||||
••
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}↲
|
||||
|
||||
|
||||
class HomePage {
|
||||
componentDidMount() {
|
||||
if (this.props.username) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
function f(/**/p, q?, ...r: any[] = []) {}
|
||||
|
||||
p
|
||||
p, q?, ...r: any[] = []
|
||||
function f(p, q?, ...r: any[] = []) {}
|
||||
|
||||
================================================================================
|
||||
|
||||
function f(p, /**/q?, ...r: any[] = []) {}
|
||||
|
||||
q
|
||||
q?
|
||||
p, q?, ...r: any[] = []
|
||||
function f(p, q?, ...r: any[] = []) {}
|
||||
|
||||
================================================================================
|
||||
|
||||
function f(p, q?, /**/...r: any[] = []) {}
|
||||
|
||||
...
|
||||
...r
|
||||
...r: any[]
|
||||
...r: any[] = []
|
||||
p, q?, ...r: any[] = []
|
||||
function f(p, q?, ...r: any[] = []) {}
|
||||
@@ -0,0 +1,18 @@
|
||||
function f(
|
||||
a,
|
||||
/**/b
|
||||
) {}
|
||||
|
||||
|
||||
b
|
||||
|
||||
|
||||
↲
|
||||
••a,
|
||||
b↲
|
||||
|
||||
|
||||
function f(
|
||||
a,
|
||||
b
|
||||
) {}
|
||||
29
tests/baselines/reference/smartSelection_imports.baseline
Normal file
29
tests/baselines/reference/smartSelection_imports.baseline
Normal file
@@ -0,0 +1,29 @@
|
||||
import { /**/x as y, z } from './z';
|
||||
import { b } from './';
|
||||
|
||||
console.log(1);
|
||||
|
||||
|
||||
x
|
||||
|
||||
|
||||
x as y
|
||||
|
||||
|
||||
x as y, z
|
||||
|
||||
|
||||
{ x as y, z }
|
||||
|
||||
|
||||
import { x as y, z } from './z';
|
||||
|
||||
|
||||
import { x as y, z } from './z';
|
||||
import { b } from './';
|
||||
|
||||
|
||||
import { x as y, z } from './z';
|
||||
import { b } from './';
|
||||
|
||||
console.log(1);
|
||||
@@ -0,0 +1,4 @@
|
||||
const /**/x = 3;
|
||||
|
||||
x
|
||||
const x = 3;
|
||||
@@ -0,0 +1,65 @@
|
||||
type M = { /**/-readonly [K in keyof any]-?: any };
|
||||
|
||||
-
|
||||
-readonly
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
|
||||
================================================================================
|
||||
|
||||
type M = { -re/**/adonly [K in keyof any]-?: any };
|
||||
|
||||
readonly
|
||||
-readonly
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
|
||||
================================================================================
|
||||
|
||||
type M = { -readonly /**/[K in keyof any]-?: any };
|
||||
|
||||
[
|
||||
[K in keyof any]
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
|
||||
================================================================================
|
||||
|
||||
type M = { -readonly [K in ke/**/yof any]-?: any };
|
||||
|
||||
keyof
|
||||
keyof any
|
||||
K in keyof any
|
||||
[K in keyof any]
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
|
||||
================================================================================
|
||||
|
||||
type M = { -readonly [K in keyof any]/**/-?: any };
|
||||
|
||||
-
|
||||
-?
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
|
||||
================================================================================
|
||||
|
||||
type M = { -readonly [K in keyof any]-/**/?: any };
|
||||
|
||||
?
|
||||
-?
|
||||
-readonly [K in keyof any]-?
|
||||
-readonly [K in keyof any]-?: any
|
||||
{ -readonly [K in keyof any]-?: any }
|
||||
type M = { -readonly [K in keyof any]-?: any };
|
||||
174
tests/baselines/reference/smartSelection_objectTypes.baseline
Normal file
174
tests/baselines/reference/smartSelection_objectTypes.baseline
Normal file
@@ -0,0 +1,174 @@
|
||||
type X = {
|
||||
/**/foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
|
||||
foo
|
||||
|
||||
|
||||
foo?
|
||||
|
||||
|
||||
foo?: string;
|
||||
|
||||
|
||||
↲
|
||||
••foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh↲
|
||||
|
||||
|
||||
{
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
/**/readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
|
||||
readonly
|
||||
|
||||
|
||||
readonly bar
|
||||
|
||||
|
||||
readonly bar: { x: number };
|
||||
|
||||
|
||||
↲
|
||||
••foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh↲
|
||||
|
||||
|
||||
{
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly /**/bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
|
||||
bar
|
||||
|
||||
|
||||
readonly bar
|
||||
|
||||
|
||||
readonly bar: { x: number };
|
||||
|
||||
|
||||
↲
|
||||
••foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh↲
|
||||
|
||||
|
||||
{
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: num/**/ber };
|
||||
meh
|
||||
}
|
||||
|
||||
|
||||
number
|
||||
|
||||
|
||||
x: number
|
||||
|
||||
|
||||
{ x: number }
|
||||
|
||||
|
||||
readonly bar: { x: number };
|
||||
|
||||
|
||||
↲
|
||||
••foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh↲
|
||||
|
||||
|
||||
{
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
/**/meh
|
||||
}
|
||||
|
||||
|
||||
meh
|
||||
|
||||
|
||||
↲
|
||||
••foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh↲
|
||||
|
||||
|
||||
{
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
|
||||
type X = {
|
||||
foo?: string;
|
||||
readonly bar: { x: number };
|
||||
meh
|
||||
}
|
||||
116
tests/baselines/reference/smartSelection_simple1.baseline
Normal file
116
tests/baselines/reference/smartSelection_simple1.baseline
Normal file
@@ -0,0 +1,116 @@
|
||||
class Foo {
|
||||
bar(a, b) {
|
||||
if (/**/a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
a
|
||||
|
||||
|
||||
a === b
|
||||
|
||||
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••••••if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;↲
|
||||
••
|
||||
|
||||
|
||||
bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}↲
|
||||
|
||||
|
||||
class Foo {
|
||||
bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
class Foo {
|
||||
bar(a, b) {
|
||||
if (a === b) {
|
||||
return tr/**/ue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
true
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
↲
|
||||
••••••••••return true;↲
|
||||
••••••
|
||||
|
||||
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••••••if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;↲
|
||||
••
|
||||
|
||||
|
||||
bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
↲
|
||||
••bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}↲
|
||||
|
||||
|
||||
class Foo {
|
||||
bar(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
63
tests/baselines/reference/smartSelection_simple2.baseline
Normal file
63
tests/baselines/reference/smartSelection_simple2.baseline
Normal file
@@ -0,0 +1,63 @@
|
||||
export interface IService {
|
||||
_serviceBrand: any;
|
||||
|
||||
open(ho/**/st: number, data: any): Promise<any>;
|
||||
bar(): void
|
||||
}
|
||||
|
||||
|
||||
host
|
||||
|
||||
|
||||
host: number
|
||||
|
||||
|
||||
host: number, data: any
|
||||
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
|
||||
|
||||
↲
|
||||
••_serviceBrand: any;
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
bar(): void↲
|
||||
|
||||
|
||||
export interface IService {
|
||||
_serviceBrand: any;
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
bar(): void
|
||||
}
|
||||
|
||||
================================================================================
|
||||
|
||||
export interface IService {
|
||||
_serviceBrand: any;
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
bar(): void/**/
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
||||
|
||||
bar(): void
|
||||
|
||||
|
||||
↲
|
||||
••_serviceBrand: any;
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
bar(): void↲
|
||||
|
||||
|
||||
export interface IService {
|
||||
_serviceBrand: any;
|
||||
|
||||
open(host: number, data: any): Promise<any>;
|
||||
bar(): void
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
`a /**/b ${
|
||||
'c'
|
||||
} d`
|
||||
|
||||
|
||||
a b ${
|
||||
'c'
|
||||
} d
|
||||
|
||||
`a b ${
|
||||
'c'
|
||||
} d`
|
||||
|
||||
================================================================================
|
||||
|
||||
`a b ${
|
||||
'/**/c'
|
||||
} d`
|
||||
|
||||
|
||||
c
|
||||
|
||||
|
||||
'c'
|
||||
|
||||
|
||||
${
|
||||
'c'
|
||||
}
|
||||
|
||||
a b ${
|
||||
'c'
|
||||
} d
|
||||
|
||||
`a b ${
|
||||
'c'
|
||||
} d`
|
||||
11
tests/cases/fourslash/smartSelection_JSDoc.ts
Normal file
11
tests/cases/fourslash/smartSelection_JSDoc.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////// Not a JSDoc comment
|
||||
/////**
|
||||
//// * @param {number} x The number to square
|
||||
//// */
|
||||
////function /**/square(x) {
|
||||
//// return x * x;
|
||||
////}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
6
tests/cases/fourslash/smartSelection_behindCaret.ts
Normal file
6
tests/cases/fourslash/smartSelection_behindCaret.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////let/**/ x: string
|
||||
|
||||
// Verifies that the selection goes to 'let' first even though it’s behind the caret
|
||||
verify.baselineSmartSelection();
|
||||
5
tests/cases/fourslash/smartSelection_bindingPatterns.ts
Normal file
5
tests/cases/fourslash/smartSelection_bindingPatterns.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////const { /*1*/x, y: /*2*/a, .../*3*/zs = {} } = {};
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
5
tests/cases/fourslash/smartSelection_complex.ts
Normal file
5
tests/cases/fourslash/smartSelection_complex.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////type X<T, P> = IsExactlyAny<P> extends true ? T : ({ [K in keyof P]: IsExactlyAny<P[K]> extends true ? K extends keyof T ? T[K] : P[/**/K] : P[K]; } & Pick<T, Exclude<keyof T, keyof P>>)
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
11
tests/cases/fourslash/smartSelection_emptyRanges.ts
Normal file
11
tests/cases/fourslash/smartSelection_emptyRanges.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////class HomePage {
|
||||
//// componentDidMount(/*1*/) {
|
||||
//// if (this.props.username/*2*/) {
|
||||
//// return '/*3*/';
|
||||
//// }
|
||||
//// }
|
||||
////}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
5
tests/cases/fourslash/smartSelection_functionParams1.ts
Normal file
5
tests/cases/fourslash/smartSelection_functionParams1.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////function f(/*1*/p, /*2*/q?, /*3*/...r: any[] = []) {}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
8
tests/cases/fourslash/smartSelection_functionParams2.ts
Normal file
8
tests/cases/fourslash/smartSelection_functionParams2.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////function f(
|
||||
//// a,
|
||||
//// /**/b
|
||||
////) {}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
8
tests/cases/fourslash/smartSelection_imports.ts
Normal file
8
tests/cases/fourslash/smartSelection_imports.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////import { /**/x as y, z } from './z';
|
||||
////import { b } from './';
|
||||
////
|
||||
////console.log(1);
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
@@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////const /**/x = 3;
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
5
tests/cases/fourslash/smartSelection_mappedTypes.ts
Normal file
5
tests/cases/fourslash/smartSelection_mappedTypes.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////type M = { /*1*/-re/*2*/adonly /*3*/[K in ke/*4*/yof any]/*5*/-/*6*/?: any };
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
9
tests/cases/fourslash/smartSelection_objectTypes.ts
Normal file
9
tests/cases/fourslash/smartSelection_objectTypes.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////type X = {
|
||||
//// /*1*/foo?: string;
|
||||
//// /*2*/readonly /*3*/bar: { x: num/*4*/ber };
|
||||
//// /*5*/meh
|
||||
////}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
12
tests/cases/fourslash/smartSelection_simple1.ts
Normal file
12
tests/cases/fourslash/smartSelection_simple1.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////class Foo {
|
||||
//// bar(a, b) {
|
||||
//// if (/*1*/a === b) {
|
||||
//// return tr/*2*/ue;
|
||||
//// }
|
||||
//// return false;
|
||||
//// }
|
||||
////}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
10
tests/cases/fourslash/smartSelection_simple2.ts
Normal file
10
tests/cases/fourslash/smartSelection_simple2.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////export interface IService {
|
||||
//// _serviceBrand: any;
|
||||
////
|
||||
//// open(ho/*1*/st: number, data: any): Promise<any>;
|
||||
//// bar(): void/*2*/
|
||||
////}
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
7
tests/cases/fourslash/smartSelection_templateStrings.ts
Normal file
7
tests/cases/fourslash/smartSelection_templateStrings.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////`a /*1*/b ${
|
||||
//// '/*2*/c'
|
||||
////} d`
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
Reference in New Issue
Block a user