Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/fourslash/_scripts/failingTests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,13 @@ TestEditJsdocType
TestExportDefaultClass
TestExportDefaultFunction
TestFindAllReferencesDynamicImport1
TestFindAllReferencesTripleSlash
TestFindAllReferencesUmdModuleAsGlobalConst
TestFindAllRefsCommonJsRequire
TestFindAllRefsCommonJsRequire2
TestFindAllRefsCommonJsRequire3
TestFindAllRefsExportEquals
TestFindAllRefsForDefaultExport03
TestFindAllRefsModuleDotExports
TestFindAllRefsReExport_broken
TestFindAllRefs_importType_typeofImport
TestFindReferencesAfterEdit
TestFindReferencesBindingPatternInJsdocNoCrash1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestFindAllReferencesTripleSlash(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @checkJs: true
// @Filename: /node_modules/@types/globals/index.d.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestFindAllRefsReExport_broken(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /a.ts
/*1*/export { /*2*/x };`
Expand Down
2 changes: 1 addition & 1 deletion internal/ls/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ComparePositions(pos, other lsproto.Position) int {
if lineComp := cmp.Compare(pos.Line, other.Line); lineComp != 0 {
return lineComp
}
return cmp.Compare(pos.Line, other.Line)
return cmp.Compare(pos.Character, other.Character)
}

// Implements a cmp.Compare like function for two *lsproto.Range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// === /home/src/workspaces/project/b/b.ts ===

// /// <reference path="../a/index.d.ts" />
// new A/*FIND ALL REFS*/[|A|]();
// new [|A|]/*FIND ALL REFS*/();
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// // Haha that's so meta!
//
// let x = import.meta/*FIND ALL REFS*/[|meta|];
// let x = import.[|meta|]/*FIND ALL REFS*/;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
// * @param {unknown} x
// * @returns {unknown}
// */
// function foo(x/*FIND ALL REFS*/[|x|]) {
// function foo([|x|]/*FIND ALL REFS*/) {
// return [|x|];
// }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// === /findAllReferencesLinkTag1.ts ===

// class C {
// m/*FIND ALL REFS*/[|m|]() { }
// [|m|]/*FIND ALL REFS*/() { }
// n = 1
// static s() { }
// /**
Expand All @@ -26,7 +26,7 @@

// class C {
// m() { }
// n/*FIND ALL REFS*/[|n|] = 1
// [|n|]/*FIND ALL REFS*/ = 1
// static s() { }
// /**
// * {@link m}
Expand All @@ -52,7 +52,7 @@
// class C {
// m() { }
// n = 1
// static s/*FIND ALL REFS*/[|s|]() { }
// static [|s|]/*FIND ALL REFS*/() { }
// /**
// * {@link m}
// * @see {m}
Expand All @@ -79,7 +79,7 @@
// }
//
// interface I {
// a/*FIND ALL REFS*/[|a|]()
// [|a|]/*FIND ALL REFS*/()
// b: 1
// /**
// * {@link a}
Expand All @@ -95,7 +95,7 @@
//
// interface I {
// a()
// b/*FIND ALL REFS*/[|b|]: 1
// [|b|]/*FIND ALL REFS*/: 1
// /**
// * {@link a}
// * @see {a}
Expand All @@ -115,7 +115,7 @@
// function ref() { }
// /** @see {r2} */
// function d3() { }
// function r2/*FIND ALL REFS*/[|r2|]() { }
// function [|r2|]/*FIND ALL REFS*/() { }
// }


Expand All @@ -124,7 +124,7 @@
// === findAllReferences ===
// === /findAllReferencesLinkTag1.ts ===

// class C/*FIND ALL REFS*/[|C|] {
// class [|C|]/*FIND ALL REFS*/ {
// m() { }
// n = 1
// static s() { }
Expand Down Expand Up @@ -169,7 +169,7 @@
// r() { }
// }
//
// interface I/*FIND ALL REFS*/[|I|] {
// interface [|I|]/*FIND ALL REFS*/ {
// a()
// b: 1
// /**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This = class {
// show() { }
// }
// m/*FIND ALL REFS*/[|m|]() { }
// [|m|]/*FIND ALL REFS*/() { }
// }
// /**
// * @see {Consider.prototype.m}
Expand All @@ -21,7 +21,7 @@
// namespace NPR {
// export class Consider {
// This = class {
// show/*FIND ALL REFS*/[|show|]() { }
// [|show|]/*FIND ALL REFS*/() { }
// }
// m() { }
// }
Expand All @@ -35,7 +35,7 @@

// namespace NPR {
// export class Consider {
// This/*FIND ALL REFS*/[|This|] = class {
// [|This|]/*FIND ALL REFS*/ = class {
// show() { }
// }
// m() { }
Expand All @@ -48,7 +48,7 @@
// === /findAllReferencesLinkTag2.ts ===

// namespace NPR {
// export class Consider/*FIND ALL REFS*/[|Consider|] {
// export class [|Consider|]/*FIND ALL REFS*/ {
// This = class {
// show() { }
// }
Expand Down Expand Up @@ -80,7 +80,7 @@
// === findAllReferences ===
// === /findAllReferencesLinkTag2.ts ===

// namespace NPR/*FIND ALL REFS*/[|NPR|] {
// namespace [|NPR|]/*FIND ALL REFS*/ {
// export class Consider {
// This = class {
// show() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This = class {
// show() { }
// }
// m/*FIND ALL REFS*/[|m|]() { }
// [|m|]/*FIND ALL REFS*/() { }
// }
// /**
// * {@linkcode Consider.prototype.[|m|]}
Expand All @@ -24,7 +24,7 @@
// namespace NPR {
// export class Consider {
// This = class {
// show/*FIND ALL REFS*/[|show|]() { }
// [|show|]/*FIND ALL REFS*/() { }
// }
// m() { }
// }
Expand All @@ -38,7 +38,7 @@

// namespace NPR {
// export class Consider {
// This/*FIND ALL REFS*/[|This|] = class {
// [|This|]/*FIND ALL REFS*/ = class {
// show() { }
// }
// m() { }
Expand All @@ -51,7 +51,7 @@
// === /findAllReferencesLinkTag3.ts ===

// namespace NPR {
// export class Consider/*FIND ALL REFS*/[|Consider|] {
// export class [|Consider|]/*FIND ALL REFS*/ {
// This = class {
// show() { }
// }
Expand Down Expand Up @@ -83,7 +83,7 @@
// === findAllReferences ===
// === /findAllReferencesLinkTag3.ts ===

// namespace NPR/*FIND ALL REFS*/[|NPR|] {
// namespace [|NPR|]/*FIND ALL REFS*/ {
// export class Consider {
// This = class {
// show() { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// === findAllReferences ===
// === /bar.ts ===

// import { Foo/*FIND ALL REFS*/[|Foo|] } from "./foo";
// import { [|Foo|]/*FIND ALL REFS*/ } from "./foo";
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// === findAllReferences ===
// === /a.ts ===

// /// <reference path="b.ts/*FIND ALL REFS*/" />
// /// <reference types="globals" />




// === findAllReferences ===
// === /a.ts ===

// /// <reference path="b.ts" />
// /// <reference types="globals/*FIND ALL REFS*/" />
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
// === /findAllRefsEnumMember.ts ===

// enum E { [|A|], B }
// const e: E.A = E./*FIND ALL REFS*/[|A|] = E.[|A|];
// const e: E.[|A|] = E./*FIND ALL REFS*/[|A|];
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// === findAllReferences ===
// === /file1.ts ===

// var foo = function foo(a = /*FIND ALL REFS*/[|foo|](a = [|foo|](), b = () => [|foo|]) {
// var foo = function [|foo|](a = /*FIND ALL REFS*/[|foo|](), b = () => [|foo|]) {
// [|foo|]([|foo|], [|foo|]);
// }

Expand All @@ -31,7 +31,7 @@
// === findAllReferences ===
// === /file1.ts ===

// var foo = function foo(a = foo(), b = () => /*FIND ALL REFS*/[|foo|](a = [|foo|](), b = () => [|foo|]) {
// var foo = function [|foo|](a = [|foo|](), b = () => /*FIND ALL REFS*/[|foo|]) {
// [|foo|]([|foo|], [|foo|]);
// }

Expand All @@ -52,7 +52,7 @@
// === /file1.ts ===

// var foo = function [|foo|](a = [|foo|](), b = () => [|foo|]) {
// foo(/*FIND ALL REFS*/[|foo|]([|foo|], [|foo|]);
// [|foo|](/*FIND ALL REFS*/[|foo|], [|foo|]);
// }


Expand All @@ -62,5 +62,5 @@
// === /file1.ts ===

// var foo = function [|foo|](a = [|foo|](), b = () => [|foo|]) {
// foo(foo, /*FIND ALL REFS*/[|foo|]([|foo|], [|foo|]);
// [|foo|]([|foo|], /*FIND ALL REFS*/[|foo|]);
// }
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// === findAllReferences ===
// === /app.ts ===

// export function he/*FIND ALL REFS*/[|hello|]() {};
// export function [|he/*FIND ALL REFS*/llo|]() {};


// === /direct-use.ts ===
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// === findAllReferences ===
// === /app.ts ===

// export function he/*FIND ALL REFS*/[|hello|]() {};
// export function [|he/*FIND ALL REFS*/llo|]() {};


// === /indirect-use.ts ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
// === /findAllRefsInsideTemplates1.ts ===

// var [|x|] = 10;
// var y = `${ x } ${ /*FIND ALL REFS*/[|x|] } ${ [|x|] }`
// var y = `${ [|x|] } ${ /*FIND ALL REFS*/[|x|] }`
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// === /findAllRefsInsideTemplates2.ts ===

// function [|f|](...rest: any[]) { }
// f `${ /*FIND ALL REFS*/[|f|] `${ [|f|] } ${ [|f|] }`
// [|f|] `${ /*FIND ALL REFS*/[|f|] } ${ [|f|] }`



Expand All @@ -38,4 +38,4 @@
// === /findAllRefsInsideTemplates2.ts ===

// function [|f|](...rest: any[]) { }
// f `${ f } ${ /*FIND ALL REFS*/[|f|] `${ [|f|] } ${ [|f|] }`
// [|f|] `${ [|f|] } ${ /*FIND ALL REFS*/[|f|] }`
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
// y++; // also reference for y should be ignored
// }
//
// x = /*FIND ALL REFS*/[|x|] = [|x|] + 1;
// [|x|] = /*FIND ALL REFS*/[|x|] + 1;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// declare function [|foo|](a: number): number;
// declare function [|foo|](a: string): string;
// declare function foo/*FIND ALL REFS*/[|foo|](a: string | number): string | number;
// declare function [|foo|]/*FIND ALL REFS*/(a: string | number): string | number;
//
// function foon(a: number): number;
// function foon(a: string): string;
Expand All @@ -29,7 +29,7 @@
//
// function [|foon|](a: number): number;
// function [|foon|](a: string): string;
// function foon/*FIND ALL REFS*/[|foon|](a: string | number): string | number {
// function [|foon|]/*FIND ALL REFS*/(a: string | number): string | number {
// return a
// }
//
Expand All @@ -49,7 +49,7 @@
//
// foo; foon;
//
// export const bar/*FIND ALL REFS*/[|bar|] = 123;
// export const [|bar|]/*FIND ALL REFS*/ = 123;
// console.log({ [|bar|] });
//
// interface IFoo {
Expand All @@ -66,7 +66,7 @@
// console.log({ bar });
//
// interface IFoo {
// foo/*FIND ALL REFS*/[|foo|](): void;
// [|foo|]/*FIND ALL REFS*/(): void;
// }
// class Foo implements IFoo {
// constructor(n: number)
Expand Down Expand Up @@ -110,6 +110,6 @@
// constructor(n: number)
// constructor()
// constructor(n: number?) { }
// foo/*FIND ALL REFS*/[|foo|](): void { }
// [|foo|]/*FIND ALL REFS*/(): void { }
// static init() { return new this() }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// */
//
// /**
// * @param { A/*FIND ALL REFS*/[|A|] } a
// * @param { [|A|]/*FIND ALL REFS*/ } a
// */
// function f(a) {}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// import [|Component|] from './component.js';
//
// /**
// * @extends Component/*FIND ALL REFS*/[|Component|]
// * @extends [|Component|]/*FIND ALL REFS*/
// */
// export class Player extends [|Component|] {}

Expand Down
Loading
Loading