mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix unwanted constant comparisons potentially causing bugs (#61655)
This commit is contained in:
@@ -324,7 +324,7 @@ export function canWatchAtTypes(atTypes: Path): boolean {
|
||||
}
|
||||
|
||||
function isInDirectoryPath(dirComponents: Readonly<PathPathComponents>, fileOrDirComponents: Readonly<PathPathComponents>) {
|
||||
if (fileOrDirComponents.length < fileOrDirComponents.length) return false;
|
||||
if (fileOrDirComponents.length < dirComponents.length) return false;
|
||||
for (let i = 0; i < dirComponents.length; i++) {
|
||||
if (fileOrDirComponents[i] !== dirComponents[i]) return false;
|
||||
}
|
||||
|
||||
@@ -2603,9 +2603,9 @@ export class TestState {
|
||||
const sorted = items.slice();
|
||||
// sort by file, then *backwards* by position in the file so I can insert multiple times on a line without counting
|
||||
sorted.sort((q1, q2) =>
|
||||
q1.marker.fileName === q1.marker.fileName
|
||||
q1.marker.fileName === q2.marker.fileName
|
||||
? (q1.marker.position > q2.marker.position ? -1 : 1)
|
||||
: (q1.marker.fileName > q1.marker.fileName ? 1 : -1)
|
||||
: (q1.marker.fileName > q2.marker.fileName ? 1 : -1)
|
||||
);
|
||||
const files = new Map<string, string[]>();
|
||||
let previous: T | undefined;
|
||||
|
||||
@@ -1,4 +1,480 @@
|
||||
// === Completions ===
|
||||
=== /tests/cases/fourslash/a.ts ===
|
||||
// /**
|
||||
// * @para
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param value
|
||||
// | param maximumFractionDigits
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function printValue(value, maximumFractionDigits) {}
|
||||
//
|
||||
// /**
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function aa({ a = 1 }, b: string) {
|
||||
// a;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | @abstract
|
||||
// | @access
|
||||
// | @alias
|
||||
// | @argument
|
||||
// | @async
|
||||
// | @augments
|
||||
// | @author
|
||||
// | @borrows
|
||||
// | @callback
|
||||
// | @class
|
||||
// | @classdesc
|
||||
// | @constant
|
||||
// | @constructor
|
||||
// | @constructs
|
||||
// | @copyright
|
||||
// | @default
|
||||
// | @deprecated
|
||||
// | @description
|
||||
// | @emits
|
||||
// | @enum
|
||||
// | @event
|
||||
// | @example
|
||||
// | @exports
|
||||
// | @extends
|
||||
// | @external
|
||||
// | @field
|
||||
// | @file
|
||||
// | @fileoverview
|
||||
// | @fires
|
||||
// | @function
|
||||
// | @generator
|
||||
// | @global
|
||||
// | @hideconstructor
|
||||
// | @host
|
||||
// | @ignore
|
||||
// | @implements
|
||||
// | @import
|
||||
// | @inheritdoc
|
||||
// | @inner
|
||||
// | @instance
|
||||
// | @interface
|
||||
// | @kind
|
||||
// | @lends
|
||||
// | @license
|
||||
// | @link
|
||||
// | @linkcode
|
||||
// | @linkplain
|
||||
// | @listens
|
||||
// | @member
|
||||
// | @memberof
|
||||
// | @method
|
||||
// | @mixes
|
||||
// | @module
|
||||
// | @name
|
||||
// | @namespace
|
||||
// | @overload
|
||||
// | @override
|
||||
// | @package
|
||||
// | @param
|
||||
// | @private
|
||||
// | @prop
|
||||
// | @property
|
||||
// | @protected
|
||||
// | @public
|
||||
// | @readonly
|
||||
// | @requires
|
||||
// | @returns
|
||||
// | @satisfies
|
||||
// | @see
|
||||
// | @since
|
||||
// | @static
|
||||
// | @summary
|
||||
// | @template
|
||||
// | @this
|
||||
// | @throws
|
||||
// | @todo
|
||||
// | @tutorial
|
||||
// | @type
|
||||
// | @typedef
|
||||
// | @var
|
||||
// | @variation
|
||||
// | @version
|
||||
// | @virtual
|
||||
// | @yields
|
||||
// | @param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function bb(b: string) {}
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function cc({ b: { a, c } = { a: 1, c: 3 } }) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function dd({ a: { b, c }, d: [e, f] }: { a: { b: number, c: number }, d: [string, string] }) {
|
||||
//
|
||||
// }
|
||||
|
||||
=== /tests/cases/fourslash/b.js ===
|
||||
// /**
|
||||
// * @p
|
||||
@@ -1157,482 +1633,6 @@
|
||||
// function ll(a = reallylongfunctionnameabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl("")) {}
|
||||
// }
|
||||
|
||||
=== /tests/cases/fourslash/a.ts ===
|
||||
// /**
|
||||
// * @para
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param value
|
||||
// | param maximumFractionDigits
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function printValue(value, maximumFractionDigits) {}
|
||||
//
|
||||
// /**
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function aa({ a = 1 }, b: string) {
|
||||
// a;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | @abstract
|
||||
// | @access
|
||||
// | @alias
|
||||
// | @argument
|
||||
// | @async
|
||||
// | @augments
|
||||
// | @author
|
||||
// | @borrows
|
||||
// | @callback
|
||||
// | @class
|
||||
// | @classdesc
|
||||
// | @constant
|
||||
// | @constructor
|
||||
// | @constructs
|
||||
// | @copyright
|
||||
// | @default
|
||||
// | @deprecated
|
||||
// | @description
|
||||
// | @emits
|
||||
// | @enum
|
||||
// | @event
|
||||
// | @example
|
||||
// | @exports
|
||||
// | @extends
|
||||
// | @external
|
||||
// | @field
|
||||
// | @file
|
||||
// | @fileoverview
|
||||
// | @fires
|
||||
// | @function
|
||||
// | @generator
|
||||
// | @global
|
||||
// | @hideconstructor
|
||||
// | @host
|
||||
// | @ignore
|
||||
// | @implements
|
||||
// | @import
|
||||
// | @inheritdoc
|
||||
// | @inner
|
||||
// | @instance
|
||||
// | @interface
|
||||
// | @kind
|
||||
// | @lends
|
||||
// | @license
|
||||
// | @link
|
||||
// | @linkcode
|
||||
// | @linkplain
|
||||
// | @listens
|
||||
// | @member
|
||||
// | @memberof
|
||||
// | @method
|
||||
// | @mixes
|
||||
// | @module
|
||||
// | @name
|
||||
// | @namespace
|
||||
// | @overload
|
||||
// | @override
|
||||
// | @package
|
||||
// | @param
|
||||
// | @private
|
||||
// | @prop
|
||||
// | @property
|
||||
// | @protected
|
||||
// | @public
|
||||
// | @readonly
|
||||
// | @requires
|
||||
// | @returns
|
||||
// | @satisfies
|
||||
// | @see
|
||||
// | @since
|
||||
// | @static
|
||||
// | @summary
|
||||
// | @template
|
||||
// | @this
|
||||
// | @throws
|
||||
// | @todo
|
||||
// | @tutorial
|
||||
// | @type
|
||||
// | @typedef
|
||||
// | @var
|
||||
// | @variation
|
||||
// | @version
|
||||
// | @virtual
|
||||
// | @yields
|
||||
// | @param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function bb(b: string) {}
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function cc({ b: { a, c } = { a: 1, c: 3 } }) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @p
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | abstract
|
||||
// | access
|
||||
// | alias
|
||||
// | argument
|
||||
// | async
|
||||
// | augments
|
||||
// | author
|
||||
// | borrows
|
||||
// | callback
|
||||
// | class
|
||||
// | classdesc
|
||||
// | constant
|
||||
// | constructor
|
||||
// | constructs
|
||||
// | copyright
|
||||
// | default
|
||||
// | deprecated
|
||||
// | description
|
||||
// | emits
|
||||
// | enum
|
||||
// | event
|
||||
// | example
|
||||
// | exports
|
||||
// | extends
|
||||
// | external
|
||||
// | field
|
||||
// | file
|
||||
// | fileoverview
|
||||
// | fires
|
||||
// | function
|
||||
// | generator
|
||||
// | global
|
||||
// | hideconstructor
|
||||
// | host
|
||||
// | ignore
|
||||
// | implements
|
||||
// | import
|
||||
// | inheritdoc
|
||||
// | inner
|
||||
// | instance
|
||||
// | interface
|
||||
// | kind
|
||||
// | lends
|
||||
// | license
|
||||
// | link
|
||||
// | linkcode
|
||||
// | linkplain
|
||||
// | listens
|
||||
// | member
|
||||
// | memberof
|
||||
// | method
|
||||
// | mixes
|
||||
// | module
|
||||
// | name
|
||||
// | namespace
|
||||
// | overload
|
||||
// | override
|
||||
// | package
|
||||
// | param
|
||||
// | private
|
||||
// | prop
|
||||
// | property
|
||||
// | protected
|
||||
// | public
|
||||
// | readonly
|
||||
// | requires
|
||||
// | returns
|
||||
// | satisfies
|
||||
// | see
|
||||
// | since
|
||||
// | static
|
||||
// | summary
|
||||
// | template
|
||||
// | this
|
||||
// | throws
|
||||
// | todo
|
||||
// | tutorial
|
||||
// | type
|
||||
// | typedef
|
||||
// | var
|
||||
// | variation
|
||||
// | version
|
||||
// | virtual
|
||||
// | yields
|
||||
// | param param0
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function dd({ a: { b, c }, d: [e, f] }: { a: { b: number, c: number }, d: [string, string] }) {
|
||||
//
|
||||
// }
|
||||
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
|
||||
@@ -1,4 +1,98 @@
|
||||
// === Completions ===
|
||||
=== /tests/cases/fourslash/a.ts ===
|
||||
// /**
|
||||
// *
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | @abstract
|
||||
// | @access
|
||||
// | @alias
|
||||
// | @argument
|
||||
// | @async
|
||||
// | @augments
|
||||
// | @author
|
||||
// | @borrows
|
||||
// | @callback
|
||||
// | @class
|
||||
// | @classdesc
|
||||
// | @constant
|
||||
// | @constructor
|
||||
// | @constructs
|
||||
// | @copyright
|
||||
// | @default
|
||||
// | @deprecated
|
||||
// | @description
|
||||
// | @emits
|
||||
// | @enum
|
||||
// | @event
|
||||
// | @example
|
||||
// | @exports
|
||||
// | @extends
|
||||
// | @external
|
||||
// | @field
|
||||
// | @file
|
||||
// | @fileoverview
|
||||
// | @fires
|
||||
// | @function
|
||||
// | @generator
|
||||
// | @global
|
||||
// | @hideconstructor
|
||||
// | @host
|
||||
// | @ignore
|
||||
// | @implements
|
||||
// | @import
|
||||
// | @inheritdoc
|
||||
// | @inner
|
||||
// | @instance
|
||||
// | @interface
|
||||
// | @kind
|
||||
// | @lends
|
||||
// | @license
|
||||
// | @link
|
||||
// | @linkcode
|
||||
// | @linkplain
|
||||
// | @listens
|
||||
// | @member
|
||||
// | @memberof
|
||||
// | @method
|
||||
// | @mixes
|
||||
// | @module
|
||||
// | @name
|
||||
// | @namespace
|
||||
// | @overload
|
||||
// | @override
|
||||
// | @package
|
||||
// | @param
|
||||
// | @private
|
||||
// | @prop
|
||||
// | @property
|
||||
// | @protected
|
||||
// | @public
|
||||
// | @readonly
|
||||
// | @requires
|
||||
// | @returns
|
||||
// | @satisfies
|
||||
// | @see
|
||||
// | @since
|
||||
// | @static
|
||||
// | @summary
|
||||
// | @template
|
||||
// | @this
|
||||
// | @throws
|
||||
// | @todo
|
||||
// | @tutorial
|
||||
// | @type
|
||||
// | @typedef
|
||||
// | @var
|
||||
// | @variation
|
||||
// | @version
|
||||
// | @virtual
|
||||
// | @yields
|
||||
// | @param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function bb(b: string) {}
|
||||
|
||||
=== /tests/cases/fourslash/b.js ===
|
||||
// /**
|
||||
// *
|
||||
@@ -379,100 +473,6 @@
|
||||
// */
|
||||
// function zz(a = 3) {}
|
||||
|
||||
=== /tests/cases/fourslash/a.ts ===
|
||||
// /**
|
||||
// *
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | @abstract
|
||||
// | @access
|
||||
// | @alias
|
||||
// | @argument
|
||||
// | @async
|
||||
// | @augments
|
||||
// | @author
|
||||
// | @borrows
|
||||
// | @callback
|
||||
// | @class
|
||||
// | @classdesc
|
||||
// | @constant
|
||||
// | @constructor
|
||||
// | @constructs
|
||||
// | @copyright
|
||||
// | @default
|
||||
// | @deprecated
|
||||
// | @description
|
||||
// | @emits
|
||||
// | @enum
|
||||
// | @event
|
||||
// | @example
|
||||
// | @exports
|
||||
// | @extends
|
||||
// | @external
|
||||
// | @field
|
||||
// | @file
|
||||
// | @fileoverview
|
||||
// | @fires
|
||||
// | @function
|
||||
// | @generator
|
||||
// | @global
|
||||
// | @hideconstructor
|
||||
// | @host
|
||||
// | @ignore
|
||||
// | @implements
|
||||
// | @import
|
||||
// | @inheritdoc
|
||||
// | @inner
|
||||
// | @instance
|
||||
// | @interface
|
||||
// | @kind
|
||||
// | @lends
|
||||
// | @license
|
||||
// | @link
|
||||
// | @linkcode
|
||||
// | @linkplain
|
||||
// | @listens
|
||||
// | @member
|
||||
// | @memberof
|
||||
// | @method
|
||||
// | @mixes
|
||||
// | @module
|
||||
// | @name
|
||||
// | @namespace
|
||||
// | @overload
|
||||
// | @override
|
||||
// | @package
|
||||
// | @param
|
||||
// | @private
|
||||
// | @prop
|
||||
// | @property
|
||||
// | @protected
|
||||
// | @public
|
||||
// | @readonly
|
||||
// | @requires
|
||||
// | @returns
|
||||
// | @satisfies
|
||||
// | @see
|
||||
// | @since
|
||||
// | @static
|
||||
// | @summary
|
||||
// | @template
|
||||
// | @this
|
||||
// | @throws
|
||||
// | @todo
|
||||
// | @tutorial
|
||||
// | @type
|
||||
// | @typedef
|
||||
// | @var
|
||||
// | @variation
|
||||
// | @version
|
||||
// | @virtual
|
||||
// | @yields
|
||||
// | @param b
|
||||
// | ----------------------------------------------------------------------
|
||||
// */
|
||||
// function bb(b: string) {}
|
||||
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
// === QuickInfo ===
|
||||
=== /b.ts ===
|
||||
// import { x } from "./a";
|
||||
// x;
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) const x: 0
|
||||
// | import x
|
||||
// | Doc
|
||||
// | @tag Tag text
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
=== /c.ts ===
|
||||
// /**
|
||||
// * Doc 2
|
||||
@@ -20,17 +31,6 @@
|
||||
// | @tag Tag text
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
=== /b.ts ===
|
||||
// import { x } from "./a";
|
||||
// x;
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) const x: 0
|
||||
// | import x
|
||||
// | Doc
|
||||
// | @tag Tag text
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
|
||||
@@ -1,34 +1,19 @@
|
||||
// === QuickInfo ===
|
||||
=== /tests/cases/fourslash/file.tsx ===
|
||||
// interface OptionProp {
|
||||
// propx: 2
|
||||
// }
|
||||
// class Opt extends React.Component<OptionProp, {}> {
|
||||
// render() {
|
||||
// return <div>Hello</div>;
|
||||
// }
|
||||
// }
|
||||
// const obj1: OptionProp = {
|
||||
// propx: 2
|
||||
// }
|
||||
// let y1 = <Opt propx={2} />;
|
||||
// ^^^
|
||||
=== /b.ts ===
|
||||
// import { f } from "./a";
|
||||
// f({ x: 1 });
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Opt {
|
||||
// | render(): any;
|
||||
// | }
|
||||
// | (verbosity level: 2)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Opt {
|
||||
// | render(): any;
|
||||
// | }
|
||||
// | (alias) f(x: {
|
||||
// | x: number;
|
||||
// | }): void
|
||||
// | import f
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Opt
|
||||
// | (alias) f(x: X): void
|
||||
// | import f
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
@@ -103,21 +88,36 @@
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
=== /b.ts ===
|
||||
// import { f } from "./a";
|
||||
// f({ x: 1 });
|
||||
// ^
|
||||
=== /tests/cases/fourslash/file.tsx ===
|
||||
// interface OptionProp {
|
||||
// propx: 2
|
||||
// }
|
||||
// class Opt extends React.Component<OptionProp, {}> {
|
||||
// render() {
|
||||
// return <div>Hello</div>;
|
||||
// }
|
||||
// }
|
||||
// const obj1: OptionProp = {
|
||||
// propx: 2
|
||||
// }
|
||||
// let y1 = <Opt propx={2} />;
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) f(x: {
|
||||
// | x: number;
|
||||
// | }): void
|
||||
// | import f
|
||||
// | class Opt {
|
||||
// | render(): any;
|
||||
// | }
|
||||
// | (verbosity level: 2)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Opt {
|
||||
// | render(): any;
|
||||
// | }
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) f(x: X): void
|
||||
// | import f
|
||||
// | class Opt
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
// === QuickInfo ===
|
||||
=== /4.ts ===
|
||||
// import Foo from "./3";
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | import Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// const f = new Foo();
|
||||
=== /1.ts ===
|
||||
// import * as zero from "./0";
|
||||
// const b = zero;
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const f: {
|
||||
// | a: boolean;
|
||||
// | const b: {
|
||||
// | readonly a: {
|
||||
// | a: number;
|
||||
// | b: string;
|
||||
// | };
|
||||
// | Color: {
|
||||
// | readonly [x: number]: string;
|
||||
// | readonly Red: zero.Color.Red;
|
||||
// | readonly Green: zero.Color.Green;
|
||||
// | readonly Blue: zero.Color.Blue;
|
||||
// | };
|
||||
// | }
|
||||
// | (verbosity level: 2)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const b: {
|
||||
// | readonly a: zero.Apple;
|
||||
// | Color: typeof zero.Color;
|
||||
// | }
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const f: Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) new Foo(): {
|
||||
// | a: boolean;
|
||||
// | }
|
||||
// | import Foo
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) new Foo(): Foo
|
||||
// | import Foo
|
||||
// | const b: typeof zero
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
@@ -69,36 +67,38 @@
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
=== /1.ts ===
|
||||
// import * as zero from "./0";
|
||||
// const b = zero;
|
||||
=== /4.ts ===
|
||||
// import Foo from "./3";
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | import Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// const f = new Foo();
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const b: {
|
||||
// | readonly a: {
|
||||
// | a: number;
|
||||
// | b: string;
|
||||
// | };
|
||||
// | Color: {
|
||||
// | readonly [x: number]: string;
|
||||
// | readonly Red: zero.Color.Red;
|
||||
// | readonly Green: zero.Color.Green;
|
||||
// | readonly Blue: zero.Color.Blue;
|
||||
// | };
|
||||
// | }
|
||||
// | (verbosity level: 2)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const b: {
|
||||
// | readonly a: zero.Apple;
|
||||
// | Color: typeof zero.Color;
|
||||
// | const f: {
|
||||
// | a: boolean;
|
||||
// | }
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | const b: typeof zero
|
||||
// | const f: Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) new Foo(): {
|
||||
// | a: boolean;
|
||||
// | }
|
||||
// | import Foo
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (alias) new Foo(): Foo
|
||||
// | import Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
// === QuickInfo ===
|
||||
=== /1.ts ===
|
||||
// export {};
|
||||
// class Foo<T> {
|
||||
// y: string;
|
||||
// }
|
||||
// namespace Foo {
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Foo<T> {
|
||||
// | y: string;
|
||||
// | }
|
||||
// | namespace Foo {
|
||||
// | let y: number;
|
||||
// | let x: string;
|
||||
// | let w: string;
|
||||
// | }
|
||||
// |
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Foo<T>
|
||||
// | namespace Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// export var y: number = 1;
|
||||
// export var x: string = "hello";
|
||||
// export var w = "world";
|
||||
// var z = 2;
|
||||
// }
|
||||
|
||||
=== /3.ts ===
|
||||
// import * as Foo_1 from "./b";
|
||||
// export declare namespace ns {
|
||||
@@ -40,55 +71,6 @@
|
||||
// a: string;
|
||||
// }
|
||||
|
||||
=== /1.ts ===
|
||||
// export {};
|
||||
// class Foo<T> {
|
||||
// y: string;
|
||||
// }
|
||||
// namespace Foo {
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Foo<T> {
|
||||
// | y: string;
|
||||
// | }
|
||||
// | namespace Foo {
|
||||
// | let y: number;
|
||||
// | let x: string;
|
||||
// | let w: string;
|
||||
// | }
|
||||
// |
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | class Foo<T>
|
||||
// | namespace Foo
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// export var y: number = 1;
|
||||
// export var x: string = "hello";
|
||||
// export var w = "world";
|
||||
// var z = 2;
|
||||
// }
|
||||
|
||||
=== /tests/cases/fourslash/foo.ts ===
|
||||
// export function foo() { return "foo"; }
|
||||
// import("./foo")
|
||||
// ^^^^^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | module "/tests/cases/fourslash/foo" {
|
||||
// | function foo(): string;
|
||||
// | namespace foo { }
|
||||
// | }
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^^^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | module "/tests/cases/fourslash/foo"
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// var x = import("./foo")
|
||||
|
||||
=== /4.ts ===
|
||||
// class Foo<T> {
|
||||
// y!: T;
|
||||
@@ -137,6 +119,24 @@
|
||||
// const bar: number;
|
||||
// }
|
||||
|
||||
=== /tests/cases/fourslash/foo.ts ===
|
||||
// export function foo() { return "foo"; }
|
||||
// import("./foo")
|
||||
// ^^^^^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | module "/tests/cases/fourslash/foo" {
|
||||
// | function foo(): string;
|
||||
// | namespace foo { }
|
||||
// | }
|
||||
// | (verbosity level: 1)
|
||||
// | ----------------------------------------------------------------------
|
||||
// ^^^^^^^
|
||||
// | ----------------------------------------------------------------------
|
||||
// | module "/tests/cases/fourslash/foo"
|
||||
// | (verbosity level: 0)
|
||||
// | ----------------------------------------------------------------------
|
||||
// var x = import("./foo")
|
||||
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
|
||||
Reference in New Issue
Block a user