diff --git a/.golangci.yml b/.golangci.yml
index 373793aa33..1db330cfe6 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -63,6 +63,10 @@ linters:
type: module
exclusions:
+ rules:
+ - path: internal/fourslash/tests/gen/
+ linters: misspell
+
presets:
- comments
- std-error-handling
diff --git a/internal/collections/multimap.go b/internal/collections/multimap.go
index 6da7638181..51029e8c0a 100644
--- a/internal/collections/multimap.go
+++ b/internal/collections/multimap.go
@@ -10,6 +10,14 @@ type MultiMap[K comparable, V comparable] struct {
M map[K][]V
}
+func GroupBy[K comparable, V comparable](items []V, groupId func(V) K) *MultiMap[K, V] {
+ m := &MultiMap[K, V]{}
+ for _, item := range items {
+ m.Add(groupId(item), item)
+ }
+ return m
+}
+
func (s *MultiMap[K, V]) Has(key K) bool {
_, ok := s.M[key]
return ok
diff --git a/internal/fourslash/_scripts/convertFourslash.mts b/internal/fourslash/_scripts/convertFourslash.mts
index e68d0621a4..1ad7ea20d8 100644
--- a/internal/fourslash/_scripts/convertFourslash.mts
+++ b/internal/fourslash/_scripts/convertFourslash.mts
@@ -72,7 +72,7 @@ function parseFileContent(filename: string, content: string): GoTest | undefined
const sourceFile = ts.createSourceFile("temp.ts", content, ts.ScriptTarget.Latest, true /*setParentNodes*/);
const statements = sourceFile.statements;
const goTest: GoTest = {
- name: filename.replace(".ts", ""),
+ name: filename.replace(".ts", "").replace(".", ""),
content: getTestInput(content),
commands: [],
};
@@ -141,9 +141,16 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined {
console.error(`Expected identifiers for namespace and function, got ${namespace.getText()} and ${func.getText()}`);
return undefined;
}
- // `verify.completions(...)`
- if (namespace.text === "verify" && func.text === "completions") {
- return parseVerifyCompletionsArgs(callExpression.arguments);
+ // `verify.(...)`
+ if (namespace.text === "verify") {
+ switch (func.text) {
+ case "completions":
+ // `verify.completions(...)`
+ return parseVerifyCompletionsArgs(callExpression.arguments);
+ case "baselineFindAllReferences":
+ // `verify.baselineFindAllReferences(...)`
+ return [parseBaselineFindAllReferencesArgs(callExpression.arguments)];
+ }
}
// `goTo....`
if (namespace.text === "goTo") {
@@ -606,6 +613,27 @@ function parseExpectedCompletionItem(expr: ts.Expression): string | undefined {
return undefined; // Unsupported expression type
}
+function parseBaselineFindAllReferencesArgs(args: readonly ts.Expression[]): VerifyBaselineFindAllReferencesCmd {
+ const newArgs = [];
+ for (const arg of args) {
+ if (ts.isStringLiteral(arg)) {
+ newArgs.push(getGoStringLiteral(arg.text));
+ }
+ else if (arg.getText() === "...test.ranges()") {
+ return {
+ kind: "verifyBaselineFindAllReferences",
+ markers: [],
+ ranges: true,
+ };
+ }
+ }
+
+ return {
+ kind: "verifyBaselineFindAllReferences",
+ markers: newArgs,
+ };
+}
+
function parseKind(expr: ts.Expression): string | undefined {
if (!ts.isStringLiteral(expr)) {
console.error(`Expected string literal for kind, got ${expr.getText()}`);
@@ -732,6 +760,18 @@ interface VerifyCompletionsArgs {
unsorted?: string;
}
+interface VerifyBaselineFindAllReferencesCmd {
+ kind: "verifyBaselineFindAllReferences";
+ markers: string[];
+ ranges?: boolean;
+}
+
+interface VerifyBaselineFindAllReferencesCmd {
+ kind: "verifyBaselineFindAllReferences";
+ markers: string[];
+ ranges?: boolean;
+}
+
interface GoToCmd {
kind: "goTo";
// !!! `selectRange` and `rangeStart` require parsing variables and `test.ranges()[n]`
@@ -744,7 +784,7 @@ interface EditCmd {
goStatement: string;
}
-type Cmd = VerifyCompletionsCmd | GoToCmd | EditCmd;
+type Cmd = VerifyCompletionsCmd | VerifyBaselineFindAllReferencesCmd | GoToCmd | EditCmd;
function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: VerifyCompletionsCmd): string {
let expectedList = "nil";
@@ -770,6 +810,13 @@ function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: Ve
return `f.VerifyCompletions(t, ${marker}, ${expectedList})`;
}
+function generateBaselineFindAllReferences({ markers, ranges }: VerifyBaselineFindAllReferencesCmd): string {
+ if (ranges || markers.length === 0) {
+ return `f.VerifyBaselineFindAllReferences(t)`;
+ }
+ return `f.VerifyBaselineFindAllReferences(t, ${markers.join(", ")})`;
+}
+
function generateGoToCommand({ funcName, args }: GoToCmd): string {
const funcNameCapitalized = funcName.charAt(0).toUpperCase() + funcName.slice(1);
return `f.GoTo${funcNameCapitalized}(t, ${args.join(", ")})`;
@@ -779,6 +826,8 @@ function generateCmd(cmd: Cmd): string {
switch (cmd.kind) {
case "verifyCompletions":
return generateVerifyCompletions(cmd as VerifyCompletionsCmd);
+ case "verifyBaselineFindAllReferences":
+ return generateBaselineFindAllReferences(cmd as VerifyBaselineFindAllReferencesCmd);
case "goTo":
return generateGoToCommand(cmd as GoToCmd);
case "edit":
diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt
index 2be75089f2..6c6a2c6860 100644
--- a/internal/fourslash/_scripts/failingTests.txt
+++ b/internal/fourslash/_scripts/failingTests.txt
@@ -154,6 +154,18 @@ TestCompletionsTriggerCharacter
TestCompletionsUniqueSymbol1
TestCompletionsWithStringReplacementMode1
TestExportEqualCallableInterface
+TestFindAllReferencesTripleSlash
+TestFindAllRefs_importType_typeofImport
+TestFindAllRefsCommonJsRequire
+TestFindAllRefsCommonJsRequire2
+TestFindAllRefsCommonJsRequire3
+TestFindAllRefsExportEquals
+TestFindAllRefsForDefaultExport03
+TestFindAllRefsJsDocImportTag
+TestFindAllRefsModuleDotExports
+TestFindAllRefsReExport_broken
+TestFindAllReferencesUmdModuleAsGlobalConst
+TestFindReferencesAfterEdit
TestGetJavaScriptCompletions1
TestGetJavaScriptCompletions10
TestGetJavaScriptCompletions11
@@ -209,6 +221,7 @@ TestJsDocFunctionSignatures3
TestJsDocGenerics1
TestJsdocExtendsTagCompletion
TestJsdocImplementsTagCompletion
+TestJsdocLink_findAllReferences1
TestJsdocOverloadTagCompletion
TestJsdocParamTagSpecialKeywords
TestJsdocParameterNameCompletion
@@ -223,6 +236,8 @@ TestJsdocTypedefTag2
TestJsdocTypedefTagNamespace
TestJsdocTypedefTagTypeExpressionCompletion
TestJsxAriaLikeCompletions
+TestJsxFindAllReferencesOnRuntimeImportWithPaths1
+TestLocalGetReferences
TestJsxQualifiedTagCompletion
TestMemberListErrorRecovery
TestMemberListInWithBlock
@@ -277,6 +292,11 @@ TestPathCompletionsTypesVersionsWildcard3
TestPathCompletionsTypesVersionsWildcard4
TestPathCompletionsTypesVersionsWildcard5
TestPathCompletionsTypesVersionsWildcard6
+TestReferencesForExportedValues
+TestReferencesInComment
+TestReferencesInEmptyFile
+TestReferencesForStatementKeywords
+TestReferencesIsAvailableThroughGlobalNoCrash
TestStringCompletionsImportOrExportSpecifier
TestStringCompletionsVsEscaping
TestStringLiteralTypeCompletionsInTypeArgForNonGeneric1
@@ -286,6 +306,7 @@ TestTripleSlashRefPathCompletionExtensionsAllowJSFalse
TestTripleSlashRefPathCompletionExtensionsAllowJSTrue
TestTripleSlashRefPathCompletionHiddenFile
TestTripleSlashRefPathCompletionRootdirs
+TestTslibFindAllReferencesOnRuntimeImportWithPaths1
TestTsxCompletion12
TestTsxCompletion13
TestTsxCompletion14
diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go
new file mode 100644
index 0000000000..db05e77a81
--- /dev/null
+++ b/internal/fourslash/baselineutil.go
@@ -0,0 +1,459 @@
+package fourslash
+
+import (
+ "errors"
+ "fmt"
+ "io/fs"
+ "regexp"
+ "slices"
+ "strings"
+
+ "github.com/microsoft/typescript-go/internal/collections"
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/ls"
+ "github.com/microsoft/typescript-go/internal/lsp/lsproto"
+ "github.com/microsoft/typescript-go/internal/vfs"
+)
+
+type baselineFromTest struct {
+ content *strings.Builder
+
+ baselineName, ext string
+}
+
+func (b *baselineFromTest) addResult(command, actual string) {
+ // state.baseline(command, actual) in strada
+ if b.content.Len() != 0 {
+ b.content.WriteString("\n\n\n\n")
+ }
+ b.content.WriteString(`// === ` + command + " ===\n" + actual)
+}
+
+func (b *baselineFromTest) getBaselineFileName() string {
+ return "fourslash/" + b.baselineName + b.ext
+}
+
+type baselineFourslashLocationsOptions struct {
+ // markerInfo
+ marker *Marker // location
+ markerName string // name of the marker to be printed in baseline
+
+ documentSpanId func(span *documentSpan) string
+ skipDocumentSpanDetails core.Tristate
+ skipDocumentContainingOnlyMarker core.Tristate
+ endMarker core.Tristate
+
+ startMarkerPrefix func(span lsproto.Location) string
+ endMarkerSuffix func(span lsproto.Location) string
+ ignoredDocumentSpanProperties []string
+ additionalSpan *lsproto.Location
+}
+
+func (f *FourslashTest) getBaselineForLocationsWithFileContents(spans []*lsproto.Location, options baselineFourslashLocationsOptions) string {
+ return f.getBaselineForGroupedLocationsWithFileContents(collections.GroupBy(spans, func(span *lsproto.Location) lsproto.DocumentUri { return span.Uri }), options)
+}
+
+func (f *FourslashTest) getBaselineForGroupedLocationsWithFileContents(groupedLocations *collections.MultiMap[lsproto.DocumentUri, *lsproto.Location], options baselineFourslashLocationsOptions) string {
+ baselineEntries := []string{}
+ err := f.vfs.WalkDir("/", func(path string, d vfs.DirEntry, e error) error {
+ if e != nil {
+ return e
+ }
+
+ if !d.Type().IsRegular() {
+ return nil
+ }
+
+ locations := groupedLocations.Get(ls.FileNameToDocumentURI(path))
+ if len(locations) == 0 {
+ return nil
+ }
+
+ content, ok := f.vfs.ReadFile(path)
+ if !ok {
+ return nil
+ }
+
+ documentSpans := core.Map(locations, func(location *lsproto.Location) *documentSpan {
+ return &documentSpan{
+ Location: *location,
+ }
+ })
+ baselineEntries = append(baselineEntries, f.getBaselineContentForFile(path, content, documentSpans, nil, options))
+ return nil
+ })
+
+ if err != nil && !errors.Is(err, fs.ErrNotExist) {
+ panic("walkdir error during fourslash baseline: " + err.Error())
+ }
+ // !!! foundMarker
+ // !!! foundAdditionalSpan
+ // !!! skipDocumentContainingOnlyMarker
+
+ return strings.Join(baselineEntries, "\n\n")
+}
+
+type documentSpan struct {
+ lsproto.Location
+
+ // If the span represents a location that was remapped (e.g. via a .d.ts.map file),
+ // then the original filename and span will be specified here
+ originalLocation *lsproto.Location
+
+ // If DocumentSpan.textSpan is the span for name of the declaration,
+ // then this is the span for relevant declaration
+ contextSpan *lsproto.Location
+ originalContextSpan *lsproto.Location
+}
+
+type baselineDetail struct {
+ pos lsproto.Position
+ positionMarker string
+ span *documentSpan
+ kind string
+}
+
+func (f *FourslashTest) getBaselineContentForFile(
+ fileName string,
+ content string,
+ spansInFile []*documentSpan,
+ spanToContextId map[documentSpan]int,
+ options baselineFourslashLocationsOptions,
+) string {
+ details := []*baselineDetail{}
+ detailPrefixes := map[baselineDetail]string{}
+ detailSuffixes := map[baselineDetail]string{}
+ canDetermineContextIdInline := true
+ var groupedSpanForAdditionalSpan *documentSpan
+
+ if options.marker != nil && options.marker.FileName() == fileName {
+ details = append(details, &baselineDetail{pos: options.marker.LSPosition, positionMarker: options.markerName})
+ }
+
+ for _, span := range spansInFile {
+ contextSpanIndex := len(details)
+ if span.contextSpan != nil {
+ details = append(details, &baselineDetail{pos: span.contextSpan.Range.Start, positionMarker: "<|", span: span, kind: "contextStart"})
+ if canDetermineContextIdInline && ls.ComparePositions(span.contextSpan.Range.Start, span.Range.Start) > 0 {
+ // Need to do explicit pass to determine contextId since contextId starts after textStart
+ canDetermineContextIdInline = false
+ }
+ }
+
+ textSpanIndex := len(details)
+ textSpanEnd := span.Range.End
+ details = append(details,
+ &baselineDetail{pos: span.Range.Start, positionMarker: "[|", span: span, kind: "textStart"},
+ &baselineDetail{pos: span.Range.End, positionMarker: "|]", span: span, kind: "textEnd"},
+ )
+
+ var contextSpanEnd *lsproto.Position
+ if span.contextSpan != nil {
+ contextSpanEnd = &span.contextSpan.Range.End
+ details = append(details, &baselineDetail{pos: span.contextSpan.Range.End, positionMarker: "|>", span: span, kind: "contextEnd"})
+ }
+
+ if options.additionalSpan != nil && span.Location == *options.additionalSpan {
+ groupedSpanForAdditionalSpan = span
+ }
+
+ if options.startMarkerPrefix != nil {
+ if startPrefix := options.startMarkerPrefix(span.Location); startPrefix != "" {
+ if fileName == options.marker.FileName() && span.Range.Start == options.marker.LSPosition {
+ // ts.Debug.assert(!detailPrefixes.has(details[0]), "Expected only single prefix at marker location");
+ detailPrefixes[*details[0]] = startPrefix
+ } else if span.contextSpan.Range.Start == span.Range.Start {
+ // Write it at contextSpan instead of textSpan
+ detailPrefixes[*details[contextSpanIndex]] = startPrefix
+ } else {
+ // At textSpan
+ detailPrefixes[*details[textSpanIndex]] = startPrefix
+ }
+ }
+ }
+
+ if options.endMarkerSuffix != nil {
+ if endSuffix := options.endMarkerSuffix(span.Location); endSuffix != "" {
+ if fileName == options.marker.FileName() && textSpanEnd == options.marker.LSPosition {
+ // ts.Debug.assert(!detailSuffixes.has(details[0]), "Expected only single suffix at marker location");
+ detailSuffixes[*details[0]] = endSuffix
+ } else if *contextSpanEnd == textSpanEnd {
+ // Write it at contextSpan instead of textSpan
+ detailSuffixes[*details[textSpanIndex+2]] = endSuffix
+ } else {
+ // At textSpan
+ detailSuffixes[*details[textSpanIndex+1]] = endSuffix
+ }
+ }
+ }
+ }
+ slices.SortStableFunc(details, func(d1, d2 *baselineDetail) int {
+ return ls.ComparePositions(d1.pos, d2.pos)
+ })
+ // !!! if canDetermineContextIdInline
+
+ textWithContext := newTextWithContext(fileName, content)
+
+ // Our preferred way to write marker is
+ // /*MARKER*/[| some text |]
+ // [| some /*MARKER*/ text |]
+ // [| some text |]/*MARKER*/
+ // Stable sort should handle first two cases but with that marker will be before rangeEnd if locations match
+ // So we will defer writing marker in this case by checking and finding index of rangeEnd if same
+ var deferredMarkerIndex *int
+ if options.documentSpanId == nil {
+ options.documentSpanId = func(span *documentSpan) string { return "" }
+ }
+
+ for index, detail := range details {
+ if detail.span == nil && deferredMarkerIndex == nil {
+ // If this is marker position and its same as textEnd and/or contextEnd we want to write marker after those
+ for matchingEndPosIndex := index + 1; matchingEndPosIndex < len(details); matchingEndPosIndex++ {
+ // Defer after the location if its same as rangeEnd
+ if details[matchingEndPosIndex].pos == detail.pos && strings.HasSuffix(details[matchingEndPosIndex].kind, "End") {
+ deferredMarkerIndex = ptrTo(matchingEndPosIndex)
+ }
+ // Dont defer further than already determined
+ break
+ }
+ // Defer writing marker position to deffered marker index
+ if deferredMarkerIndex != nil {
+ continue
+ }
+ }
+ textWithContext.add(detail)
+ textWithContext.pos = detail.pos
+ // Prefix
+ prefix := detailPrefixes[*detail]
+ if prefix != "" {
+ textWithContext.newContent.WriteString(prefix)
+ }
+ textWithContext.newContent.WriteString(detail.positionMarker)
+ if detail.span != nil {
+ switch detail.kind {
+ case "textStart":
+ var text string
+ if options.skipDocumentSpanDetails.IsTrue() {
+ text = options.documentSpanId(detail.span)
+ } else {
+ text = convertDocumentSpanToString(detail.span, options.documentSpanId(detail.span), options.ignoredDocumentSpanProperties)
+ }
+ if groupedSpanForAdditionalSpan != nil && *(detail.span) == *groupedSpanForAdditionalSpan {
+ if text == "" {
+ text = `textSpan: true`
+ } else {
+ text = `textSpan: true` + `, ` + text
+ }
+ }
+ if contextId, ok := spanToContextId[*detail.span]; ok {
+ isAfterContextStart := false
+ for textStartIndex := index - 1; textStartIndex >= 0; textStartIndex-- {
+ textStartDetail := details[textStartIndex]
+ if textStartDetail.kind == "contextStart" && textStartDetail.span == detail.span {
+ isAfterContextStart = true
+ break
+ }
+ // Marker is ok to skip over
+ if textStartDetail.span != nil {
+ break
+ }
+ }
+ // Skip contextId on span thats surrounded by context span immediately
+ if !isAfterContextStart {
+ if text == "" {
+ text = fmt.Sprintf(`contextId: %v`, contextId)
+ } else {
+ text = fmt.Sprintf(`contextId: %v`, contextId) + `, ` + text
+ }
+ }
+ }
+ if text != "" {
+ textWithContext.newContent.WriteString(`{ ` + text + ` |}`)
+ }
+ case "contextStart":
+ if canDetermineContextIdInline {
+ spanToContextId[*detail.span] = len(spanToContextId)
+ }
+ }
+
+ if deferredMarkerIndex != nil && *deferredMarkerIndex == index {
+ // Write the marker
+ textWithContext.newContent.WriteString(options.markerName)
+ deferredMarkerIndex = nil
+ detail = details[0] // Marker detail
+ }
+ }
+ if suffix, ok := detailSuffixes[*detail]; ok {
+ textWithContext.newContent.WriteString(suffix)
+ }
+ }
+ textWithContext.add(nil)
+ if textWithContext.newContent.Len() != 0 {
+ textWithContext.readableContents.WriteString("\n")
+ textWithContext.readableJsoncBaseline(textWithContext.newContent.String())
+ }
+ return textWithContext.readableContents.String()
+}
+
+func convertDocumentSpanToString(location *documentSpan, prefix string, ignoredProperties []string) string {
+ // !!!
+ return prefix
+}
+
+var lineSplitter = regexp.MustCompile(`\r?\n`)
+
+type textWithContext struct {
+ nLinesContext int // number of context lines to write to baseline
+
+ readableContents *strings.Builder // builds what will be returned to be written to baseline
+
+ newContent *strings.Builder // helper; the part of the original file content to write between details
+ pos lsproto.Position
+ isLibFile bool
+ fileName string
+ content string // content of the original file
+ lineStarts *ls.LineMap
+ converters *ls.Converters
+
+ // posLineInfo
+ posInfo *lsproto.Position
+ lineInfo int
+}
+
+// implements ls.Script
+func (t *textWithContext) FileName() string {
+ return t.fileName
+}
+
+// implements ls.Script
+func (t *textWithContext) Text() string {
+ return t.content
+}
+
+func newTextWithContext(fileName string, content string) *textWithContext {
+ t := &textWithContext{
+ nLinesContext: 4,
+
+ readableContents: &strings.Builder{},
+
+ isLibFile: regexp.MustCompile(`lib.*\.d\.ts$`).MatchString(fileName),
+ newContent: &strings.Builder{},
+ pos: lsproto.Position{Line: 0, Character: 0},
+ fileName: fileName,
+ content: content,
+ lineStarts: ls.ComputeLineStarts(content),
+ }
+
+ t.converters = ls.NewConverters(lsproto.PositionEncodingKindUTF8, func(_ string) *ls.LineMap {
+ return t.lineStarts
+ })
+ t.readableContents.WriteString("// === " + fileName + " ===\n")
+ return t
+}
+
+func (t *textWithContext) add(detail *baselineDetail) {
+ if t.content == "" && detail == nil {
+ panic("Unsupported")
+ }
+ if detail == nil || (detail.kind != "textEnd" && detail.kind != "contextEnd") {
+ // Calculate pos to location number of lines
+ posLineIndex := t.lineInfo
+ if t.posInfo == nil || *t.posInfo != t.pos {
+ posLineIndex = t.lineStarts.ComputeIndexOfLineStart(t.converters.LineAndCharacterToPosition(t, t.pos))
+ }
+
+ locationLineIndex := len(t.lineStarts.LineStarts) - 1
+ if detail != nil {
+ locationLineIndex = t.lineStarts.ComputeIndexOfLineStart(t.converters.LineAndCharacterToPosition(t, detail.pos))
+ t.posInfo = &detail.pos
+ t.lineInfo = locationLineIndex
+ }
+
+ nLines := 0
+ if t.newContent.Len() != 0 {
+ nLines += t.nLinesContext + 1
+ }
+ if detail != nil {
+ nLines += t.nLinesContext + 1
+ }
+ // first nLinesContext and last nLinesContext
+ if locationLineIndex-posLineIndex > nLines {
+ if t.newContent.Len() != 0 {
+ var skippedString string
+ if t.isLibFile {
+ skippedString = "--- (line: --) skipped ---\n"
+ } else {
+ skippedString = fmt.Sprintf(`// --- (line: %v) skipped ---`, posLineIndex+t.nLinesContext+1)
+ }
+
+ t.readableContents.WriteString("\n")
+ t.readableJsoncBaseline(t.newContent.String() + t.sliceOfContent(
+ t.getIndex(t.pos),
+ t.getIndex(t.lineStarts.LineStarts[posLineIndex+t.nLinesContext]),
+ ) + skippedString)
+
+ if detail != nil {
+ t.readableContents.WriteString("\n")
+ }
+ t.newContent.Reset()
+ }
+ if detail != nil {
+ if t.isLibFile {
+ t.newContent.WriteString("--- (line: --) skipped ---\n")
+ } else {
+ t.newContent.WriteString(fmt.Sprintf("--- (line: %v) skipped ---\n", locationLineIndex-t.nLinesContext+1))
+ }
+ t.newContent.WriteString(t.sliceOfContent(
+ t.getIndex(t.lineStarts.LineStarts[locationLineIndex-t.nLinesContext+1]),
+ t.getIndex(detail.pos),
+ ))
+ }
+ return
+ }
+ }
+ if detail == nil {
+ t.newContent.WriteString(t.sliceOfContent(t.getIndex(t.pos), nil))
+ } else {
+ t.newContent.WriteString(t.sliceOfContent(t.getIndex(t.pos), t.getIndex(detail.pos)))
+ }
+}
+
+func (t *textWithContext) readableJsoncBaseline(text string) {
+ for _, line := range lineSplitter.Split(text, -1) {
+ t.readableContents.WriteString(`// ` + line + "\n")
+ }
+}
+
+func (t *textWithContext) sliceOfContent(start *int, end *int) string {
+ if start == nil || *start < 0 {
+ start = ptrTo(0)
+ }
+
+ if end == nil || *end > len(t.content) {
+ end = ptrTo(len(t.content))
+ }
+
+ if *start > *end {
+ return ""
+ }
+
+ return t.content[*start:*end]
+}
+
+func (t *textWithContext) getIndex(i interface{}) *int {
+ switch i.(type) {
+ case *int:
+ return i.(*int)
+ case int:
+ return ptrTo(i.(int))
+ case core.TextPos:
+ return ptrTo(int(i.(core.TextPos)))
+ case *core.TextPos:
+ return ptrTo(int(*i.(*core.TextPos)))
+ case lsproto.Position:
+ return t.getIndex(t.converters.LineAndCharacterToPosition(t, i.(lsproto.Position)))
+ case *lsproto.Position:
+ return t.getIndex(t.converters.LineAndCharacterToPosition(t, *i.(*lsproto.Position)))
+ }
+ panic(fmt.Sprintf("getIndex: unsupported type %T", i))
+}
diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go
index 584a5fa6a0..3172f26637 100644
--- a/internal/fourslash/fourslash.go
+++ b/internal/fourslash/fourslash.go
@@ -19,6 +19,7 @@ import (
"github.com/microsoft/typescript-go/internal/lsp"
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
"github.com/microsoft/typescript-go/internal/project"
+ "github.com/microsoft/typescript-go/internal/testutil/baseline"
"github.com/microsoft/typescript-go/internal/testutil/harnessutil"
"github.com/microsoft/typescript-go/internal/tspath"
"github.com/microsoft/typescript-go/internal/vfs"
@@ -34,6 +35,7 @@ type FourslashTest struct {
vfs vfs.FS
testData *TestData // !!! consolidate test files from test data and script info
+ baseline *baselineFromTest
scriptInfos map[string]*scriptInfo
converters *ls.Converters
@@ -296,6 +298,11 @@ func (f *FourslashTest) readMsg(t *testing.T) *lsproto.Message {
return msg
}
+func (f *FourslashTest) GoToMarkerOrRange(t *testing.T, markerOrRange MarkerOrRange) {
+ // GoToRangeStart
+ f.goToMarker(t, markerOrRange.GetMarker())
+}
+
func (f *FourslashTest) GoToMarker(t *testing.T, markerName string) {
marker, ok := f.testData.MarkerPositions[markerName]
if !ok {
@@ -305,7 +312,7 @@ func (f *FourslashTest) GoToMarker(t *testing.T, markerName string) {
}
func (f *FourslashTest) goToMarker(t *testing.T, marker *Marker) {
- f.ensureActiveFile(t, marker.FileName)
+ f.ensureActiveFile(t, marker.FileName())
f.goToPosition(t, marker.LSPosition)
f.lastKnownMarkerName = marker.Name
}
@@ -361,7 +368,7 @@ func (f *FourslashTest) GoToEachRange(t *testing.T, action func(t *testing.T, ra
}
func (f *FourslashTest) GoToRangeStart(t *testing.T, rangeMarker *RangeMarker) {
- f.openFile(t, rangeMarker.FileName)
+ f.openFile(t, rangeMarker.FileName())
f.goToPosition(t, rangeMarker.LSRange.Start)
}
@@ -374,10 +381,10 @@ func (f *FourslashTest) GoToSelect(t *testing.T, startMarkerName string, endMark
if endMarker == nil {
t.Fatalf("End marker '%s' not found", endMarkerName)
}
- if startMarker.FileName != endMarker.FileName {
+ if startMarker.FileName() != endMarker.FileName() {
t.Fatalf("Markers '%s' and '%s' are in different files", startMarkerName, endMarkerName)
}
- f.ensureActiveFile(t, startMarker.FileName)
+ f.ensureActiveFile(t, startMarker.FileName())
f.goToPosition(t, startMarker.LSPosition)
f.selectionEnd = &endMarker.LSPosition
}
@@ -429,6 +436,15 @@ func (f *FourslashTest) openFile(t *testing.T, filename string) {
})
}
+func (f *FourslashTest) currentTextDocumentPositionParams() lsproto.TextDocumentPositionParams {
+ return lsproto.TextDocumentPositionParams{
+ TextDocument: lsproto.TextDocumentIdentifier{
+ Uri: ls.FileNameToDocumentURI(f.activeFilename),
+ },
+ Position: f.currentCaretPosition,
+ }
+}
+
func getLanguageKind(filename string) lsproto.LanguageKind {
if tspath.FileExtensionIsOneOf(
filename,
@@ -522,13 +538,8 @@ func (f *FourslashTest) verifyCompletionsWorker(t *testing.T, expected *Completi
prefix = fmt.Sprintf("At position (Ln %d, Col %d): ", f.currentCaretPosition.Line, f.currentCaretPosition.Character)
}
params := &lsproto.CompletionParams{
- TextDocumentPositionParams: lsproto.TextDocumentPositionParams{
- TextDocument: lsproto.TextDocumentIdentifier{
- Uri: ls.FileNameToDocumentURI(f.activeFilename),
- },
- Position: f.currentCaretPosition,
- },
- Context: &lsproto.CompletionContext{},
+ TextDocumentPositionParams: f.currentTextDocumentPositionParams(),
+ Context: &lsproto.CompletionContext{},
}
resMsg := f.sendRequest(t, lsproto.MethodTextDocumentCompletion, params)
if resMsg == nil {
@@ -744,6 +755,71 @@ func assertDeepEqual(t *testing.T, actual any, expected any, prefix string, opts
}
}
+func (f *FourslashTest) VerifyBaselineFindAllReferences(
+ t *testing.T,
+ markers ...string,
+) {
+ // if there are no markers specified, use all ranges
+ var referenceLocations []MarkerOrRange
+ if len(markers) == 0 {
+ referenceLocations = core.Map(f.testData.Ranges, func(r *RangeMarker) MarkerOrRange { return r })
+ } else {
+ referenceLocations = core.Map(markers, func(markerName string) MarkerOrRange {
+ marker, ok := f.testData.MarkerPositions[markerName]
+ if !ok {
+ t.Fatalf("Marker '%s' not found", markerName)
+ }
+ return marker
+ })
+ }
+
+ if f.baseline != nil {
+ t.Fatalf("Error during test '%s': Another baseline is already in progress", t.Name())
+ } else {
+ f.baseline = &baselineFromTest{
+ content: &strings.Builder{},
+ baselineName: "findAllRef/" + strings.TrimPrefix(t.Name(), "Test"),
+ ext: ".baseline.jsonc",
+ }
+ }
+
+ // empty baseline after test completes
+ defer func() {
+ f.baseline = nil
+ }()
+
+ for _, markerOrRange := range referenceLocations {
+ // worker in `baselineEachMarkerOrRange`
+ f.GoToMarkerOrRange(t, markerOrRange)
+ params := &lsproto.ReferenceParams{
+ TextDocumentPositionParams: f.currentTextDocumentPositionParams(),
+ Context: &lsproto.ReferenceContext{},
+ }
+ resMsg := f.sendRequest(t, lsproto.MethodTextDocumentReferences, params)
+ if resMsg == nil {
+ if f.lastKnownMarkerName == nil {
+ t.Fatalf("Unexpected references response type at pos %v", f.currentCaretPosition)
+ } else {
+ t.Fatalf("Nil response received for references request at marker '%s'", *f.lastKnownMarkerName)
+ }
+ }
+ result := resMsg.AsResponse().Result
+ if result, ok := result.([]*lsproto.Location); ok {
+ f.baseline.addResult("findAllReferences", f.getBaselineForLocationsWithFileContents(result, baselineFourslashLocationsOptions{
+ marker: markerOrRange.GetMarker(),
+ markerName: "/*FIND ALL REFS*/",
+ }))
+ } else {
+ if f.lastKnownMarkerName == nil {
+ t.Fatalf("Unexpected references response type at pos %v: %T", f.currentCaretPosition, result)
+ } else {
+ t.Fatalf("Unexpected references response type at marker '%s': %T", *f.lastKnownMarkerName, result)
+ }
+ }
+ }
+ baseline.Run(t, f.baseline.getBaselineFileName(), f.baseline.content.String(), baseline.Options{})
+}
+
func ptrTo[T any](v T) *T {
return &v
}
@@ -856,13 +932,13 @@ func (f *FourslashTest) typeText(t *testing.T, text string) {
func (f *FourslashTest) editScriptAndUpdateMarkers(t *testing.T, fileName string, editStart int, editEnd int, newText string) {
script := f.editScript(t, fileName, editStart, editEnd, newText)
for _, marker := range f.testData.Markers {
- if marker.FileName == fileName {
+ if marker.FileName() == fileName {
marker.Position = updatePosition(marker.Position, editStart, editEnd, newText)
marker.LSPosition = f.converters.PositionToLineAndCharacter(script, core.TextPos(marker.Position))
}
}
for _, rangeMarker := range f.testData.Ranges {
- if rangeMarker.FileName == fileName {
+ if rangeMarker.FileName() == fileName {
start := updatePosition(rangeMarker.Range.Pos(), editStart, editEnd, newText)
end := updatePosition(rangeMarker.Range.End(), editStart, editEnd, newText)
rangeMarker.Range = core.NewTextRange(start, end)
diff --git a/internal/fourslash/test_parser.go b/internal/fourslash/test_parser.go
index cfd39fb180..12cef16d67 100644
--- a/internal/fourslash/test_parser.go
+++ b/internal/fourslash/test_parser.go
@@ -27,14 +27,44 @@ type RangeMarker struct {
LSRange lsproto.Range
}
+func (r *RangeMarker) LSPos() lsproto.Position {
+ return r.LSRange.Start
+}
+
+func (r *RangeMarker) FileName() string {
+ return r.fileName
+}
+
+func (r *RangeMarker) GetMarker() *Marker {
+ return r.Marker
+}
+
type Marker struct {
- FileName string
+ fileName string
Position int
LSPosition lsproto.Position
Name *string // `nil` for anonymous markers such as `{| "foo": "bar" |}`
Data map[string]interface{}
}
+func (m *Marker) LSPos() lsproto.Position {
+ return m.LSPosition
+}
+
+func (m *Marker) FileName() string {
+ return m.fileName
+}
+
+func (m *Marker) GetMarker() *Marker {
+ return m
+}
+
+type MarkerOrRange interface {
+ FileName() string
+ LSPos() lsproto.Position
+ GetMarker() *Marker
+}
+
type TestData struct {
Files []*TestFileInfo
MarkerPositions map[string]*Marker
@@ -76,10 +106,14 @@ func ParseTestData(t *testing.T, contents string, fileName string) TestData {
ranges = append(ranges, file.ranges...)
for _, marker := range file.markers {
if marker.Name == nil {
- continue
+ if marker.Data != nil {
+ // The marker is an anonymous object marker, which does not need a name. Markers are only set into markerPositions if they have a name
+ continue
+ }
+ t.Fatalf(`Marker at position %v is unnamed`, marker.Position)
}
- if _, ok := markerPositions[*marker.Name]; ok {
- t.Fatalf("Duplicate marker name: '%s'", *marker.Name)
+ if existing, ok := markerPositions[*marker.Name]; ok {
+ t.Fatalf(`Duplicate marker name: "%s" at %v and %v`, *marker.Name, marker.Position, existing.Position)
}
markerPositions[*marker.Name] = marker
}
@@ -214,8 +248,10 @@ func parseFileContent(fileName string, content string, fileOptions map[string]st
if rangeStart.marker != nil {
closedRange.Marker = rangeStart.marker
} else {
- // RangeMarker is not added to list of markers
- closedRange.Marker = &Marker{FileName: fileName}
+ // A default RangeMarker is not added to list of markers. If the RangeMarker was created by parsing an actual marker within the range
+ // in the test file, then the marker should have been added to the marker list when the marker was parsed.
+ // Similarly, if the RangeMarker has a name, this means that there was a named marker parsed within the range (and has been already included in the marker list)
+ closedRange.Marker = &Marker{fileName: fileName}
}
rangeMarkers = append(rangeMarkers, closedRange)
@@ -272,7 +308,7 @@ func parseFileContent(fileName string, content string, fileOptions map[string]st
// start + 2 to ignore the */, -1 on the end to ignore the * (/ is next)
markerNameText := strings.TrimSpace(content[openMarker.sourcePosition+2 : i-1])
marker := &Marker{
- FileName: fileName,
+ fileName: fileName,
Position: openMarker.position,
Name: &markerNameText,
}
@@ -375,7 +411,7 @@ func getObjectMarker(fileName string, location *locationInformation, text string
}
marker := &Marker{
- FileName: fileName,
+ fileName: fileName,
Position: location.position,
Data: markerValue,
}
diff --git a/internal/fourslash/tests/gen/ambientShorthandFindAllRefs_test.go b/internal/fourslash/tests/gen/ambientShorthandFindAllRefs_test.go
new file mode 100644
index 0000000000..80de763eed
--- /dev/null
+++ b/internal/fourslash/tests/gen/ambientShorthandFindAllRefs_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestAmbientShorthandFindAllRefs(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: declarations.d.ts
+declare module "jquery";
+// @Filename: user.ts
+import {/*1*/x} from "jquery";
+// @Filename: user2.ts
+import {/*2*/x} from "jquery";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/autoImportProvider_referencesCrash_test.go b/internal/fourslash/tests/gen/autoImportProvider_referencesCrash_test.go
new file mode 100644
index 0000000000..4189016e57
--- /dev/null
+++ b/internal/fourslash/tests/gen/autoImportProvider_referencesCrash_test.go
@@ -0,0 +1,44 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestAutoImportProvider_referencesCrash(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/a/package.json
+{}
+// @Filename: /home/src/workspaces/project/a/tsconfig.json
+{}
+// @Filename: /home/src/workspaces/project/a/index.ts
+class A {}
+// @Filename: /home/src/workspaces/project/a/index.d.ts
+declare class A {
+}
+//# sourceMappingURL=index.d.ts.map
+// @Filename: /home/src/workspaces/project/a/index.d.ts.map
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;CAAG"}
+// @Filename: /home/src/workspaces/project/b/tsconfig.json
+{
+ "compilerOptions": { "disableSourceOfProjectReferenceRedirect": true },
+ "references": [{ "path": "../a" }]
+}
+// @Filename: /home/src/workspaces/project/b/b.ts
+///
+new A/**/();
+// @Filename: /home/src/workspaces/project/c/package.json
+{ "dependencies": { "a": "*" } }
+// @Filename: /home/src/workspaces/project/c/tsconfig.json
+{ "references" [{ "path": "../a" }] }
+// @Filename: /home/src/workspaces/project/c/index.ts
+export {};
+// @link: /home/src/workspaces/project/a -> /home/src/workspaces/project/c/node_modules/a`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.GoToFile(t, "/home/src/workspaces/project/c/index.ts")
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/constructorFindAllReferences1_test.go b/internal/fourslash/tests/gen/constructorFindAllReferences1_test.go
new file mode 100644
index 0000000000..79bf77e4da
--- /dev/null
+++ b/internal/fourslash/tests/gen/constructorFindAllReferences1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestConstructorFindAllReferences1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `export class C {
+ /**/public constructor() { }
+ public foo() { }
+}
+
+new C().foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/constructorFindAllReferences2_test.go b/internal/fourslash/tests/gen/constructorFindAllReferences2_test.go
new file mode 100644
index 0000000000..9c98352fd9
--- /dev/null
+++ b/internal/fourslash/tests/gen/constructorFindAllReferences2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestConstructorFindAllReferences2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `export class C {
+ /**/private constructor() { }
+ public foo() { }
+}
+
+new C().foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/constructorFindAllReferences3_test.go b/internal/fourslash/tests/gen/constructorFindAllReferences3_test.go
new file mode 100644
index 0000000000..82d393dde4
--- /dev/null
+++ b/internal/fourslash/tests/gen/constructorFindAllReferences3_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestConstructorFindAllReferences3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `export class C {
+ /**/constructor() { }
+ public foo() { }
+}
+
+new C().foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/constructorFindAllReferences4_test.go b/internal/fourslash/tests/gen/constructorFindAllReferences4_test.go
new file mode 100644
index 0000000000..35fecd29e4
--- /dev/null
+++ b/internal/fourslash/tests/gen/constructorFindAllReferences4_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestConstructorFindAllReferences4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `export class C {
+ /**/protected constructor() { }
+ public foo() { }
+}
+
+new C().foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/esModuleInteropFindAllReferences2_test.go b/internal/fourslash/tests/gen/esModuleInteropFindAllReferences2_test.go
new file mode 100644
index 0000000000..e46c646d19
--- /dev/null
+++ b/internal/fourslash/tests/gen/esModuleInteropFindAllReferences2_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestEsModuleInteropFindAllReferences2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @esModuleInterop: true
+// @Filename: /a.d.ts
+export as namespace abc;
+/*1*/export const /*2*/x: number;
+// @Filename: /b.ts
+import a from "./a";
+a./*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/esModuleInteropFindAllReferences_test.go b/internal/fourslash/tests/gen/esModuleInteropFindAllReferences_test.go
new file mode 100644
index 0000000000..439e20c8fa
--- /dev/null
+++ b/internal/fourslash/tests/gen/esModuleInteropFindAllReferences_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestEsModuleInteropFindAllReferences(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @esModuleInterop: true
+// @Filename: /abc.d.ts
+declare module "a" {
+ /*1*/export const /*2*/x: number;
+}
+// @Filename: /b.ts
+import a from "a";
+a./*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/explainFilesNodeNextWithTypesReference_test.go b/internal/fourslash/tests/gen/explainFilesNodeNextWithTypesReference_test.go
new file mode 100644
index 0000000000..e2824dca1d
--- /dev/null
+++ b/internal/fourslash/tests/gen/explainFilesNodeNextWithTypesReference_test.go
@@ -0,0 +1,52 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestExplainFilesNodeNextWithTypesReference(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /node_modules/react-hook-form/package.json
+{
+ "name": "react-hook-form",
+ "main": "dist/index.cjs.js",
+ "module": "dist/index.esm.js",
+ "types": "dist/index.d.ts",
+ "exports": {
+ "./package.json": "./package.json",
+ ".": {
+ "import": "./dist/index.esm.js",
+ "require": "./dist/index.cjs.js",
+ "types": "./dist/index.d.ts"
+ }
+ }
+}
+// @Filename: /node_modules/react-hook-form/dist/index.cjs.js
+module.exports = {};
+// @Filename: /node_modules/react-hook-form/dist/index.esm.js
+export function useForm() {}
+// @Filename: /node_modules/react-hook-form/dist/index.d.ts
+///
+export type Foo = React.Whatever;
+export function useForm(): any;
+// @Filename: /node_modules/react/index.d.ts
+declare namespace JSX {}
+declare namespace React { export interface Whatever {} }
+// @Filename: /tsconfig.json
+{
+ "compilerOptions": {
+ "module": "nodenext",
+ "explainFiles": true
+ }
+ "files": ["./index.ts"]
+}
+// @Filename: /index.ts
+import { useForm } from "react-hook-form";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferPropertyAccessExpressionHeritageClause_test.go b/internal/fourslash/tests/gen/findAllReferPropertyAccessExpressionHeritageClause_test.go
new file mode 100644
index 0000000000..9a75ab2a91
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferPropertyAccessExpressionHeritageClause_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferPropertyAccessExpressionHeritageClause(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class B {}
+function foo() {
+ return {/*1*/B: B};
+}
+class C extends (foo())./*2*/B {}
+class C1 extends foo()./*3*/B {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesDynamicImport1_test.go b/internal/fourslash/tests/gen/findAllReferencesDynamicImport1_test.go
new file mode 100644
index 0000000000..a6637254e1
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesDynamicImport1_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesDynamicImport1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: foo.ts
+export function foo() { return "foo"; }
+/*1*/import("/*2*/./foo")
+/*3*/var x = import("/*4*/./foo")`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFilteringMappedTypeProperty_test.go b/internal/fourslash/tests/gen/findAllReferencesFilteringMappedTypeProperty_test.go
new file mode 100644
index 0000000000..49fd167376
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFilteringMappedTypeProperty_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFilteringMappedTypeProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const obj = { /*1*/a: 1, b: 2 };
+const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { /*2*/a: 0 };
+filtered./*3*/a;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference1_test.go b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference1_test.go
new file mode 100644
index 0000000000..45066ee2b4
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference1_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFromLinkTagReference1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `enum E {
+ /** {@link /**/A} */
+ A
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference2_test.go b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference2_test.go
new file mode 100644
index 0000000000..c4360783cc
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference2_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFromLinkTagReference2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+enum E {
+ /** {@link /**/Foo} */
+ Foo
+}
+interface Foo {
+ foo: E.Foo;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference3_test.go b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference3_test.go
new file mode 100644
index 0000000000..07525dcfb6
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference3_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFromLinkTagReference3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @filename: a.ts
+interface Foo {
+ foo: E.Foo;
+}
+// @Filename: b.ts
+enum E {
+ /** {@link /**/Foo} */
+ Foo
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference4_test.go b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference4_test.go
new file mode 100644
index 0000000000..e8ed96c98e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference4_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFromLinkTagReference4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `enum E {
+ /** {@link /**/B} */
+ A,
+ B
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference5_test.go b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference5_test.go
new file mode 100644
index 0000000000..3df4070b1f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesFromLinkTagReference5_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesFromLinkTagReference5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `enum E {
+ /** {@link E./**/A} */
+ A
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesImportMeta_test.go b/internal/fourslash/tests/gen/findAllReferencesImportMeta_test.go
new file mode 100644
index 0000000000..0158bbc86e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesImportMeta_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesImportMeta(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// Haha that's so meta!
+
+let x = import.meta/**/;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionNew_test.go b/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionNew_test.go
new file mode 100644
index 0000000000..8eba9cbff8
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionNew_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJSDocFunctionNew(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: Foo.js
+/** @type {function (/*1*/new: string, string): string} */
+var f;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionThis_test.go b/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionThis_test.go
new file mode 100644
index 0000000000..b43075c892
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJSDocFunctionThis_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJSDocFunctionThis(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: Foo.js
+/** @type {function (this: string, string): string} */
+var f = function (s) { return /*0*/this + s; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJsDocTypeLiteral_test.go b/internal/fourslash/tests/gen/findAllReferencesJsDocTypeLiteral_test.go
new file mode 100644
index 0000000000..87a75b947b
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJsDocTypeLiteral_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJsDocTypeLiteral(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @checkJs: true
+// @Filename: foo.js
+/**
+ * @param {object} o - very important!
+ * @param {string} o.x - a thing, its ok
+ * @param {number} o.y - another thing
+ * @param {Object} o.nested - very nested
+ * @param {boolean} o.nested./*1*/great - much greatness
+ * @param {number} o.nested.times - twice? probably!??
+ */
+ function f(o) { return o.nested./*2*/great; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJsOverloadedFunctionParameter_test.go b/internal/fourslash/tests/gen/findAllReferencesJsOverloadedFunctionParameter_test.go
new file mode 100644
index 0000000000..d5f3537436
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJsOverloadedFunctionParameter_test.go
@@ -0,0 +1,34 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJsOverloadedFunctionParameter(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @checkJs: true
+// @Filename: foo.js
+/**
+ * @overload
+ * @param {number} x
+ * @returns {number}
+ *
+ * @overload
+ * @param {string} x
+ * @returns {string}
+ *
+ * @param {unknown} x
+ * @returns {unknown}
+ */
+function foo(x/*1*/) {
+ return x;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring1_test.go b/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring1_test.go
new file mode 100644
index 0000000000..4003bf2968
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring1_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJsRequireDestructuring1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @noEmit: true
+// @checkJs: true
+// @Filename: /X.js
+module.exports = { x: 1 };
+// @Filename: /Y.js
+const { /*1*/x: { y } } = require("./X");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring_test.go b/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring_test.go
new file mode 100644
index 0000000000..2312d73d17
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesJsRequireDestructuring_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesJsRequireDestructuring(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @noEmit: true
+// @checkJs: true
+// @Filename: foo.js
+module.exports = {
+ foo: '1'
+};
+// @Filename: bar.js
+const { /*1*/foo: bar } = require('./foo');`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesLinkTag1_test.go b/internal/fourslash/tests/gen/findAllReferencesLinkTag1_test.go
new file mode 100644
index 0000000000..4f3d88c462
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesLinkTag1_test.go
@@ -0,0 +1,79 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesLinkTag1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C/*7*/ {
+ m/*1*/() { }
+ n/*2*/ = 1
+ static s/*3*/() { }
+ /**
+ * {@link m}
+ * @see {m}
+ * {@link C.m}
+ * @see {C.m}
+ * {@link C#m}
+ * @see {C#m}
+ * {@link C.prototype.m}
+ * @see {C.prototype.m}
+ */
+ p() { }
+ /**
+ * {@link n}
+ * @see {n}
+ * {@link C.n}
+ * @see {C.n}
+ * {@link C#n}
+ * @see {C#n}
+ * {@link C.prototype.n}
+ * @see {C.prototype.n}
+ */
+ q() { }
+ /**
+ * {@link s}
+ * @see {s}
+ * {@link C.s}
+ * @see {C.s}
+ */
+ r() { }
+}
+
+interface I/*8*/ {
+ a/*4*/()
+ b/*5*/: 1
+ /**
+ * {@link a}
+ * @see {a}
+ * {@link I.a}
+ * @see {I.a}
+ * {@link I#a}
+ * @see {I#a}
+ */
+ c()
+ /**
+ * {@link b}
+ * @see {b}
+ * {@link I.b}
+ * @see {I.b}
+ */
+ d()
+}
+
+function nestor() {
+ /** {@link r2} */
+ function ref() { }
+ /** @see {r2} */
+ function d3() { }
+ function r2/*6*/() { }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesLinkTag2_test.go b/internal/fourslash/tests/gen/findAllReferencesLinkTag2_test.go
new file mode 100644
index 0000000000..e3ee6afd71
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesLinkTag2_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesLinkTag2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `namespace NPR/*5*/ {
+ export class Consider/*4*/ {
+ This/*3*/ = class {
+ show/*2*/() { }
+ }
+ m/*1*/() { }
+ }
+ /**
+ * @see {Consider.prototype.m}
+ * {@link Consider#m}
+ * @see {Consider#This#show}
+ * {@link Consider.This.show}
+ * @see {NPR.Consider#This#show}
+ * {@link NPR.Consider.This#show}
+ * @see {NPR.Consider#This.show} # doesn't parse trailing .
+ * @see {NPR.Consider.This.show}
+ */
+ export function ref() { }
+}
+/**
+ * {@link NPR.Consider#This#show hello hello}
+ * {@link NPR.Consider.This#show}
+ * @see {NPR.Consider#This.show} # doesn't parse trailing .
+ * @see {NPR.Consider.This.show}
+ */
+export function outerref() { }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesLinkTag3_test.go b/internal/fourslash/tests/gen/findAllReferencesLinkTag3_test.go
new file mode 100644
index 0000000000..d3e795dcd3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesLinkTag3_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesLinkTag3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `namespace NPR/*5*/ {
+ export class Consider/*4*/ {
+ This/*3*/ = class {
+ show/*2*/() { }
+ }
+ m/*1*/() { }
+ }
+ /**
+ * {@linkcode Consider.prototype.m}
+ * {@linkplain Consider#m}
+ * {@linkcode Consider#This#show}
+ * {@linkplain Consider.This.show}
+ * {@linkcode NPR.Consider#This#show}
+ * {@linkplain NPR.Consider.This#show}
+ * {@linkcode NPR.Consider#This.show} # doesn't parse trailing .
+ * {@linkcode NPR.Consider.This.show}
+ */
+ export function ref() { }
+}
+/**
+ * {@linkplain NPR.Consider#This#show hello hello}
+ * {@linkplain NPR.Consider.This#show}
+ * {@linkcode NPR.Consider#This.show} # doesn't parse trailing .
+ * {@linkcode NPR.Consider.This.show}
+ */
+export function outerref() { }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesNonExistentExportBinding_test.go b/internal/fourslash/tests/gen/findAllReferencesNonExistentExportBinding_test.go
new file mode 100644
index 0000000000..606970923a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesNonExistentExportBinding_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesNonExistentExportBinding(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /tsconfig.json
+ { "compilerOptions": { "module": "commonjs" } }
+// @filename: /bar.ts
+import { Foo/**/ } from "./foo";
+// @filename: /foo.ts
+export { Foo }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesOfConstructor_badOverload_test.go b/internal/fourslash/tests/gen/findAllReferencesOfConstructor_badOverload_test.go
new file mode 100644
index 0000000000..46c30746ef
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesOfConstructor_badOverload_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesOfConstructor_badOverload(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ /*1*/constructor(n: number);
+ /*2*/constructor(){}
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesOfConstructor_test.go b/internal/fourslash/tests/gen/findAllReferencesOfConstructor_test.go
new file mode 100644
index 0000000000..ef27ea7925
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesOfConstructor_test.go
@@ -0,0 +1,48 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesOfConstructor(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: a.ts
+export class C {
+ /*0*/constructor(n: number);
+ /*1*/constructor();
+ /*2*/constructor(n?: number){}
+ static f() {
+ this.f();
+ new this();
+ }
+}
+new C();
+const D = C;
+new D();
+// @Filename: b.ts
+import { C } from "./a";
+new C();
+// @Filename: c.ts
+import { C } from "./a";
+class D extends C {
+ constructor() {
+ super();
+ super.method();
+ }
+ method() { super(); }
+}
+class E implements C {
+ constructor() { super(); }
+}
+// @Filename: d.ts
+import * as a from "./a";
+new a.C();
+class d extends a.C { constructor() { super(); }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesOfJsonModule_test.go b/internal/fourslash/tests/gen/findAllReferencesOfJsonModule_test.go
new file mode 100644
index 0000000000..d0c3158d50
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesOfJsonModule_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesOfJsonModule(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @resolveJsonModule: true
+// @module: commonjs
+// @esModuleInterop: true
+// @Filename: /foo.ts
+/*1*/import /*2*/settings from "./settings.json";
+/*3*/settings;
+// @Filename: /settings.json
+ {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesTripleSlash_test.go b/internal/fourslash/tests/gen/findAllReferencesTripleSlash_test.go
new file mode 100644
index 0000000000..6c418d4bb6
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesTripleSlash_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+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
+declare const someAmbientGlobal: unknown;
+// @Filename: /a.ts
+///
+///
+// @Filename: /b.ts
+console.log("b.ts");
+// @Filename: /c.js
+require("./b");
+require("globals");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesUmdModuleAsGlobalConst_test.go b/internal/fourslash/tests/gen/findAllReferencesUmdModuleAsGlobalConst_test.go
new file mode 100644
index 0000000000..2000320574
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesUmdModuleAsGlobalConst_test.go
@@ -0,0 +1,49 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesUmdModuleAsGlobalConst(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /node_modules/@types/three/three-core.d.ts
+export class Vector3 {
+ constructor(x?: number, y?: number, z?: number);
+ x: number;
+ y: number;
+}
+// @Filename: /node_modules/@types/three/index.d.ts
+export * from "./three-core";
+export as namespace /*0*/THREE;
+// @Filename: /typings/global.d.ts
+import * as _THREE from '/*1*/three';
+declare global {
+ const /*2*/THREE: typeof _THREE;
+}
+// @Filename: /src/index.ts
+export const a = {};
+let v = new /*3*/THREE.Vector2();
+// @Filename: /tsconfig.json
+{
+ "compilerOptions": {
+ "esModuleInterop": true,
+ "outDir": "./build/js/",
+ "noImplicitAny": true,
+ "module": "es6",
+ "target": "es6",
+ "allowJs": true,
+ "skipLibCheck": true,
+ "lib": ["es2016", "dom"],
+ "typeRoots": ["node_modules/@types/"],
+ "types": ["three"]
+ },
+ "files": ["/src/index.ts", "typings/global.d.ts"]
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllReferencesUndefined_test.go b/internal/fourslash/tests/gen/findAllReferencesUndefined_test.go
new file mode 100644
index 0000000000..36cbbb2267
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllReferencesUndefined_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllReferencesUndefined(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/**/undefined;
+
+void undefined;
+// @Filename: /b.ts
+undefined;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsBadImport_test.go b/internal/fourslash/tests/gen/findAllRefsBadImport_test.go
new file mode 100644
index 0000000000..f66312a477
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsBadImport_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsBadImport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `import { /*0*/ab as /*1*/cd } from "doesNotExist";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsCatchClause_test.go b/internal/fourslash/tests/gen/findAllRefsCatchClause_test.go
new file mode 100644
index 0000000000..ab74baf1b9
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsCatchClause_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsCatchClause(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `try { }
+catch (/*1*/err) {
+ /*2*/err;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsClassExpression0_test.go b/internal/fourslash/tests/gen/findAllRefsClassExpression0_test.go
new file mode 100644
index 0000000000..7fad3791f3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsClassExpression0_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsClassExpression0(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+export = class /*0*/A {
+ m() { /*1*/A; }
+};
+// @Filename: /b.ts
+import /*2*/A = require("./a");
+/*3*/A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsClassExpression1_test.go b/internal/fourslash/tests/gen/findAllRefsClassExpression1_test.go
new file mode 100644
index 0000000000..67802cafb0
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsClassExpression1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsClassExpression1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+module.exports = class /*0*/A {};
+// @Filename: /b.js
+import /*1*/A = require("./a");
+/*2*/A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsClassExpression2_test.go b/internal/fourslash/tests/gen/findAllRefsClassExpression2_test.go
new file mode 100644
index 0000000000..b77f184846
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsClassExpression2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsClassExpression2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+exports./*0*/A = class {};
+// @Filename: /b.js
+import { /*1*/A } from "./a";
+/*2*/A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsClassStaticBlocks_test.go b/internal/fourslash/tests/gen/findAllRefsClassStaticBlocks_test.go
new file mode 100644
index 0000000000..00fb8a2839
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsClassStaticBlocks_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsClassStaticBlocks(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class ClassStaticBocks {
+ static x;
+ [|[|/*classStaticBocks1*/static|] {}|]
+ static y;
+ [|[|/*classStaticBocks2*/static|] {}|]
+ static y;
+ [|[|/*classStaticBocks3*/static|] {}|]
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "classStaticBocks1", "classStaticBocks2", "classStaticBocks3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsCommonJsRequire2_test.go b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire2_test.go
new file mode 100644
index 0000000000..1e02bacdff
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire2_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsCommonJsRequire2(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+function f() { }
+module.exports.f = f
+// @Filename: /b.js
+const { f } = require('./a')
+/**/f`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsCommonJsRequire3_test.go b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire3_test.go
new file mode 100644
index 0000000000..e382ea6594
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire3_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsCommonJsRequire3(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+function f() { }
+module.exports = { f }
+// @Filename: /b.js
+const { f } = require('./a')
+/**/f`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsCommonJsRequire_test.go b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire_test.go
new file mode 100644
index 0000000000..eeb9a85761
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsCommonJsRequire_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsCommonJsRequire(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+function f() { }
+export { f }
+// @Filename: /b.js
+const { f } = require('./a')
+/**/f`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsConstructorFunctions_test.go b/internal/fourslash/tests/gen/findAllRefsConstructorFunctions_test.go
new file mode 100644
index 0000000000..ddb1dafae3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsConstructorFunctions_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsConstructorFunctions(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+function f() {
+ /*1*/this./*2*/x = 0;
+}
+f.prototype.setX = function() {
+ /*3*/this./*4*/x = 1;
+}
+f.prototype.useX = function() { this./*5*/x; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsDeclareClass_test.go b/internal/fourslash/tests/gen/findAllRefsDeclareClass_test.go
new file mode 100644
index 0000000000..56f05b8320
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsDeclareClass_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsDeclareClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/declare class /*2*/C {
+ static m(): void;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsDefaultImport_test.go b/internal/fourslash/tests/gen/findAllRefsDefaultImport_test.go
new file mode 100644
index 0000000000..5cf4a6c3b4
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsDefaultImport_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsDefaultImport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+export default function /*0*/a() {}
+// @Filename: /b.ts
+import /*1*/a, * as ns from "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsDefinition_test.go b/internal/fourslash/tests/gen/findAllRefsDefinition_test.go
new file mode 100644
index 0000000000..7ad8d39066
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsDefinition_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsDefinition(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const /*1*/x = 0;
+/*2*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsDestructureGeneric_test.go b/internal/fourslash/tests/gen/findAllRefsDestructureGeneric_test.go
new file mode 100644
index 0000000000..aef26d1b36
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsDestructureGeneric_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsDestructureGeneric(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*0*/x: boolean;
+}
+declare const i: I;
+const { /*1*/x } = i;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsDestructureGetter_test.go b/internal/fourslash/tests/gen/findAllRefsDestructureGetter_test.go
new file mode 100644
index 0000000000..49e6de3ace
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsDestructureGetter_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsDestructureGetter(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Test {
+ get /*x0*/x() { return 0; }
+
+ set /*y0*/y(a: number) {}
+}
+const { /*x1*/x, /*y1*/y } = new Test();
+/*x2*/x; /*y2*/y;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "x0", "x1", "x2", "y0", "y1", "y2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsEnumAsNamespace_test.go b/internal/fourslash/tests/gen/findAllRefsEnumAsNamespace_test.go
new file mode 100644
index 0000000000..54d139f812
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsEnumAsNamespace_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsEnumAsNamespace(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/enum /*2*/E { A }
+let e: /*3*/E.A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsEnumMember_test.go b/internal/fourslash/tests/gen/findAllRefsEnumMember_test.go
new file mode 100644
index 0000000000..571021c990
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsEnumMember_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsEnumMember(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `enum E { /*1*/A, B }
+const e: E./*2*/A = E./*3*/A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsExportConstEqualToClass_test.go b/internal/fourslash/tests/gen/findAllRefsExportConstEqualToClass_test.go
new file mode 100644
index 0000000000..ef76be32c1
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsExportConstEqualToClass_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsExportConstEqualToClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+class C {}
+export const /*0*/D = C;
+// @Filename: /b.ts
+import { /*1*/D } from "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsExportDefaultClassConstructor_test.go b/internal/fourslash/tests/gen/findAllRefsExportDefaultClassConstructor_test.go
new file mode 100644
index 0000000000..a47f3abc59
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsExportDefaultClassConstructor_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsExportDefaultClassConstructor(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `export default class {
+ /*1*/constructor() {}
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsExportEquals_test.go b/internal/fourslash/tests/gen/findAllRefsExportEquals_test.go
new file mode 100644
index 0000000000..dfee6a23bf
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsExportEquals_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsExportEquals(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+type /*0*/T = number;
+/*1*/export = /*2*/T;
+// @Filename: /b.ts
+import /*3*/T = require("/*4*/./a");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsExportNotAtTopLevel_test.go b/internal/fourslash/tests/gen/findAllRefsExportNotAtTopLevel_test.go
new file mode 100644
index 0000000000..cfd0178704
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsExportNotAtTopLevel_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsExportNotAtTopLevel(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `{
+ /*1*/export const /*2*/x = 0;
+ /*3*/x;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForComputedProperties2_test.go b/internal/fourslash/tests/gen/findAllRefsForComputedProperties2_test.go
new file mode 100644
index 0000000000..ba482ed010
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForComputedProperties2_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForComputedProperties2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ [/*1*/42](): void;
+}
+
+class C implements I {
+ [/*2*/42]: any;
+}
+
+var x: I = {
+ ["/*3*/42"]: function () { }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForComputedProperties_test.go b/internal/fourslash/tests/gen/findAllRefsForComputedProperties_test.go
new file mode 100644
index 0000000000..4e7d6ac84b
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForComputedProperties_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForComputedProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ ["/*0*/prop1"]: () => void;
+}
+
+class C implements I {
+ ["/*1*/prop1"]: any;
+}
+
+var x: I = {
+ ["/*2*/prop1"]: function () { },
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport01_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport01_test.go
new file mode 100644
index 0000000000..c4c2838ec0
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport01_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/export default class /*2*/DefaultExportedClass {
+}
+
+var x: /*3*/DefaultExportedClass;
+
+var y = new /*4*/DefaultExportedClass;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport02_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport02_test.go
new file mode 100644
index 0000000000..6e7b109f72
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport02_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport02(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/export default function /*2*/DefaultExportedFunction() {
+ return /*3*/DefaultExportedFunction;
+}
+
+var x: typeof /*4*/DefaultExportedFunction;
+
+var y = /*5*/DefaultExportedFunction();
+
+/*6*/namespace /*7*/DefaultExportedFunction {
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go
new file mode 100644
index 0000000000..f41ebfe43a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport03(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/function /*2*/f() {
+ return 100;
+}
+
+/*3*/export default /*4*/f;
+
+var x: typeof /*5*/f;
+
+var y = /*6*/f();
+
+/*7*/namespace /*8*/f {
+ var local = 100;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport04_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport04_test.go
new file mode 100644
index 0000000000..6d4ffd4d02
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport04_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport04(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+const /*0*/a = 0;
+export /*1*/default /*2*/a;
+// @Filename: /b.ts
+import /*3*/a from "./a";
+/*4*/a;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "2", "1", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport09_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport09_test.go
new file mode 100644
index 0000000000..768bf83abb
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport09_test.go
@@ -0,0 +1,43 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport09(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @filename: /tsconfig.json
+{
+ "compilerOptions": {
+ "target": "esnext",
+ "strict": true,
+ "outDir": "./out",
+ "allowSyntheticDefaultImports": true
+ }
+}
+// @filename: /a.js
+module.exports = [];
+// @filename: /b.js
+module.exports = 1;
+// @filename: /c.ts
+export = [];
+// @filename: /d.ts
+export = 1;
+// @filename: /foo.ts
+import * as /*0*/a from "./a.js"
+import /*1*/aDefault from "./a.js"
+import * as /*2*/b from "./b.js"
+import /*3*/bDefault from "./b.js"
+
+import * as /*4*/c from "./c"
+import /*5*/cDefault from "./c"
+import * as /*6*/d from "./d"
+import /*7*/dDefault from "./d"`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4", "5", "6", "7")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport_anonymous_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport_anonymous_test.go
new file mode 100644
index 0000000000..ce2bdf10e3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport_anonymous_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport_anonymous(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+export /*1*/default 1;
+// @Filename: /b.ts
+import a from "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport_reExport_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport_reExport_test.go
new file mode 100644
index 0000000000..e7bbb58786
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport_reExport_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultExport_reExport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /export.ts
+const /*0*/foo = 1;
+export default /*1*/foo;
+// @Filename: /re-export.ts
+export { /*2*/default } from "./export";
+// @Filename: /re-export-dep.ts
+import /*3*/fooDefault from "./re-export";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultKeyword_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultKeyword_test.go
new file mode 100644
index 0000000000..b51c89b4d3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForDefaultKeyword_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForDefaultKeyword(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noLib: true
+function f(value: string, /*1*/default: string) {}
+
+const /*2*/default = 1;
+
+function /*3*/default() {}
+
+class /*4*/default {}
+
+const foo = {
+ /*5*/default: 1
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForFunctionExpression01_test.go b/internal/fourslash/tests/gen/findAllRefsForFunctionExpression01_test.go
new file mode 100644
index 0000000000..66e6fe3155
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForFunctionExpression01_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForFunctionExpression01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: file1.ts
+var foo = /*1*/function /*2*/foo(a = /*3*/foo(), b = () => /*4*/foo) {
+ /*5*/foo(/*6*/foo, /*7*/foo);
+}
+// @Filename: file2.ts
+///
+foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForImportCallType_test.go b/internal/fourslash/tests/gen/findAllRefsForImportCallType_test.go
new file mode 100644
index 0000000000..710406adba
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForImportCallType_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForImportCallType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /app.ts
+export function he/**/llo() {};
+// @Filename: /re-export.ts
+export type app = typeof import("./app")
+// @Filename: /indirect-use.ts
+import type { app } from "./re-export";
+declare const app: app
+app.hello();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForImportCall_test.go b/internal/fourslash/tests/gen/findAllRefsForImportCall_test.go
new file mode 100644
index 0000000000..2249e2d7a2
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForImportCall_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForImportCall(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /app.ts
+export function he/**/llo() {};
+// @Filename: /re-export.ts
+export const services = { app: setup(() => import('./app')) }
+function setup(importee: () => Promise): T { return {} as any }
+// @Filename: /indirect-use.ts
+import("./re-export").then(mod => mod.services.app.hello());
+// @Filename: /direct-use.ts
+async function main() {
+ const mod = await import("./app")
+ mod.hello();
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForMappedType_test.go b/internal/fourslash/tests/gen/findAllRefsForMappedType_test.go
new file mode 100644
index 0000000000..4045078336
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForMappedType_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForMappedType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface T { /*1*/a: number };
+type U = { [K in keyof T]: string };
+type V = { [K in keyof U]: boolean };
+const u: U = { a: "" }
+const v: V = { a: true }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForObjectLiteralProperties_test.go b/internal/fourslash/tests/gen/findAllRefsForObjectLiteralProperties_test.go
new file mode 100644
index 0000000000..611d1a08e8
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForObjectLiteralProperties_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForObjectLiteralProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var x = {
+ /*1*/property: {}
+};
+
+x./*2*/property;
+
+/*3*/let {/*4*/property: pVar} = x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForObjectSpread_test.go b/internal/fourslash/tests/gen/findAllRefsForObjectSpread_test.go
new file mode 100644
index 0000000000..f8ba47b3b5
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForObjectSpread_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForObjectSpread(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface A1 { readonly /*0*/a: string };
+interface A2 { /*1*/a?: number };
+let a1: A1;
+let a2: A2;
+let a12 = { ...a1, ...a2 };
+a12./*2*/a;
+a1./*3*/a;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForRest_test.go b/internal/fourslash/tests/gen/findAllRefsForRest_test.go
new file mode 100644
index 0000000000..0fe615325d
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForRest_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForRest(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Gen {
+ x: number
+ /*1*/parent: Gen;
+ millenial: string;
+}
+let t: Gen;
+var { x, ...rest } = t;
+rest./*2*/parent;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForStaticInstanceMethodInheritance_test.go b/internal/fourslash/tests/gen/findAllRefsForStaticInstanceMethodInheritance_test.go
new file mode 100644
index 0000000000..83ab0d73e0
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForStaticInstanceMethodInheritance_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForStaticInstanceMethodInheritance(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class X{
+ /*0*/foo(): void{}
+}
+
+class Y extends X{
+ static /*1*/foo(): void{}
+}
+
+class Z extends Y{
+ static /*2*/foo(): void{}
+ /*3*/foo(): void{}
+}
+
+const x = new X();
+const y = new Y();
+const z = new Z();
+x.foo();
+y.foo();
+z.foo();
+Y.foo();
+Z.foo();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForStaticInstancePropertyInheritance_test.go b/internal/fourslash/tests/gen/findAllRefsForStaticInstancePropertyInheritance_test.go
new file mode 100644
index 0000000000..54889cca8e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForStaticInstancePropertyInheritance_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForStaticInstancePropertyInheritance(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class X{
+ /*0*/foo:any
+}
+
+class Y extends X{
+ static /*1*/foo:any
+}
+
+class Z extends Y{
+ static /*2*/foo:any
+ /*3*/foo:any
+}
+
+const x = new X();
+const y = new Y();
+const z = new Z();
+x./*4*/foo;
+y./*5*/foo;
+z./*6*/foo;
+Y./*7*/foo;
+Z./*8*/foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForStringLiteralTypes_test.go b/internal/fourslash/tests/gen/findAllRefsForStringLiteralTypes_test.go
new file mode 100644
index 0000000000..8fb7209b6e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForStringLiteralTypes_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForStringLiteralTypes(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `type Options = "/*1*/option 1" | "option 2";
+let myOption: Options = "/*2*/option 1";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForStringLiteral_test.go b/internal/fourslash/tests/gen/findAllRefsForStringLiteral_test.go
new file mode 100644
index 0000000000..b38f4a58c5
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForStringLiteral_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForStringLiteral(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @filename: /a.ts
+interface Foo {
+ property: /**/"foo";
+}
+/**
+ * @type {{ property: "foo"}}
+ */
+const obj: Foo = {
+ property: "foo",
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForUMDModuleAlias1_test.go b/internal/fourslash/tests/gen/findAllRefsForUMDModuleAlias1_test.go
new file mode 100644
index 0000000000..71dba41593
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForUMDModuleAlias1_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForUMDModuleAlias1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: 0.d.ts
+export function doThing(): string;
+export function doTheOtherThing(): void;
+/*1*/export as namespace /*2*/myLib;
+// @Filename: 1.ts
+///
+/*3*/myLib.doThing();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause01_test.go b/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause01_test.go
new file mode 100644
index 0000000000..00010a6189
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause01_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForVariableInExtendsClause01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/Base = class { };
+class C extends /*3*/Base { }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause02_test.go b/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause02_test.go
new file mode 100644
index 0000000000..47debbc4e2
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForVariableInExtendsClause02_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForVariableInExtendsClause02(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/interface /*2*/Base { }
+namespace n {
+ var Base = class { };
+ interface I extends /*3*/Base { }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsForVariableInImplementsClause01_test.go b/internal/fourslash/tests/gen/findAllRefsForVariableInImplementsClause01_test.go
new file mode 100644
index 0000000000..c0be3ee14a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsForVariableInImplementsClause01_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsForVariableInImplementsClause01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var Base = class { };
+class C extends Base implements /**/Base { }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsGlobalThisKeywordInModule_test.go b/internal/fourslash/tests/gen/findAllRefsGlobalThisKeywordInModule_test.go
new file mode 100644
index 0000000000..e402507300
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsGlobalThisKeywordInModule_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsGlobalThisKeywordInModule(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noLib: true
+/*1*/this;
+export const c = 1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsImportEquals_test.go b/internal/fourslash/tests/gen/findAllRefsImportEquals_test.go
new file mode 100644
index 0000000000..6d03e7b613
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsImportEquals_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsImportEquals(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `import j = N./**/q;
+namespace N { export const q = 0; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsImportType_test.go b/internal/fourslash/tests/gen/findAllRefsImportType_test.go
new file mode 100644
index 0000000000..0fd25c7a9c
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsImportType_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsImportType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+module.exports = 0;
+/*1*/export type /*2*/N = number;
+// @Filename: /b.js
+type T = import("./a")./*3*/N;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInClassExpression_test.go b/internal/fourslash/tests/gen/findAllRefsInClassExpression_test.go
new file mode 100644
index 0000000000..3dd4551ee9
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInClassExpression_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInClassExpression(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I { /*0*/boom(): void; }
+new class C implements I {
+ /*1*/boom(){}
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsIndexedAccessTypes_test.go b/internal/fourslash/tests/gen/findAllRefsIndexedAccessTypes_test.go
new file mode 100644
index 0000000000..b80e51a3d2
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsIndexedAccessTypes_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsIndexedAccessTypes(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*1*/0: number;
+ /*2*/s: string;
+}
+interface J {
+ a: I[/*3*/0],
+ b: I["/*4*/s"],
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInheritedProperties1_test.go b/internal/fourslash/tests/gen/findAllRefsInheritedProperties1_test.go
new file mode 100644
index 0000000000..217a55284e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInheritedProperties1_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInheritedProperties1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class class1 extends class1 {
+ /*1*/doStuff() { }
+ /*2*/propName: string;
+ }
+
+ var v: class1;
+ v./*3*/doStuff();
+ v./*4*/propName;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInheritedProperties2_test.go b/internal/fourslash/tests/gen/findAllRefsInheritedProperties2_test.go
new file mode 100644
index 0000000000..deb24b7092
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInheritedProperties2_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInheritedProperties2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` interface interface1 extends interface1 {
+ /*1*/doStuff(): void; // r0
+ /*2*/propName: string; // r1
+ }
+
+ var v: interface1;
+ v./*3*/doStuff(); // r2
+ v./*4*/propName; // r3`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInheritedProperties3_test.go b/internal/fourslash/tests/gen/findAllRefsInheritedProperties3_test.go
new file mode 100644
index 0000000000..dfd454127b
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInheritedProperties3_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInheritedProperties3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class class1 extends class1 {
+ [|/*0*/doStuff() { }|]
+ [|/*1*/propName: string;|]
+ }
+ interface interface1 extends interface1 {
+ [|/*2*/doStuff(): void;|]
+ [|/*3*/propName: string;|]
+ }
+ class class2 extends class1 implements interface1 {
+ [|/*4*/doStuff() { }|]
+ [|/*5*/propName: string;|]
+ }
+
+ var v: class2;
+ v./*6*/doStuff();
+ v./*7*/propName;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4", "6", "5", "7")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInheritedProperties4_test.go b/internal/fourslash/tests/gen/findAllRefsInheritedProperties4_test.go
new file mode 100644
index 0000000000..dd73c27523
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInheritedProperties4_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInheritedProperties4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` interface C extends D {
+ /*0*/prop0: string;
+ /*1*/prop1: number;
+ }
+
+ interface D extends C {
+ /*2*/prop0: string;
+ }
+
+ var d: D;
+ d./*3*/prop0;
+ d./*4*/prop1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "2", "3", "1", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInheritedProperties5_test.go b/internal/fourslash/tests/gen/findAllRefsInheritedProperties5_test.go
new file mode 100644
index 0000000000..5bc90a3d9a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInheritedProperties5_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInheritedProperties5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class C extends D {
+ /*0*/prop0: string;
+ /*1*/prop1: number;
+ }
+
+ class D extends C {
+ /*2*/prop0: string;
+ }
+
+ var d: D;
+ d./*3*/prop0;
+ d./*4*/prop1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInsideTemplates1_test.go b/internal/fourslash/tests/gen/findAllRefsInsideTemplates1_test.go
new file mode 100644
index 0000000000..8ee15f418f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInsideTemplates1_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInsideTemplates1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/x = 10;
+var y = ` + "`" + `${ /*3*/x } ${ /*4*/x }` + "`" + ``
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInsideTemplates2_test.go b/internal/fourslash/tests/gen/findAllRefsInsideTemplates2_test.go
new file mode 100644
index 0000000000..104197f240
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInsideTemplates2_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInsideTemplates2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/function /*2*/f(...rest: any[]) { }
+/*3*/f ` + "`" + `${ /*4*/f } ${ /*5*/f }` + "`" + ``
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsInsideWithBlock_test.go b/internal/fourslash/tests/gen/findAllRefsInsideWithBlock_test.go
new file mode 100644
index 0000000000..5de5e03522
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsInsideWithBlock_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsInsideWithBlock(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/x = 0;
+
+with ({}) {
+ var y = x; // Reference of x here should not be picked
+ y++; // also reference for y should be ignored
+}
+
+/*3*/x = /*4*/x + 1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsIsDefinition_test.go b/internal/fourslash/tests/gen/findAllRefsIsDefinition_test.go
new file mode 100644
index 0000000000..e4838b2ae9
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsIsDefinition_test.go
@@ -0,0 +1,41 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsIsDefinition(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `declare function foo(a: number): number;
+declare function foo(a: string): string;
+declare function foo/*1*/(a: string | number): string | number;
+
+function foon(a: number): number;
+function foon(a: string): string;
+function foon/*2*/(a: string | number): string | number {
+ return a
+}
+
+foo; foon;
+
+export const bar/*3*/ = 123;
+console.log({ bar });
+
+interface IFoo {
+ foo/*4*/(): void;
+}
+class Foo implements IFoo {
+ constructor(n: number)
+ constructor()
+ /*5*/constructor(n: number?) { }
+ foo/*6*/(): void { }
+ static init() { return new this() }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocImportTag2_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag2_test.go
new file mode 100644
index 0000000000..aa70162606
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag2_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocImportTag2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @checkJs: true
+// @Filename: /component.js
+export default class Component {
+ constructor() {
+ this.id_ = Math.random();
+ }
+ id() {
+ return this.id_;
+ }
+}
+// @Filename: /spatial-navigation.js
+/** @import Component from './component.js' */
+
+export class SpatialNavigation {
+ /**
+ * @param {Component} component
+ */
+ add(component) {}
+}
+// @Filename: /player.js
+import Component from './component.js';
+
+/**
+ * @extends Component/*1*/
+ */
+export class Player extends Component {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocImportTag3_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag3_test.go
new file mode 100644
index 0000000000..966773ac8a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag3_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocImportTag3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @checkJs: true
+// @Filename: /component.js
+export class Component {
+ constructor() {
+ this.id_ = Math.random();
+ }
+ id() {
+ return this.id_;
+ }
+}
+// @Filename: /spatial-navigation.js
+/** @import { Component } from './component.js' */
+
+export class SpatialNavigation {
+ /**
+ * @param {Component} component
+ */
+ add(component) {}
+}
+// @Filename: /player.js
+import { Component } from './component.js';
+
+/**
+ * @extends Component/*1*/
+ */
+export class Player extends Component {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocImportTag4_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag4_test.go
new file mode 100644
index 0000000000..2a067d5246
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag4_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocImportTag4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @checkJs: true
+// @Filename: /component.js
+export class Component {
+ constructor() {
+ this.id_ = Math.random();
+ }
+ id() {
+ return this.id_;
+ }
+}
+// @Filename: /spatial-navigation.js
+/** @import * as C from './component.js' */
+
+export class SpatialNavigation {
+ /**
+ * @param {C.Component} component
+ */
+ add(component) {}
+}
+// @Filename: /player.js
+import * as C from './component.js';
+
+/**
+ * @extends C/*1*/.Component
+ */
+export class Player extends Component {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocImportTag5_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag5_test.go
new file mode 100644
index 0000000000..06f4862545
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag5_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocImportTag5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @checkJs: true
+// @Filename: /a.js
+export default function /*0*/a() {}
+// @Filename: /b.js
+/** @import /*1*/a, * as ns from "./a" */`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocImportTag_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag_test.go
new file mode 100644
index 0000000000..15f486040c
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocImportTag_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocImportTag(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJS: true
+// @checkJs: true
+// @Filename: /b.ts
+export interface A { }
+// @Filename: /a.js
+/**
+ * @import { A } from "./b";
+ */
+
+/**
+ * @param { [|A/**/|] } a
+ */
+function f(a) {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_js_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_js_test.go
new file mode 100644
index 0000000000..711befea3e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_js_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTemplateTag_class_js(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/** @template /*1*/T */
+class C {
+ constructor() {
+ /** @type {/*2*/T} */
+ this.x = null;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_test.go
new file mode 100644
index 0000000000..7fb0d8f215
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_class_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTemplateTag_class(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/** @template /*1*/T */
+class C*2*/T> {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_js_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_js_test.go
new file mode 100644
index 0000000000..f84dd562aa
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_js_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTemplateTag_function_js(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/**
+ * @template /*1*/T
+ * @return {/*2*/T}
+ */
+function f() {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_test.go
new file mode 100644
index 0000000000..c438850de6
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTemplateTag_function_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTemplateTag_function(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/** @template /*1*/T */
+function f*2*/T>() {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_js_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_js_test.go
new file mode 100644
index 0000000000..1dfa6b2575
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_js_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTypeDef_js(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/** /*1*/@typedef {number} /*2*/T */
+
+/**
+ * @return {/*3*/T}
+ */
+function f(obj) { return 0; }
+
+/**
+ * @return {/*4*/T}
+ */
+function f2(obj) { return 0; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_test.go b/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_test.go
new file mode 100644
index 0000000000..d9a9b5de6f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsDocTypeDef_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsDocTypeDef(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/** @typedef {Object} /*0*/T */
+function foo() {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment2_test.go b/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment2_test.go
new file mode 100644
index 0000000000..c2d222384d
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment2_test.go
@@ -0,0 +1,40 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsThisPropertyAssignment2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @noImplicitThis: true
+// @Filename: infer.d.ts
+export declare function infer(o: { m: Record } & ThisType<{ x: number }>): void;
+// @Filename: a.js
+import { infer } from "./infer";
+infer({
+ m: {
+ initData() {
+ this.x = 1;
+ this./*1*/x;
+ },
+ }
+});
+// @Filename: b.ts
+import { infer } from "./infer";
+infer({
+ m: {
+ initData() {
+ this.x = 1;
+ this./*2*/x;
+ },
+ }
+});`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment_test.go b/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment_test.go
new file mode 100644
index 0000000000..14d0eb2438
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsJsThisPropertyAssignment_test.go
@@ -0,0 +1,40 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsJsThisPropertyAssignment(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @noImplicitThis: true
+// @Filename: infer.d.ts
+export declare function infer(o: { m(): void } & ThisType<{ x: number }>): void;
+// @Filename: a.js
+import { infer } from "./infer";
+infer({
+ m() {
+ this.x = 1;
+ this./*1*/x;
+ },
+});
+// @Filename: b.js
+/**
+ * @template T
+ * @param {{m(): void} & ThisType<{x: number}>} o
+ */
+function infer(o) {}
+infer({
+ m() {
+ this.x = 2;
+ this./*2*/x;
+ },
+});`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsMappedType_nonHomomorphic_test.go b/internal/fourslash/tests/gen/findAllRefsMappedType_nonHomomorphic_test.go
new file mode 100644
index 0000000000..c6adb857ef
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsMappedType_nonHomomorphic_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsMappedType_nonHomomorphic(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @strict: true
+function f(x: { [K in "m"]: number; }) {
+ x./*1*/m;
+ x./*2*/m
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsMappedType_test.go b/internal/fourslash/tests/gen/findAllRefsMappedType_test.go
new file mode 100644
index 0000000000..4407a74a6f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsMappedType_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsMappedType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface T { /*1*/a: number; }
+type U = { readonly [K in keyof T]?: string };
+declare const t: T;
+t./*2*/a;
+declare const u: U;
+u./*3*/a;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsMissingModulesOverlappingSpecifiers_test.go b/internal/fourslash/tests/gen/findAllRefsMissingModulesOverlappingSpecifiers_test.go
new file mode 100644
index 0000000000..1ebea78f87
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsMissingModulesOverlappingSpecifiers_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsMissingModulesOverlappingSpecifiers(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// https://github.com/microsoft/TypeScript/issues/5551
+import { resolve/*0*/ as resolveUrl } from "idontcare";
+import { resolve/*1*/ } from "whatever";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsModuleDotExports_test.go b/internal/fourslash/tests/gen/findAllRefsModuleDotExports_test.go
new file mode 100644
index 0000000000..e2fa622891
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsModuleDotExports_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsModuleDotExports(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/*1*/const b = require("/*2*/./b");
+// @Filename: /b.js
+/*3*/module.exports = 0;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsNoImportClause_test.go b/internal/fourslash/tests/gen/findAllRefsNoImportClause_test.go
new file mode 100644
index 0000000000..b7e98d676c
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsNoImportClause_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsNoImportClause(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/*1*/export const /*2*/x = 0;
+// @Filename: /b.ts
+import "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsNoSubstitutionTemplateLiteralNoCrash1_test.go b/internal/fourslash/tests/gen/findAllRefsNoSubstitutionTemplateLiteralNoCrash1_test.go
new file mode 100644
index 0000000000..29e4b95f39
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsNoSubstitutionTemplateLiteralNoCrash1_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsNoSubstitutionTemplateLiteralNoCrash1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `type Test = ` + "`" + `T/*1*/` + "`" + `;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsNonModule_test.go b/internal/fourslash/tests/gen/findAllRefsNonModule_test.go
new file mode 100644
index 0000000000..00b5bedb3d
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsNonModule_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsNonModule(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @checkJs: true
+// @Filename: /script.ts
+console.log("I'm a script!");
+// @Filename: /import.ts
+import "./script/*1*/";
+// @Filename: /require.js
+require("./script/*2*/");
+console.log("./script/*3*/");
+// @Filename: /tripleSlash.ts
+///
+// @Filename: /stringLiteral.ts
+console.log("./script");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsNonexistentPropertyNoCrash1_test.go b/internal/fourslash/tests/gen/findAllRefsNonexistentPropertyNoCrash1_test.go
new file mode 100644
index 0000000000..d7b93361ba
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsNonexistentPropertyNoCrash1_test.go
@@ -0,0 +1,61 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsNonexistentPropertyNoCrash1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @strict: true
+// @allowJs: true
+// @checkJs: true
+// @filename: ./src/parser-input.js
+export default () => {
+ let input;
+
+ const parserInput = {};
+
+ parserInput.currentChar = () => input.charAt(parserInput.i);
+
+ parserInput.end = () => {
+ const isFinished = parserInput.i >= input.length;
+
+ return {
+ isFinished,
+ furthest: parserInput.i,
+ };
+ };
+
+ return parserInput;
+};
+// @filename: ./src/parser.js
+import getParserInput from "./parser-input";
+
+const Parser = function Parser(context, imports, fileInfo, currentIndex) {
+ currentIndex = currentIndex || 0;
+ let parsers;
+ const parserInput = getParserInput();
+
+ return {
+ parserInput,
+ parsers: (parsers = {
+ variable: function () {
+ let name;
+
+ if (parserInput.currentChar() === "/*1*/@") {
+ return name[1];
+ }
+ },
+ }),
+ };
+};
+
+export default Parser;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName01_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName01_test.go
new file mode 100644
index 0000000000..9597d43716
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName01_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*1*/property1: number;
+ property2: string;
+}
+
+var foo: I;
+/*2*/var { /*3*/property1: prop1 } = foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName02_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName02_test.go
new file mode 100644
index 0000000000..eb786e6c17
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName02_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName02(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*1*/property1: number;
+ property2: string;
+}
+
+var foo: I;
+/*2*/var { /*3*/property1: {} } = foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName03_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName03_test.go
new file mode 100644
index 0000000000..ba04d40b18
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName03_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName03(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*1*/property1: number;
+ property2: string;
+}
+
+var foo: I;
+var [ { property1: prop1 }, { /*2*/property1, property2 } ] = [foo, foo];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName04_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName04_test.go
new file mode 100644
index 0000000000..7c3806cf9a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName04_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName04(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*0*/property1: number;
+ property2: string;
+}
+
+function f({ /*1*/property1: p1 }: I,
+ { /*2*/property1 }: I,
+ { property1: p2 }) {
+
+ return /*3*/property1 + 1;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName05_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName05_test.go
new file mode 100644
index 0000000000..aa13508472
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName05_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName05(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ property1: number;
+ property2: string;
+}
+
+function f({ /**/property1: p }, { property1 }) {
+ let x = property1;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName06_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName06_test.go
new file mode 100644
index 0000000000..6a10bc3040
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName06_test.go
@@ -0,0 +1,31 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName06(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*0*/property1: number;
+ property2: string;
+}
+
+var elems: I[];
+for (let { /*1*/property1: p } of elems) {
+}
+for (let { /*2*/property1 } of elems) {
+}
+for (var { /*3*/property1: p1 } of elems) {
+}
+var p2;
+for ({ /*4*/property1 : p2 } of elems) {
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "3", "4", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName07_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName07_test.go
new file mode 100644
index 0000000000..904acf3d98
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName07_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName07(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `let p, b;
+
+p, [{ /*1*/a: p, b }] = [{ a: 10, b: true }];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName10_test.go b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName10_test.go
new file mode 100644
index 0000000000..599706f7ec
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsObjectBindingElementPropertyName10_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsObjectBindingElementPropertyName10(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Recursive {
+ /*1*/next?: Recursive;
+ value: any;
+}
+
+function f (/*2*/{ /*3*/next: { /*4*/next: x} }: Recursive) {
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOfConstructor_withModifier_test.go b/internal/fourslash/tests/gen/findAllRefsOfConstructor_withModifier_test.go
new file mode 100644
index 0000000000..1d6239b1d2
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOfConstructor_withModifier_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOfConstructor_withModifier(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class X {
+ public /*0*/constructor() {}
+}
+var x = new X();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOnDecorators_test.go b/internal/fourslash/tests/gen/findAllRefsOnDecorators_test.go
new file mode 100644
index 0000000000..eab0fcdf3b
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOnDecorators_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOnDecorators(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: a.ts
+/*1*/function /*2*/decorator(target) {
+ return target;
+}
+/*3*/decorator();
+// @Filename: b.ts
+@/*4*/decorator @/*5*/decorator("again")
+class C {
+ @/*6*/decorator
+ method() {}
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOnDefinition2_test.go b/internal/fourslash/tests/gen/findAllRefsOnDefinition2_test.go
new file mode 100644
index 0000000000..2fbf5d60dc
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOnDefinition2_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOnDefinition2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: findAllRefsOnDefinition2-import.ts
+export module Test{
+
+ /*1*/export interface /*2*/start { }
+
+ export interface stop { }
+}
+//@Filename: findAllRefsOnDefinition2.ts
+import Second = require("./findAllRefsOnDefinition2-import");
+
+var start: Second.Test./*3*/start;
+var stop: Second.Test.stop;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOnDefinition_test.go b/internal/fourslash/tests/gen/findAllRefsOnDefinition_test.go
new file mode 100644
index 0000000000..aac365995a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOnDefinition_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOnDefinition(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: findAllRefsOnDefinition-import.ts
+export class Test{
+
+ constructor(){
+
+ }
+
+ /*1*/public /*2*/start(){
+ return this;
+ }
+
+ public stop(){
+ return this;
+ }
+}
+//@Filename: findAllRefsOnDefinition.ts
+import Second = require("./findAllRefsOnDefinition-import");
+
+var second = new Second.Test()
+second./*3*/start();
+second.stop();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOnImportAliases_test.go b/internal/fourslash/tests/gen/findAllRefsOnImportAliases_test.go
new file mode 100644
index 0000000000..5c7ef13931
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOnImportAliases_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOnImportAliases(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: a.ts
+export class /*0*/Class {
+}
+//@Filename: b.ts
+import { /*1*/Class } from "./a";
+
+var c = new /*2*/Class();
+//@Filename: c.ts
+export { /*3*/Class } from "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsOnPrivateParameterProperty1_test.go b/internal/fourslash/tests/gen/findAllRefsOnPrivateParameterProperty1_test.go
new file mode 100644
index 0000000000..8ffb377062
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsOnPrivateParameterProperty1_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsOnPrivateParameterProperty1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class ABCD {
+ constructor(private x: number, public y: number, /*1*/private /*2*/z: number) {
+ }
+
+ func() {
+ return this./*3*/z;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration1_test.go b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration1_test.go
new file mode 100644
index 0000000000..e126ac0101
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsParameterPropertyDeclaration1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ constructor(private /*1*/privateParam: number) {
+ let localPrivate = privateParam;
+ this.privateParam += 10;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration2_test.go b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration2_test.go
new file mode 100644
index 0000000000..a8170d7aed
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsParameterPropertyDeclaration2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ constructor(public /*0*/publicParam: number) {
+ let localPublic = /*1*/publicParam;
+ this./*2*/publicParam += 10;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration3_test.go b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration3_test.go
new file mode 100644
index 0000000000..b86cb99bfd
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration3_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsParameterPropertyDeclaration3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ constructor(protected /*0*/protectedParam: number) {
+ let localProtected = /*1*/protectedParam;
+ this./*2*/protectedParam += 10;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration_inheritance_test.go b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration_inheritance_test.go
new file mode 100644
index 0000000000..010fa06c59
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsParameterPropertyDeclaration_inheritance_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsParameterPropertyDeclaration_inheritance(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ constructor(public /*0*/x: string) {
+ /*1*/x;
+ }
+}
+class D extends C {
+ constructor(public /*2*/x: string) {
+ super(/*3*/x);
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsPrimitiveJsDoc_test.go b/internal/fourslash/tests/gen/findAllRefsPrimitiveJsDoc_test.go
new file mode 100644
index 0000000000..671a2db410
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsPrimitiveJsDoc_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsPrimitiveJsDoc(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noLib: true
+/**
+ * @param {/*1*/number} n
+ * @returns {/*2*/number}
+ */
+function f(n: /*3*/number): /*4*/number {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsPrivateNameAccessors_test.go b/internal/fourslash/tests/gen/findAllRefsPrivateNameAccessors_test.go
new file mode 100644
index 0000000000..081721bf96
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsPrivateNameAccessors_test.go
@@ -0,0 +1,36 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsPrivateNameAccessors(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ /*1*/get /*2*/#foo(){ return 1; }
+ /*3*/set /*4*/#foo(value: number){ }
+ constructor() {
+ this./*5*/#foo();
+ }
+}
+class D extends C {
+ constructor() {
+ super()
+ this.#foo = 20;
+ }
+}
+class E {
+ /*6*/get /*7*/#foo(){ return 1; }
+ /*8*/set /*9*/#foo(value: number){ }
+ constructor() {
+ this./*10*/#foo();
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsPrivateNameMethods_test.go b/internal/fourslash/tests/gen/findAllRefsPrivateNameMethods_test.go
new file mode 100644
index 0000000000..b11bbc9837
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsPrivateNameMethods_test.go
@@ -0,0 +1,34 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsPrivateNameMethods(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ /*1*/#foo(){ }
+ constructor() {
+ this./*2*/#foo();
+ }
+}
+class D extends C {
+ constructor() {
+ super()
+ this.#foo = 20;
+ }
+}
+class E {
+ /*3*/#foo(){ }
+ constructor() {
+ this./*4*/#foo();
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsPrivateNameProperties_test.go b/internal/fourslash/tests/gen/findAllRefsPrivateNameProperties_test.go
new file mode 100644
index 0000000000..7ffd784626
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsPrivateNameProperties_test.go
@@ -0,0 +1,35 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsPrivateNameProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ /*1*/#foo = 10;
+ constructor() {
+ this./*2*/#foo = 20;
+ /*3*/#foo in this;
+ }
+}
+class D extends C {
+ constructor() {
+ super()
+ this.#foo = 20;
+ }
+}
+class E {
+ /*4*/#foo: number;
+ constructor() {
+ this./*5*/#foo = 20;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsPropertyContextuallyTypedByTypeParam01_test.go b/internal/fourslash/tests/gen/findAllRefsPropertyContextuallyTypedByTypeParam01_test.go
new file mode 100644
index 0000000000..713e446976
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsPropertyContextuallyTypedByTypeParam01_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsPropertyContextuallyTypedByTypeParam01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface IFoo {
+ /*1*/a: string;
+}
+class C {
+ method() {
+ var x: T = {
+ a: ""
+ };
+ x.a;
+ }
+}
+
+
+var x: IFoo = {
+ a: "ss"
+};`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsReExport_broken2_test.go b/internal/fourslash/tests/gen/findAllRefsReExport_broken2_test.go
new file mode 100644
index 0000000000..960d40e890
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsReExport_broken2_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsReExport_broken2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/*1*/export { /*2*/x } from "nonsense";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsReExport_broken_test.go b/internal/fourslash/tests/gen/findAllRefsReExport_broken_test.go
new file mode 100644
index 0000000000..a864f48650
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsReExport_broken_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+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 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsRedeclaredPropertyInDerivedInterface_test.go b/internal/fourslash/tests/gen/findAllRefsRedeclaredPropertyInDerivedInterface_test.go
new file mode 100644
index 0000000000..cdf8e9a389
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsRedeclaredPropertyInDerivedInterface_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsRedeclaredPropertyInDerivedInterface(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noLib: true
+interface A {
+ readonly /*0*/x: number | string;
+}
+interface B extends A {
+ readonly /*1*/x: number;
+}
+const a: A = { /*2*/x: 0 };
+const b: B = { /*3*/x: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsRootSymbols_test.go b/internal/fourslash/tests/gen/findAllRefsRootSymbols_test.go
new file mode 100644
index 0000000000..0f2448374c
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsRootSymbols_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsRootSymbols(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I { /*0*/x: {}; }
+interface J { /*1*/x: {}; }
+declare const o: (I | J) & { /*2*/x: string };
+o./*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsThisKeywordMultipleFiles_test.go b/internal/fourslash/tests/gen/findAllRefsThisKeywordMultipleFiles_test.go
new file mode 100644
index 0000000000..cf7d9e3157
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsThisKeywordMultipleFiles_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsThisKeywordMultipleFiles(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: file1.ts
+/*1*/this; /*2*/this;
+// @Filename: file2.ts
+/*3*/this;
+/*4*/this;
+// @Filename: file3.ts
+ ((x = /*5*/this, y) => /*6*/this)(/*7*/this, /*8*/this);
+ // different 'this'
+ function f(this) { return this; }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsThisKeyword_test.go b/internal/fourslash/tests/gen/findAllRefsThisKeyword_test.go
new file mode 100644
index 0000000000..71d5da8fc4
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsThisKeyword_test.go
@@ -0,0 +1,39 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsThisKeyword(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noLib: true
+/*1*/this;
+function f(/*2*/this) {
+ return /*3*/this;
+ function g(/*4*/this) { return /*5*/this; }
+}
+class C {
+ static x() {
+ /*6*/this;
+ }
+ static y() {
+ () => /*7*/this;
+ }
+ constructor() {
+ /*8*/this;
+ }
+ method() {
+ () => /*9*/this;
+ }
+}
+// These are *not* real uses of the 'this' keyword, they are identifiers.
+const x = { /*10*/this: 0 }
+x./*11*/this;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsTypeParameterInMergedInterface_test.go b/internal/fourslash/tests/gen/findAllRefsTypeParameterInMergedInterface_test.go
new file mode 100644
index 0000000000..50ae313f12
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsTypeParameterInMergedInterface_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsTypeParameterInMergedInterface(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I*1*/T> { a: /*2*/T }
+interface I*3*/T> { b: /*4*/T }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsTypedef_importType_test.go b/internal/fourslash/tests/gen/findAllRefsTypedef_importType_test.go
new file mode 100644
index 0000000000..d104a0a569
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsTypedef_importType_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsTypedef_importType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+module.exports = 0;
+/** /*1*/@typedef {number} /*2*/Foo */
+const dummy = 0;
+// @Filename: /b.js
+/** @type {import('./a')./*3*/Foo} */
+const x = 0;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsTypedef_test.go b/internal/fourslash/tests/gen/findAllRefsTypedef_test.go
new file mode 100644
index 0000000000..05e6d1d868
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsTypedef_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsTypedef(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/**
+ * @typedef I {Object}
+ * /*1*/@prop /*2*/p {number}
+ */
+
+/** @type {I} */
+let x;
+x./*3*/p;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsTypeofImport_test.go b/internal/fourslash/tests/gen/findAllRefsTypeofImport_test.go
new file mode 100644
index 0000000000..23711b00fc
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsTypeofImport_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsTypeofImport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/*1*/export const /*2*/x = 0;
+declare const a: typeof import("./a");
+a./*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsUnionProperty_test.go b/internal/fourslash/tests/gen/findAllRefsUnionProperty_test.go
new file mode 100644
index 0000000000..b9665888ea
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsUnionProperty_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsUnionProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `type T =
+ | { /*t0*/type: "a", /*p0*/prop: number }
+ | { /*t1*/type: "b", /*p1*/prop: string };
+const tt: T = {
+ /*t2*/type: "a",
+ /*p2*/prop: 0,
+};
+declare const t: T;
+if (t./*t3*/type === "a") {
+ t./*t4*/type;
+} else {
+ t./*t5*/type;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "t0", "t1", "t3", "t4", "t5", "t2", "p0", "p1", "p2")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols1_test.go b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols1_test.go
new file mode 100644
index 0000000000..88834f019f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsUnresolvedSymbols1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `let a: /*a0*/Bar;
+let b: /*a1*/Bar;
+let c: /*a2*/Bar;
+let d: /*b0*/Bar./*c0*/X;
+let e: /*b1*/Bar./*c1*/X;
+let f: /*b2*/Bar./*d0*/X./*e0*/Y;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a0", "a1", "a2", "b0", "b1", "b2", "c0", "c1", "d0", "e0")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols2_test.go b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols2_test.go
new file mode 100644
index 0000000000..03cee6b46c
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols2_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsUnresolvedSymbols2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `import { /*a0*/Bar } from "does-not-exist";
+
+let a: /*a1*/Bar;
+let b: /*a2*/Bar;
+let c: /*a3*/Bar;
+let d: /*a4*/Bar./*b0*/X;
+let e: /*a5*/Bar./*b1*/X;
+let f: /*a6*/Bar./*c0*/X./*d0*/Y;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a0", "a1", "a2", "a3", "a4", "a5", "a6", "b0", "b1", "c0", "d0")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols3_test.go b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols3_test.go
new file mode 100644
index 0000000000..cbbc67a3c9
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsUnresolvedSymbols3_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsUnresolvedSymbols3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `import * as /*a0*/Bar from "does-not-exist";
+
+let a: /*a1*/Bar;
+let b: /*a2*/Bar;
+let c: /*a3*/Bar;
+let d: /*a4*/Bar./*b0*/X;
+let e: /*a5*/Bar./*b1*/X;
+let f: /*a6*/Bar./*c0*/X./*d0*/Y;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a0", "a1", "a2", "a3", "a4", "a5", "a6", "b0", "b1", "c0", "d0")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames1_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames1_test.go
new file mode 100644
index 0000000000..dcee1b535d
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/public /*2*/_bar() { return 0; }
+}
+
+var x: Foo;
+x./*3*/_bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames2_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames2_test.go
new file mode 100644
index 0000000000..d71df5ccc7
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/public /*2*/__bar() { return 0; }
+}
+
+var x: Foo;
+x./*3*/__bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames3_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames3_test.go
new file mode 100644
index 0000000000..6c46e0d097
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames3_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/public /*2*/___bar() { return 0; }
+}
+
+var x: Foo;
+x./*3*/___bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames4_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames4_test.go
new file mode 100644
index 0000000000..c560ef5d0f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames4_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/public /*2*/____bar() { return 0; }
+}
+
+var x: Foo;
+x./*3*/____bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames5_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames5_test.go
new file mode 100644
index 0000000000..1f7a9e84b0
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames5_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ public _bar;
+ public __bar;
+ /*1*/public /*2*/___bar;
+ public ____bar;
+}
+
+var x: Foo;
+x._bar;
+x.__bar;
+x./*3*/___bar;
+x.____bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames6_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames6_test.go
new file mode 100644
index 0000000000..6c15f525b3
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames6_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ public _bar;
+ /*1*/public /*2*/__bar;
+ public ___bar;
+ public ____bar;
+}
+
+var x: Foo;
+x._bar;
+x./*3*/__bar;
+x.___bar;
+x.____bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames7_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames7_test.go
new file mode 100644
index 0000000000..227ab8092f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames7_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames7(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/function /*2*/__foo() {
+ /*3*/__foo();
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames8_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames8_test.go
new file mode 100644
index 0000000000..aaac6e4473
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames8_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames8(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `(/*1*/function /*2*/__foo() {
+ /*3*/__foo();
+})`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames9_test.go b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames9_test.go
new file mode 100644
index 0000000000..5612ed5d47
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithLeadingUnderscoreNames9_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithLeadingUnderscoreNames9(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `(/*1*/function /*2*/___foo() {
+ /*3*/___foo();
+})`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment2_test.go b/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment2_test.go
new file mode 100644
index 0000000000..0f95e39d3f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment2_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithShorthandPropertyAssignment2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` var /*0*/dx = "Foo";
+
+ module M { export var /*1*/dx; }
+ module M {
+ var z = 100;
+ export var y = { /*2*/dx, z };
+ }
+ M.y./*3*/dx;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment_test.go b/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment_test.go
new file mode 100644
index 0000000000..b3d83a5d77
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWithShorthandPropertyAssignment_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWithShorthandPropertyAssignment(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` var /*0*/name = "Foo";
+
+ var obj = { /*1*/name };
+ var obj1 = { /*2*/name: /*3*/name };
+ obj./*4*/name;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "3", "1", "2", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefsWriteAccess_test.go b/internal/fourslash/tests/gen/findAllRefsWriteAccess_test.go
new file mode 100644
index 0000000000..7f4ab28ec0
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefsWriteAccess_test.go
@@ -0,0 +1,33 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefsWriteAccess(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Obj {
+ [` + "`" + `/*1*/num` + "`" + `]: number;
+}
+
+let o: Obj = {
+ [` + "`" + `num` + "`" + `]: 0
+};
+
+o = {
+ ['num']: 1
+};
+
+o['num'] = 2;
+o[` + "`" + `num` + "`" + `] = 3;
+
+o['num'];
+o[` + "`" + `num` + "`" + `];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefs_importType_js4_test.go b/internal/fourslash/tests/gen/findAllRefs_importType_js4_test.go
new file mode 100644
index 0000000000..aaca8a83db
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefs_importType_js4_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefs_importType_js4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @module: commonjs
+// @allowJs: true
+// @checkJs: true
+// @Filename: /a.js
+/**
+ * @callback /**/A
+ * @param {unknown} response
+ */
+
+module.exports = {};
+// @Filename: /b.js
+/** @typedef {import("./a").A} A */`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefs_importType_meaningAtLocation_test.go b/internal/fourslash/tests/gen/findAllRefs_importType_meaningAtLocation_test.go
new file mode 100644
index 0000000000..c35480b923
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefs_importType_meaningAtLocation_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefs_importType_meaningAtLocation(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/*1*/export type /*2*/T = 0;
+/*3*/export const /*4*/T = 0;
+// @Filename: /b.ts
+const x: import("./a")./*5*/T = 0;
+const x: typeof import("./a")./*6*/T = 0;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefs_importType_named_test.go b/internal/fourslash/tests/gen/findAllRefs_importType_named_test.go
new file mode 100644
index 0000000000..f7cd7bd8a8
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefs_importType_named_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefs_importType_named(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+/*1*/export type /*2*/T = number;
+/*3*/export type /*4*/U = string;
+// @Filename: /b.ts
+const x: import("./a")./*5*/T = 0;
+const x: import("./a")./*6*/U = 0;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefs_importType_typeofImport_test.go b/internal/fourslash/tests/gen/findAllRefs_importType_typeofImport_test.go
new file mode 100644
index 0000000000..08792f35a8
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefs_importType_typeofImport_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefs_importType_typeofImport(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /a.ts
+export const x = 0;
+// @Filename: /b.ts
+/*1*/const x: typeof import("/*2*/./a") = { x: 0 };
+/*3*/const y: typeof import("/*4*/./a") = { x: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findAllRefs_jsEnum_test.go b/internal/fourslash/tests/gen/findAllRefs_jsEnum_test.go
new file mode 100644
index 0000000000..8b9635f3b9
--- /dev/null
+++ b/internal/fourslash/tests/gen/findAllRefs_jsEnum_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindAllRefs_jsEnum(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /a.js
+/** @enum {string} */
+/*1*/const /*2*/E = { A: "" };
+/*3*/E["A"];
+/** @type {/*4*/E} */
+const e = /*5*/E.A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesAcrossMultipleProjects_test.go b/internal/fourslash/tests/gen/findReferencesAcrossMultipleProjects_test.go
new file mode 100644
index 0000000000..cc49f492dc
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesAcrossMultipleProjects_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesAcrossMultipleProjects(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: a.ts
+/*1*/var /*2*/x: number;
+//@Filename: b.ts
+///
+/*3*/x++;
+//@Filename: c.ts
+///
+/*4*/x++;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesAfterEdit_test.go b/internal/fourslash/tests/gen/findReferencesAfterEdit_test.go
new file mode 100644
index 0000000000..d38805586f
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesAfterEdit_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesAfterEdit(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: a.ts
+interface A {
+ /*1*/foo: string;
+}
+// @Filename: b.ts
+///
+/**/
+function foo(x: A) {
+ x./*2*/foo
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+ f.GoToMarker(t, "")
+ f.Insert(t, "\n")
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go
new file mode 100644
index 0000000000..5aceae785e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesBindingPatternInJsdocNoCrash1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @moduleResolution: node
+// @Filename: node_modules/use-query/package.json
+{
+ "name": "use-query",
+ "types": "index.d.ts"
+}
+// @Filename: node_modules/use-query/index.d.ts
+declare function useQuery(): {
+ data: string[];
+};
+// @Filename: node_modules/other/package.json
+{
+ "name": "other",
+ "types": "index.d.ts"
+}
+// @Filename: node_modules/other/index.d.ts
+interface BottomSheetModalProps {
+ /**
+ * A scrollable node or normal view.
+ * @type {({ data: any }?) => any}
+ */
+ children: ({ data: any }?) => any;
+}
+// @Filename: src/index.ts
+import { useQuery } from "use-query";
+const { /*1*/data } = useQuery();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go
new file mode 100644
index 0000000000..1ff230f14a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesBindingPatternInJsdocNoCrash2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @moduleResolution: node
+// @Filename: node_modules/use-query/package.json
+{
+ "name": "use-query",
+ "types": "index.d.ts"
+}
+// @Filename: node_modules/use-query/index.d.ts
+declare function useQuery(): {
+ data: string[];
+};
+// @Filename: node_modules/use-query/package.json
+{
+ "name": "other",
+ "types": "index.d.ts"
+}
+// @Filename: node_modules/other/index.d.ts
+interface BottomSheetModalProps {
+ /**
+ * A scrollable node or normal view.
+ * @type null | (({ data: any }?) => any)
+ */
+ children: null | (({ data: any }?) => any);
+}
+// @Filename: src/index.ts
+import { useQuery } from "use-query";
+const { /*1*/data } = useQuery();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesDefinitionDisplayParts_test.go b/internal/fourslash/tests/gen/findReferencesDefinitionDisplayParts_test.go
new file mode 100644
index 0000000000..6981eb7c6a
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesDefinitionDisplayParts_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesDefinitionDisplayParts(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Gre/*1*/eter {
+ someFunction() { th/*2*/is; }
+}
+
+type Options = "opt/*3*/ion 1" | "option 2";
+let myOption: Options = "option 1";
+
+some/*4*/Label:
+break someLabel;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesJSXTagName2_test.go b/internal/fourslash/tests/gen/findReferencesJSXTagName2_test.go
new file mode 100644
index 0000000000..856fcf2966
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesJSXTagName2_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesJSXTagName2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: index.tsx
+/*1*/const /*2*/obj = {Component: () => };
+const element = *3*/obj.Component/>;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesJSXTagName_test.go b/internal/fourslash/tests/gen/findReferencesJSXTagName_test.go
new file mode 100644
index 0000000000..c700ef584d
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesJSXTagName_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesJSXTagName(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: index.tsx
+import { /*1*/SubmissionComp } from "./RedditSubmission"
+function displaySubreddit(subreddit: string) {
+ let components = submissions
+ .map((value, index) => );
+}
+// @Filename: RedditSubmission.ts
+export const /*2*/SubmissionComp = (submission: SubmissionProps) =>
+ ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/findReferencesSeeTagInTs_test.go b/internal/fourslash/tests/gen/findReferencesSeeTagInTs_test.go
new file mode 100644
index 0000000000..5748a1f47e
--- /dev/null
+++ b/internal/fourslash/tests/gen/findReferencesSeeTagInTs_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestFindReferencesSeeTagInTs(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `function doStuffWithStuff/*1*/(stuff: { quantity: number }) {}
+
+declare const stuff: { quantity: number };
+/** @see {doStuffWithStuff} */
+if (stuff.quantity) {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfArrowFunction_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfArrowFunction_test.go
new file mode 100644
index 0000000000..6b0c4c5c13
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfArrowFunction_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfArrowFunction(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/f = x => x + 1;
+/*3*/f(12);`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfBindingPattern_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfBindingPattern_test.go
new file mode 100644
index 0000000000..9145f141a6
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfBindingPattern_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfBindingPattern(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const { /*1*/x, y } = { /*2*/x: 1, y: 2 };
+const z = /*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfClass_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfClass_test.go
new file mode 100644
index 0000000000..7ffcf4d91c
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfClass_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/class /*2*/C {
+ n: number;
+ constructor() {
+ this.n = 12;
+ }
+}
+let c = new /*3*/C();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfComputedProperty_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfComputedProperty_test.go
new file mode 100644
index 0000000000..e4a3fac0cb
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfComputedProperty_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfComputedProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `let o = { /*1*/["/*2*/foo"]: 12 };
+let y = o./*3*/foo;
+let z = o['/*4*/foo'];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfEnum_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfEnum_test.go
new file mode 100644
index 0000000000..9ce1bce0a2
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfEnum_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfEnum(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/enum /*2*/E {
+ First,
+ Second
+}
+let first = /*3*/E.First;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfExport_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfExport_test.go
new file mode 100644
index 0000000000..82ee0347ff
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfExport_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfExport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: m.ts
+export var /*1*/x = 12;
+// @Filename: main.ts
+import { /*2*/x } from "./m";
+const y = x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfFunction_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfFunction_test.go
new file mode 100644
index 0000000000..45b274c359
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfFunction_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfFunction(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/function /*2*/func(x: number) {
+}
+/*3*/func(x)`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterfaceClassMerge_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterfaceClassMerge_test.go
new file mode 100644
index 0000000000..bf74636cce
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterfaceClassMerge_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfInterfaceClassMerge(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/interface /*2*/Numbers {
+ p: number;
+}
+/*3*/interface /*4*/Numbers {
+ m: number;
+}
+/*5*/class /*6*/Numbers {
+ f(n: number) {
+ return this.p + this.m + n;
+ }
+}
+let i: /*7*/Numbers = new /*8*/Numbers();
+let x = i.f(i.p + i.m);`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterface_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterface_test.go
new file mode 100644
index 0000000000..163e79261f
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfInterface_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfInterface(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/interface /*2*/I {
+ p: number;
+}
+let i: /*3*/I = { p: 12 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNamespace_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNamespace_test.go
new file mode 100644
index 0000000000..ec47571f6b
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNamespace_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfNamespace(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/namespace /*2*/Numbers {
+ export var n = 12;
+}
+let x = /*3*/Numbers.n + 1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNumberNamedProperty_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNumberNamedProperty_test.go
new file mode 100644
index 0000000000..00d2aa3c82
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfNumberNamedProperty_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfNumberNamedProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `let o = { /*1*/1: 12 };
+let y = o[/*2*/1];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfParameter_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfParameter_test.go
new file mode 100644
index 0000000000..db7530e644
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfParameter_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfParameter(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `function f(/*1*/x: number) {
+ return /*2*/x + 1
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfStringNamedProperty_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfStringNamedProperty_test.go
new file mode 100644
index 0000000000..fafef8d456
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfStringNamedProperty_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfStringNamedProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `let o = { /*1*/"/*2*/x": 12 };
+let y = o./*3*/x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfTypeAlias_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfTypeAlias_test.go
new file mode 100644
index 0000000000..d52e14fa09
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfTypeAlias_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfTypeAlias(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/type /*2*/Alias= number;
+let n: /*3*/Alias = 12;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfVariable_test.go b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfVariable_test.go
new file mode 100644
index 0000000000..4afb5bf9a1
--- /dev/null
+++ b/internal/fourslash/tests/gen/getOccurrencesIsDefinitionOfVariable_test.go
@@ -0,0 +1,33 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestGetOccurrencesIsDefinitionOfVariable(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/x = 0;
+var assignmentRightHandSide = /*3*/x;
+var assignmentRightHandSide2 = 1 + /*4*/x;
+
+/*5*/x = 1;
+/*6*/x = /*7*/x + /*8*/x;
+
+/*9*/x == 1;
+/*10*/x <= 1;
+
+var preIncrement = ++/*11*/x;
+var postIncrement = /*12*/x++;
+var preDecrement = --/*13*/x;
+var postDecrement = /*14*/x--;
+
+/*15*/x += 1;
+/*16*/x <<= 1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16")
+}
diff --git a/internal/fourslash/tests/gen/indirectJsRequireRename_test.go b/internal/fourslash/tests/gen/indirectJsRequireRename_test.go
new file mode 100644
index 0000000000..43f8ccd558
--- /dev/null
+++ b/internal/fourslash/tests/gen/indirectJsRequireRename_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIndirectJsRequireRename(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: /bin/serverless.js
+require('../lib/classes/Error').log/**/Warning(` + "`" + `CLI triage crashed with: ${error.stack}` + "`" + `);
+// @Filename: /lib/plugins/aws/package/compile/events/httpApi/index.js
+const { logWarning } = require('../../../../../../classes/Error');
+// @Filename: /lib/classes/Error.js
+module.exports.logWarning = message => { };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.GoToMarker(t, "")
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionAcrossGlobalProjects_test.go b/internal/fourslash/tests/gen/isDefinitionAcrossGlobalProjects_test.go
new file mode 100644
index 0000000000..cdcdc26f23
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionAcrossGlobalProjects_test.go
@@ -0,0 +1,97 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionAcrossGlobalProjects(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/a/index.ts
+namespace NS {
+ export function /*1*/FA() {
+ FB();
+ }
+}
+
+interface /*2*/I {
+ /*3*/FA();
+}
+
+const ia: I = {
+ FA() { },
+ FB() { },
+ FC() { },
+ };
+// @Filename: /home/src/workspaces/project/a/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "references": [
+ { "path": "../b" },
+ { "path": "../c" },
+ ],
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/b/index.ts
+namespace NS {
+ export function /*4*/FB() {}
+}
+
+interface /*5*/I {
+ /*6*/FB();
+}
+
+const ib: I = { FB() {} };
+// @Filename: /home/src/workspaces/project/b/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/c/index.ts
+namespace NS {
+ export function /*7*/FC() {}
+}
+
+interface /*8*/I {
+ /*9*/FC();
+}
+
+const ic: I = { FC() {} };
+// @Filename: /home/src/workspaces/project/c/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/tsconfig.json
+{
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "a" },
+ ],
+ "files": []
+}
+// @Filename: /home/src/workspaces/project/tsconfig.settings.json
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "declarationMap": true,
+ "module": "none",
+ "emitDeclarationOnly": true,
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionAcrossModuleProjects_test.go b/internal/fourslash/tests/gen/isDefinitionAcrossModuleProjects_test.go
new file mode 100644
index 0000000000..98a8ee14d6
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionAcrossModuleProjects_test.go
@@ -0,0 +1,136 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionAcrossModuleProjects(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/a/index.ts
+import { NS } from "../b";
+import { I } from "../c";
+
+declare module "../b" {
+ export namespace NS {
+ export function /*1*/FA();
+ }
+}
+
+declare module "../c" {
+ export interface /*2*/I {
+ /*3*/FA();
+ }
+}
+
+const ia: I = {
+ FA: NS.FA,
+ FC() { },
+};
+// @Filename: /home/src/workspaces/project/a/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "references": [
+ { "path": "../b" },
+ { "path": "../c" },
+ ],
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/a2/index.ts
+import { NS } from "../b";
+import { I } from "../c";
+
+declare module "../b" {
+ export namespace NS {
+ export function /*4*/FA();
+ }
+}
+
+declare module "../c" {
+ export interface /*5*/I {
+ /*6*/FA();
+ }
+}
+
+const ia: I = {
+ FA: NS.FA,
+ FC() { },
+};
+// @Filename: /home/src/workspaces/project/a2/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "references": [
+ { "path": "../b" },
+ { "path": "../c" },
+ ],
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/b/index.ts
+export namespace NS {
+ export function /*7*/FB() {}
+}
+
+export interface /*8*/I {
+ /*9*/FB();
+}
+
+const ib: I = { FB() {} };
+// @Filename: /home/src/workspaces/project/b/other.ts
+export const Other = 1;
+// @Filename: /home/src/workspaces/project/b/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "files": [
+ "index.ts",
+ "other.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/c/index.ts
+export namespace NS {
+ export function /*10*/FC() {}
+}
+
+export interface /*11*/I {
+ /*12*/FC();
+}
+
+const ic: I = { FC() {} };
+// @Filename: /home/src/workspaces/project/c/tsconfig.json
+{
+ "extends": "../tsconfig.settings.json",
+ "files": [
+ "index.ts",
+ ],
+}
+// @Filename: /home/src/workspaces/project/tsconfig.json
+{
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "a" },
+ { "path": "a2" },
+ ],
+ "files": []
+}
+// @Filename: /home/src/workspaces/project/tsconfig.settings.json
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "declarationMap": true,
+ "module": "CommonJS",
+ "emitDeclarationOnly": true,
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionInterfaceImplementation_test.go b/internal/fourslash/tests/gen/isDefinitionInterfaceImplementation_test.go
new file mode 100644
index 0000000000..4663706823
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionInterfaceImplementation_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionInterfaceImplementation(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {
+ /*1*/M(): void;
+}
+
+class C implements I {
+ /*2*/M() { }
+}
+
+({} as I).M();
+({} as C).M();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionOverloads_test.go b/internal/fourslash/tests/gen/isDefinitionOverloads_test.go
new file mode 100644
index 0000000000..0ec53d8590
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionOverloads_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionOverloads(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `function /*1*/f(x: number): void;
+function /*2*/f(x: string): void;
+function /*3*/f(x: number | string) { }
+
+f(1);
+f("a");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionShorthandProperty_test.go b/internal/fourslash/tests/gen/isDefinitionShorthandProperty_test.go
new file mode 100644
index 0000000000..743326da9e
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionShorthandProperty_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionShorthandProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const /*1*/x = 1;
+const y: { /*2*/x: number } = { /*3*/x };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionSingleImport_test.go b/internal/fourslash/tests/gen/isDefinitionSingleImport_test.go
new file mode 100644
index 0000000000..3d6b6948f9
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionSingleImport_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionSingleImport(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @filename: a.ts
+export function /*1*/f() {}
+// @filename: b.ts
+import { /*2*/f } from "./a";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/isDefinitionSingleReference_test.go b/internal/fourslash/tests/gen/isDefinitionSingleReference_test.go
new file mode 100644
index 0000000000..bcbeb76bb9
--- /dev/null
+++ b/internal/fourslash/tests/gen/isDefinitionSingleReference_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestIsDefinitionSingleReference(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `function /*1*/f() {}
+/*2*/f();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/jsdocLink_findAllReferences1_test.go b/internal/fourslash/tests/gen/jsdocLink_findAllReferences1_test.go
new file mode 100644
index 0000000000..a5a5a3c751
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsdocLink_findAllReferences1_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsdocLink_findAllReferences1(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface A/**/ {}
+/**
+ * {@link A()} is ok
+ */
+declare const a: A`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/jsdocSatisfiesTagFindAllReferences_test.go b/internal/fourslash/tests/gen/jsdocSatisfiesTagFindAllReferences_test.go
new file mode 100644
index 0000000000..9a41f9fa98
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsdocSatisfiesTagFindAllReferences_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsdocSatisfiesTagFindAllReferences(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @noEmit: true
+// @allowJS: true
+// @checkJs: true
+// @filename: /a.js
+/**
+ * @typedef {Object} T
+ * @property {number} a
+ */
+
+/** @satisfies {/**/T} comment */
+const foo = { a: 1 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/jsdocThrowsTag_findAllReferences_test.go b/internal/fourslash/tests/gen/jsdocThrowsTag_findAllReferences_test.go
new file mode 100644
index 0000000000..79ff8af1a3
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsdocThrowsTag_findAllReferences_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsdocThrowsTag_findAllReferences(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class /**/E extends Error {}
+/**
+ * @throws {E}
+ */
+function f() {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning0_test.go b/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning0_test.go
new file mode 100644
index 0000000000..c5ff10b84b
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning0_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsdocTypedefTagSemanticMeaning0(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: a.js
+/** /*1*/@typedef {number} /*2*/T */
+/*3*/const /*4*/T = 1;
+/** @type {/*5*/T} */
+const n = /*6*/T;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning1_test.go b/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning1_test.go
new file mode 100644
index 0000000000..23ab8a1d1c
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsdocTypedefTagSemanticMeaning1_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsdocTypedefTagSemanticMeaning1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: a.js
+/** @typedef {number} */
+/*1*/const /*2*/T = 1;
+/** @type {/*3*/T} */
+const n = /*4*/T;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/jsxFindAllReferencesOnRuntimeImportWithPaths1_test.go b/internal/fourslash/tests/gen/jsxFindAllReferencesOnRuntimeImportWithPaths1_test.go
new file mode 100644
index 0000000000..21d0c0ed94
--- /dev/null
+++ b/internal/fourslash/tests/gen/jsxFindAllReferencesOnRuntimeImportWithPaths1_test.go
@@ -0,0 +1,43 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestJsxFindAllReferencesOnRuntimeImportWithPaths1(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: project/src/foo.ts
+import * as x from /**/"@foo/dir/jsx-runtime";
+// @Filename: project/src/bar.tsx
+export default ;
+// @Filename: project/src/baz.tsx
+export default <>>;
+// @Filename: project/src/bam.tsx
+export default ;
+// @Filename: project/src/bat.tsx
+export const a = 1;
+// @Filename: project/src/bal.tsx
+
+// @Filename: project/src/dir/jsx-runtime.ts
+export {}
+// @Filename: project/tsconfig.json
+{
+ "compilerOptions": {
+ "moduleResolution": "node",
+ "module": "es2020",
+ "jsx": "react-jsx",
+ "jsxImportSource": "@foo/dir",
+ "moduleDetection": "force",
+ "paths": {
+ "@foo/dir/jsx-runtime": ["./src/dir/jsx-runtime"]
+ }
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/localGetReferences_test.go b/internal/fourslash/tests/gen/localGetReferences_test.go
new file mode 100644
index 0000000000..9a301f5d68
--- /dev/null
+++ b/internal/fourslash/tests/gen/localGetReferences_test.go
@@ -0,0 +1,199 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestLocalGetReferences(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: localGetReferences_1.ts
+// Comment Refence Test: g/*43*/lobalVar
+// References to a variable declared in global.
+/*1*/var /*2*/globalVar: number = 2;
+
+class fooCls {
+ // References to static variable declared in a class.
+ /*3*/static /*4*/clsSVar = 1;
+ // References to a variable declared in a class.
+ /*5*/clsVar = 1;
+
+ constructor (/*6*/public /*7*/clsParam: number) {
+ //Increments
+ /*8*/globalVar++;
+ this./*9*/clsVar++;
+ fooCls./*10*/clsSVar++;
+ // References to a class parameter.
+ this./*11*/clsParam++;
+ modTest.modVar++;
+ }
+}
+
+// References to a function parameter.
+/*12*/function /*13*/foo(/*14*/x: number) {
+ // References to a variable declared in a function.
+ /*15*/var /*16*/fnVar = 1;
+
+ //Increments
+ fooCls./*17*/clsSVar++;
+ /*18*/globalVar++;
+ modTest.modVar++;
+ /*19*/fnVar++;
+
+ //Return
+ return /*20*/x++;
+}
+
+module modTest {
+ //Declare
+ export var modVar:number;
+
+ //Increments
+ /*21*/globalVar++;
+ fooCls./*22*/clsSVar++;
+ modVar++;
+
+ class testCls {
+ static boo = /*23*/foo;
+ }
+
+ function testFn(){
+ static boo = /*24*/foo;
+
+ //Increments
+ /*25*/globalVar++;
+ fooCls./*26*/clsSVar++;
+ modVar++;
+ }
+
+ module testMod {
+ var boo = /*27*/foo;
+ }
+}
+
+//Type test
+var clsTest: fooCls;
+
+//Arguments
+// References to a class argument.
+clsTest = new fooCls(/*28*/globalVar);
+// References to a function argument.
+/*29*/foo(/*30*/globalVar);
+
+//Increments
+fooCls./*31*/clsSVar++;
+modTest.modVar++;
+/*32*/globalVar = /*33*/globalVar + /*34*/globalVar;
+
+//ETC - Other cases
+/*35*/globalVar = 3;
+// References to illegal assignment.
+/*36*/foo = /*37*/foo + 1;
+/*44*/err = err++;
+/*45*/
+//Shadowed fn Parameter
+function shdw(/*38*/globalVar: number) {
+ //Increments
+ /*39*/globalVar++;
+ return /*40*/globalVar;
+}
+
+//Remotes
+//Type test
+var remoteclsTest: remotefooCls;
+
+//Arguments
+remoteclsTest = new remotefooCls(remoteglobalVar);
+remotefoo(remoteglobalVar);
+
+//Increments
+remotefooCls.remoteclsSVar++;
+remotemodTest.remotemodVar++;
+remoteglobalVar = remoteglobalVar + remoteglobalVar;
+
+//ETC - Other cases
+remoteglobalVar = 3;
+
+//Find References misses method param
+var
+
+
+
+ array = ["f", "o", "o"];
+
+array.forEach(
+
+
+function(/*41*/str) {
+
+
+
+ // Reference misses function parameter.
+ return /*42*/str + " ";
+
+});
+// @Filename: localGetReferences_2.ts
+var remoteglobalVar: number = 2;
+
+class remotefooCls {
+ //Declare
+ remoteclsVar = 1;
+ static remoteclsSVar = 1;
+
+ constructor(public remoteclsParam: number) {
+ //Increments
+ remoteglobalVar++;
+ this.remoteclsVar++;
+ remotefooCls.remoteclsSVar++;
+ this.remoteclsParam++;
+ remotemodTest.remotemodVar++;
+ }
+}
+
+function remotefoo(remotex: number) {
+ //Declare
+ var remotefnVar = 1;
+
+ //Increments
+ remotefooCls.remoteclsSVar++;
+ remoteglobalVar++;
+ remotemodTest.remotemodVar++;
+ remotefnVar++;
+
+ //Return
+ return remotex++;
+}
+
+module remotemodTest {
+ //Declare
+ export var remotemodVar: number;
+
+ //Increments
+ remoteglobalVar++;
+ remotefooCls.remoteclsSVar++;
+ remotemodVar++;
+
+ class remotetestCls {
+ static remoteboo = remotefoo;
+ }
+` + "`" + `
+ function remotetestFn(){
+ static remoteboo = remotefoo;
+
+ //Increments
+ remoteglobalVar++;
+ remotefooCls.remoteclsSVar++;
+ remotemodVar++;
+ }
+
+ module remotetestMod {
+ var remoteboo = remotefoo;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45")
+}
diff --git a/internal/fourslash/tests/gen/referenceInParameterPropertyDeclaration_test.go b/internal/fourslash/tests/gen/referenceInParameterPropertyDeclaration_test.go
new file mode 100644
index 0000000000..b579a1d06d
--- /dev/null
+++ b/internal/fourslash/tests/gen/referenceInParameterPropertyDeclaration_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferenceInParameterPropertyDeclaration(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: file1.ts
+ class Foo {
+ constructor(private /*1*/privateParam: number,
+ public /*2*/publicParam: string,
+ protected /*3*/protectedParam: boolean) {
+
+ let localPrivate = privateParam;
+ this.privateParam += 10;
+
+ let localPublic = publicParam;
+ this.publicParam += " Hello!";
+
+ let localProtected = protectedParam;
+ this.protectedParam = false;
+ }
+ }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referenceToClass_test.go b/internal/fourslash/tests/gen/referenceToClass_test.go
new file mode 100644
index 0000000000..d29f1a37bc
--- /dev/null
+++ b/internal/fourslash/tests/gen/referenceToClass_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferenceToClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referenceToClass_1.ts
+class /*1*/foo {
+ public n: /*2*/foo;
+ public foo: number;
+}
+
+class bar {
+ public n: /*3*/foo;
+ public k = new /*4*/foo();
+}
+
+module mod {
+ var k: /*5*/foo = null;
+}
+// @Filename: referenceToClass_2.ts
+var k: /*6*/foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/referenceToEmptyObject_test.go b/internal/fourslash/tests/gen/referenceToEmptyObject_test.go
new file mode 100644
index 0000000000..ddd33ebfbf
--- /dev/null
+++ b/internal/fourslash/tests/gen/referenceToEmptyObject_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferenceToEmptyObject(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const obj = {}/*1*/;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/references01_test.go b/internal/fourslash/tests/gen/references01_test.go
new file mode 100644
index 0000000000..a0930537a1
--- /dev/null
+++ b/internal/fourslash/tests/gen/references01_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferences01(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/referencesForGlobals_1.ts
+class /*0*/globalClass {
+ public f() { }
+}
+// @Filename: /home/src/workspaces/project/referencesForGlobals_2.ts
+///
+var c = /*1*/globalClass();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesBloomFilters2_test.go b/internal/fourslash/tests/gen/referencesBloomFilters2_test.go
new file mode 100644
index 0000000000..471bfb582c
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesBloomFilters2_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesBloomFilters2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: declaration.ts
+var container = { /*1*/42: 1 };
+// @Filename: expression.ts
+function blah() { return (container[42]) === 2; };
+// @Filename: stringIndexer.ts
+function blah2() { container["42"] };
+// @Filename: redeclaration.ts
+container = { "42" : 18 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesBloomFilters3_test.go b/internal/fourslash/tests/gen/referencesBloomFilters3_test.go
new file mode 100644
index 0000000000..b0c08e0577
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesBloomFilters3_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesBloomFilters3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: declaration.ts
+enum Test { /*1*/"/*2*/42" = 1 };
+// @Filename: expression.ts
+(Test[/*3*/42]);`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesBloomFilters_test.go b/internal/fourslash/tests/gen/referencesBloomFilters_test.go
new file mode 100644
index 0000000000..151c422662
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesBloomFilters_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesBloomFilters(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: declaration.ts
+var container = { /*1*/searchProp : 1 };
+// @Filename: expression.ts
+function blah() { return (1 + 2 + container.searchProp()) === 2; };
+// @Filename: stringIndexer.ts
+function blah2() { container["searchProp"] };
+// @Filename: redeclaration.ts
+container = { "searchProp" : 18 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForAmbients_test.go b/internal/fourslash/tests/gen/referencesForAmbients_test.go
new file mode 100644
index 0000000000..a417f81a64
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForAmbients_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForAmbients(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/declare module "/*2*/foo" {
+ /*3*/var /*4*/f: number;
+}
+
+/*5*/declare module "/*6*/bar" {
+ /*7*/export import /*8*/foo = require("/*9*/foo");
+ var f2: typeof /*10*/foo./*11*/f;
+}
+
+declare module "baz" {
+ /*12*/import bar = require("/*13*/bar");
+ var f2: typeof bar./*14*/foo;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14")
+}
diff --git a/internal/fourslash/tests/gen/referencesForClassLocal_test.go b/internal/fourslash/tests/gen/referencesForClassLocal_test.go
new file mode 100644
index 0000000000..c42b4e5f08
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForClassLocal_test.go
@@ -0,0 +1,33 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForClassLocal(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var n = 14;
+
+class foo {
+ /*1*/private /*2*/n = 0;
+
+ public bar() {
+ this./*3*/n = 9;
+ }
+
+ constructor() {
+ this./*4*/n = 4;
+ }
+
+ public bar2() {
+ var n = 12;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForClassMembersExtendingAbstractClass_test.go b/internal/fourslash/tests/gen/referencesForClassMembersExtendingAbstractClass_test.go
new file mode 100644
index 0000000000..8129292533
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForClassMembersExtendingAbstractClass_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForClassMembersExtendingAbstractClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `abstract class Base {
+ abstract /*a1*/a: number;
+ abstract /*method1*/method(): void;
+}
+class MyClass extends Base {
+ /*a2*/a;
+ /*method2*/method() { }
+}
+
+var c: MyClass;
+c./*a3*/a;
+c./*method3*/method();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a1", "a2", "a3", "method1", "method2", "method3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForClassMembersExtendingGenericClass_test.go b/internal/fourslash/tests/gen/referencesForClassMembersExtendingGenericClass_test.go
new file mode 100644
index 0000000000..9f21ba1d01
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForClassMembersExtendingGenericClass_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForClassMembersExtendingGenericClass(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Base {
+ /*a1*/a: this;
+ /*method1*/method(a?:T, b?:U): this { }
+}
+class MyClass extends Base {
+ /*a2*/a;
+ /*method2*/method() { }
+}
+
+var c: MyClass;
+c./*a3*/a;
+c./*method3*/method();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a1", "a2", "a3", "method1", "method2", "method3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForClassMembers_test.go b/internal/fourslash/tests/gen/referencesForClassMembers_test.go
new file mode 100644
index 0000000000..8e08a9f78e
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForClassMembers_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForClassMembers(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Base {
+ /*a1*/a: number;
+ /*method1*/method(): void { }
+}
+class MyClass extends Base {
+ /*a2*/a;
+ /*method2*/method() { }
+}
+
+var c: MyClass;
+c./*a3*/a;
+c./*method3*/method();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "a1", "a2", "a3", "method1", "method2", "method3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForClassParameter_test.go b/internal/fourslash/tests/gen/referencesForClassParameter_test.go
new file mode 100644
index 0000000000..24c0c23b60
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForClassParameter_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForClassParameter(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var p = 2;
+
+class p { }
+
+class foo {
+ constructor (/*1*/public /*2*/p: any) {
+ }
+
+ public f(p) {
+ this./*3*/p = p;
+ }
+
+}
+
+var n = new foo(undefined);
+n./*4*/p = null;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForContextuallyTypedObjectLiteralProperties_test.go b/internal/fourslash/tests/gen/referencesForContextuallyTypedObjectLiteralProperties_test.go
new file mode 100644
index 0000000000..ef5a7799e2
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForContextuallyTypedObjectLiteralProperties_test.go
@@ -0,0 +1,40 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForContextuallyTypedObjectLiteralProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface IFoo { /*xy*/xy: number; }
+
+// Assignment
+var a1: IFoo = { xy: 0 };
+var a2: IFoo = { xy: 0 };
+
+// Function call
+function consumer(f: IFoo) { }
+consumer({ xy: 1 });
+
+// Type cast
+var c = { xy: 0 };
+
+// Array literal
+var ar: IFoo[] = [{ xy: 1 }, { xy: 2 }];
+
+// Nested object literal
+var ob: { ifoo: IFoo } = { ifoo: { xy: 0 } };
+
+// Widened type
+var w: IFoo = { xy: undefined };
+
+// Untped -- should not be included
+var u = { xy: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "xy")
+}
diff --git a/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties2_test.go b/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties2_test.go
new file mode 100644
index 0000000000..9b647f8095
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties2_test.go
@@ -0,0 +1,49 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForContextuallyTypedUnionProperties2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface A {
+ a: number;
+ common: string;
+}
+
+interface B {
+ /*1*/b: number;
+ common: number;
+}
+
+// Assignment
+var v1: A | B = { a: 0, common: "" };
+var v2: A | B = { b: 0, common: 3 };
+
+// Function call
+function consumer(f: A | B) { }
+consumer({ a: 0, b: 0, common: 1 });
+
+// Type cast
+var c = { common: 0, b: 0 };
+
+// Array literal
+var ar: Array = [{ a: 0, common: "" }, { b: 0, common: 0 }];
+
+// Nested object literal
+var ob: { aorb: A|B } = { aorb: { b: 0, common: 0 } };
+
+// Widened type
+var w: A|B = { b:undefined, common: undefined };
+
+// Untped -- should not be included
+var u1 = { a: 0, b: 0, common: "" };
+var u2 = { b: 0, common: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties_test.go b/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties_test.go
new file mode 100644
index 0000000000..471ea513e4
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForContextuallyTypedUnionProperties_test.go
@@ -0,0 +1,49 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForContextuallyTypedUnionProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface A {
+ a: number;
+ /*1*/common: string;
+}
+
+interface B {
+ b: number;
+ /*2*/common: number;
+}
+
+// Assignment
+var v1: A | B = { a: 0, /*3*/common: "" };
+var v2: A | B = { b: 0, /*4*/common: 3 };
+
+// Function call
+function consumer(f: A | B) { }
+consumer({ a: 0, b: 0, /*5*/common: 1 });
+
+// Type cast
+var c = { /*6*/common: 0, b: 0 };
+
+// Array literal
+var ar: Array = [{ a: 0, /*7*/common: "" }, { b: 0, /*8*/common: 0 }];
+
+// Nested object literal
+var ob: { aorb: A|B } = { aorb: { b: 0, /*9*/common: 0 } };
+
+// Widened type
+var w: A|B = { a:0, /*10*/common: undefined };
+
+// Untped -- should not be included
+var u1 = { a: 0, b: 0, common: "" };
+var u2 = { b: 0, common: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
+}
diff --git a/internal/fourslash/tests/gen/referencesForDeclarationKeywords_test.go b/internal/fourslash/tests/gen/referencesForDeclarationKeywords_test.go
new file mode 100644
index 0000000000..48846fe766
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForDeclarationKeywords_test.go
@@ -0,0 +1,35 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForDeclarationKeywords(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Base {}
+interface Implemented1 {}
+/*classDecl1_classKeyword*/class C1 /*classDecl1_extendsKeyword*/extends Base /*classDecl1_implementsKeyword*/implements Implemented1 {
+ /*getDecl_getKeyword*/get e() { return 1; }
+ /*setDecl_setKeyword*/set e(v) {}
+}
+/*interfaceDecl1_interfaceKeyword*/interface I1 /*interfaceDecl1_extendsKeyword*/extends Base { }
+/*typeDecl_typeKeyword*/type T = { }
+/*enumDecl_enumKeyword*/enum E { }
+/*namespaceDecl_namespaceKeyword*/namespace N { }
+/*moduleDecl_moduleKeyword*/module M { }
+/*functionDecl_functionKeyword*/function fn() {}
+/*varDecl_varKeyword*/var x;
+/*letDecl_letKeyword*/let y;
+/*constDecl_constKeyword*/const z = 1;
+interface Implemented2 {}
+interface Implemented3 {}
+class C2 /*classDecl2_implementsKeyword*/implements Implemented2, Implemented3 {}
+interface I2 /*interfaceDecl2_extendsKeyword*/extends Implemented2, Implemented3 {}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "classDecl1_classKeyword", "classDecl1_extendsKeyword", "classDecl1_implementsKeyword", "classDecl2_implementsKeyword", "getDecl_getKeyword", "setDecl_setKeyword", "interfaceDecl1_interfaceKeyword", "interfaceDecl1_extendsKeyword", "interfaceDecl2_extendsKeyword", "typeDecl_typeKeyword", "enumDecl_enumKeyword", "namespaceDecl_namespaceKeyword", "moduleDecl_moduleKeyword", "functionDecl_functionKeyword", "varDecl_varKeyword", "letDecl_letKeyword", "constDecl_constKeyword")
+}
diff --git a/internal/fourslash/tests/gen/referencesForEnums_test.go b/internal/fourslash/tests/gen/referencesForEnums_test.go
new file mode 100644
index 0000000000..af587dbe88
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForEnums_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForEnums(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `enum E {
+ /*1*/value1 = 1,
+ /*2*/"/*3*/value2" = /*4*/value1,
+ /*5*/111 = 11
+}
+
+E./*6*/value1;
+E["/*7*/value2"];
+E./*8*/value2;
+E[/*9*/111];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9")
+}
diff --git a/internal/fourslash/tests/gen/referencesForExportedValues_test.go b/internal/fourslash/tests/gen/referencesForExportedValues_test.go
new file mode 100644
index 0000000000..dd5c8b12ca
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForExportedValues_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForExportedValues(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `module M {
+ /*1*/export var /*2*/variable = 0;
+
+ // local use
+ var x = /*3*/variable;
+}
+
+// external use
+M./*4*/variable`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForExpressionKeywords_test.go b/internal/fourslash/tests/gen/referencesForExpressionKeywords_test.go
new file mode 100644
index 0000000000..6ec8b0fab4
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForExpressionKeywords_test.go
@@ -0,0 +1,30 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForExpressionKeywords(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class C {
+ static x = 1;
+}
+/*new*/new C();
+/*void*/void C;
+/*typeof*/typeof C;
+/*delete*/delete C.x;
+/*async*/async function* f() {
+ /*yield*/yield C;
+ /*await*/await C;
+}
+"x" /*in*/in C;
+undefined /*instanceof*/instanceof C;
+undefined /*as*/as C;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "new", "void", "typeof", "yield", "await", "in", "instanceof", "as", "delete")
+}
diff --git a/internal/fourslash/tests/gen/referencesForExternalModuleNames_test.go b/internal/fourslash/tests/gen/referencesForExternalModuleNames_test.go
new file mode 100644
index 0000000000..f01ce0d1ca
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForExternalModuleNames_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForExternalModuleNames(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+/*1*/declare module "/*2*/foo" {
+ var f: number;
+}
+// @Filename: referencesForGlobals_2.ts
+/*3*/import f = require("/*4*/foo");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForFunctionOverloads_test.go b/internal/fourslash/tests/gen/referencesForFunctionOverloads_test.go
new file mode 100644
index 0000000000..d3358d930d
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForFunctionOverloads_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForFunctionOverloads(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/function /*2*/foo(x: string);
+/*3*/function /*4*/foo(x: string, y: number) {
+ /*5*/foo('', 43);
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/referencesForFunctionParameter_test.go b/internal/fourslash/tests/gen/referencesForFunctionParameter_test.go
new file mode 100644
index 0000000000..3e60ab0a9b
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForFunctionParameter_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForFunctionParameter(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var x;
+var n;
+
+function n(x: number, /*1*/n: number) {
+ /*2*/n = 32;
+ x = /*3*/n;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobals2_test.go b/internal/fourslash/tests/gen/referencesForGlobals2_test.go
new file mode 100644
index 0000000000..a68023c267
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobals2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobals2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+/*1*/class /*2*/globalClass {
+ public f() { }
+}
+// @Filename: referencesForGlobals_2.ts
+var c = /*3*/globalClass();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobals3_test.go b/internal/fourslash/tests/gen/referencesForGlobals3_test.go
new file mode 100644
index 0000000000..a0fbdf23e7
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobals3_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobals3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+/*1*/interface /*2*/globalInterface {
+ f();
+}
+// @Filename: referencesForGlobals_2.ts
+var i: /*3*/globalInterface;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobals4_test.go b/internal/fourslash/tests/gen/referencesForGlobals4_test.go
new file mode 100644
index 0000000000..e7748fb210
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobals4_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobals4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+/*1*/module /*2*/globalModule {
+ export f() { };
+}
+// @Filename: referencesForGlobals_2.ts
+var m = /*3*/globalModule;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobals5_test.go b/internal/fourslash/tests/gen/referencesForGlobals5_test.go
new file mode 100644
index 0000000000..176433eab7
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobals5_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobals5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+module globalModule {
+ export var x;
+}
+
+/*1*/import /*2*/globalAlias = globalModule;
+// @Filename: referencesForGlobals_2.ts
+var m = /*3*/globalAlias;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobalsInExternalModule_test.go b/internal/fourslash/tests/gen/referencesForGlobalsInExternalModule_test.go
new file mode 100644
index 0000000000..ee69b5eaf8
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobalsInExternalModule_test.go
@@ -0,0 +1,31 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobalsInExternalModule(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/var /*2*/topLevelVar = 2;
+var topLevelVar2 = /*3*/topLevelVar;
+
+/*4*/class /*5*/topLevelClass { }
+var c = new /*6*/topLevelClass();
+
+/*7*/interface /*8*/topLevelInterface { }
+var i: /*9*/topLevelInterface;
+
+/*10*/module /*11*/topLevelModule {
+ export var x;
+}
+var x = /*12*/topLevelModule.x;
+
+export = x;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")
+}
diff --git a/internal/fourslash/tests/gen/referencesForGlobals_test.go b/internal/fourslash/tests/gen/referencesForGlobals_test.go
new file mode 100644
index 0000000000..9156eec570
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForGlobals_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForGlobals(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesForGlobals_1.ts
+/*1*/var /*2*/global = 2;
+
+class foo {
+ constructor (public global) { }
+ public f(global) { }
+ public f2(global) { }
+}
+
+class bar {
+ constructor () {
+ var n = /*3*/global;
+
+ var f = new foo('');
+ f.global = '';
+ }
+}
+
+var k = /*4*/global;
+// @Filename: referencesForGlobals_2.ts
+var m = /*5*/global;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/referencesForIllegalAssignment_test.go b/internal/fourslash/tests/gen/referencesForIllegalAssignment_test.go
new file mode 100644
index 0000000000..770f3f2317
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForIllegalAssignment_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForIllegalAssignment(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `f/*1*/oo = fo/*2*/o;
+var /*bar*/bar = function () { };
+bar = bar + 1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "bar")
+}
diff --git a/internal/fourslash/tests/gen/referencesForImports_test.go b/internal/fourslash/tests/gen/referencesForImports_test.go
new file mode 100644
index 0000000000..6f4f648f77
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForImports_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForImports(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `declare module "jquery" {
+ function $(s: string): any;
+ export = $;
+}
+/*1*/import /*2*/$ = require("jquery");
+/*3*/$("a");
+/*4*/import /*5*/$ = require("jquery");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/referencesForIndexProperty2_test.go b/internal/fourslash/tests/gen/referencesForIndexProperty2_test.go
new file mode 100644
index 0000000000..1d761dc33a
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForIndexProperty2_test.go
@@ -0,0 +1,18 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForIndexProperty2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var a;
+a["/*1*/blah"];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForIndexProperty3_test.go b/internal/fourslash/tests/gen/referencesForIndexProperty3_test.go
new file mode 100644
index 0000000000..2c9bb1158e
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForIndexProperty3_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForIndexProperty3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Object {
+ /*1*/toMyString();
+}
+
+var y: Object;
+y./*2*/toMyString();
+
+var x = {};
+x["/*3*/toMyString"]();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForIndexProperty_test.go b/internal/fourslash/tests/gen/referencesForIndexProperty_test.go
new file mode 100644
index 0000000000..ca8e5b5502
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForIndexProperty_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForIndexProperty(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/property: number;
+ /*2*/method(): void { }
+}
+
+var f: Foo;
+f["/*3*/property"];
+f["/*4*/method"];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties2_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties2_test.go
new file mode 100644
index 0000000000..455aff4272
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties2_test.go
@@ -0,0 +1,39 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface interface1 {
+ /*1*/doStuff(): void;
+}
+
+interface interface2 {
+ doStuff(): void;
+}
+
+interface interface2 extends interface1 {
+}
+
+class class1 implements interface2 {
+ doStuff() {
+
+ }
+}
+
+class class2 extends class1 {
+
+}
+
+var v: class2;
+v.doStuff();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties3_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties3_test.go
new file mode 100644
index 0000000000..48f0d4850b
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties3_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` interface interface1 extends interface1 {
+ /*1*/doStuff(): void;
+ /*2*/propName: string;
+ }
+
+ var v: interface1;
+ v./*3*/propName;
+ v./*4*/doStuff();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties4_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties4_test.go
new file mode 100644
index 0000000000..fe811d22c3
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties4_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class class1 extends class1 {
+ /*1*/doStuff() { }
+ /*2*/propName: string;
+ }
+
+ var c: class1;
+ c./*3*/doStuff();
+ c./*4*/propName;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties5_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties5_test.go
new file mode 100644
index 0000000000..ebceec5557
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties5_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` interface interface1 extends interface1 {
+ /*1*/doStuff(): void;
+ /*2*/propName: string;
+ }
+ interface interface2 extends interface1 {
+ doStuff(): void;
+ propName: string;
+ }
+
+ var v: interface1;
+ v.propName;
+ v.doStuff();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties6_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties6_test.go
new file mode 100644
index 0000000000..87418ee6f9
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties6_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class class1 extends class1 {
+ /*1*/doStuff() { }
+}
+class class2 extends class1 {
+ doStuff() { }
+}
+
+var v: class2;
+v.doStuff();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties7_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties7_test.go
new file mode 100644
index 0000000000..c2e3b2e0ed
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties7_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties7(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class class1 extends class1 {
+ /*0*/doStuff() { }
+ /*1*/propName: string;
+ }
+ interface interface1 extends interface1 {
+ /*2*/doStuff(): void;
+ /*3*/propName: string;
+ }
+ class class2 extends class1 implements interface1 {
+ /*4*/doStuff() { }
+ /*5*/propName: string;
+ }
+
+ var v: class2;
+ v.doStuff();
+ v.propName;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "0", "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties8_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties8_test.go
new file mode 100644
index 0000000000..27f2aeddba
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties8_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties8(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface C extends D {
+ /*d*/propD: number;
+}
+interface D extends C {
+ propD: string;
+ /*c*/propC: number;
+}
+var d: D;
+d.propD;
+d.propC;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "d", "c")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties9_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties9_test.go
new file mode 100644
index 0000000000..e273930cf9
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties9_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties9(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = ` class D extends C {
+ /*1*/prop1: string;
+ }
+
+ class C extends D {
+ /*2*/prop1: string;
+ }
+
+ var c: C;
+ c./*3*/prop1;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForInheritedProperties_test.go b/internal/fourslash/tests/gen/referencesForInheritedProperties_test.go
new file mode 100644
index 0000000000..3b3ebac800
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForInheritedProperties_test.go
@@ -0,0 +1,36 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForInheritedProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface interface1 {
+ /*1*/doStuff(): void;
+}
+
+interface interface2 extends interface1{
+ /*2*/doStuff(): void;
+}
+
+class class1 implements interface2 {
+ /*3*/doStuff() {
+
+ }
+}
+
+class class2 extends class1 {
+
+}
+
+var v: class2;
+v./*4*/doStuff();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel2_test.go b/internal/fourslash/tests/gen/referencesForLabel2_test.go
new file mode 100644
index 0000000000..efefc20c15
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel2_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var label = "label";
+while (true) {
+ if (false) break /**/label;
+ if (true) continue label;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel3_test.go b/internal/fourslash/tests/gen/referencesForLabel3_test.go
new file mode 100644
index 0000000000..e371a590bc
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel3_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/label: while (true) {
+ var label = "label";
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel4_test.go b/internal/fourslash/tests/gen/referencesForLabel4_test.go
new file mode 100644
index 0000000000..de8eae0387
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel4_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/label: function foo(label) {
+ while (true) {
+ /*2*/break /*3*/label;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel5_test.go b/internal/fourslash/tests/gen/referencesForLabel5_test.go
new file mode 100644
index 0000000000..da38cc76bf
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel5_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/label: while (true) {
+ if (false) /*2*/break /*3*/label;
+ function blah() {
+/*4*/label: while (true) {
+ if (false) /*5*/break /*6*/label;
+ }
+ }
+ if (false) /*7*/break /*8*/label;
+ }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel6_test.go b/internal/fourslash/tests/gen/referencesForLabel6_test.go
new file mode 100644
index 0000000000..03fe557b0e
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel6_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/labela: while (true) {
+/*2*/labelb: while (false) { /*3*/break /*4*/labelb; }
+ break labelc;
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForLabel_test.go b/internal/fourslash/tests/gen/referencesForLabel_test.go
new file mode 100644
index 0000000000..5f5fa4a2f1
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForLabel_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForLabel(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/label: while (true) {
+ if (false) /*2*/break /*3*/label;
+ if (true) /*4*/continue /*5*/label;
+}
+
+/*6*/label: while (false) { }
+var label = "label";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations2_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations2_test.go
new file mode 100644
index 0000000000..082be1013c
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations2_test.go
@@ -0,0 +1,26 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `module ATest {
+ export interface Bar { }
+}
+
+function ATest() { }
+
+/*1*/import /*2*/alias = ATest; // definition
+
+var a: /*3*/alias.Bar; // namespace
+/*4*/alias.call(this); // value`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations3_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations3_test.go
new file mode 100644
index 0000000000..b885fb07d6
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations3_test.go
@@ -0,0 +1,33 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `[|class /*class*/[|testClass|] {
+ static staticMethod() { }
+ method() { }
+}|]
+
+[|module /*module*/[|testClass|] {
+ export interface Bar {
+
+ }
+}|]
+
+var c1: [|testClass|];
+var c2: [|testClass|].Bar;
+[|testClass|].staticMethod();
+[|testClass|].prototype.method();
+[|testClass|].bind(this);
+new [|testClass|]();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "module", "class")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations4_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations4_test.go
new file mode 100644
index 0000000000..ce391d529a
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations4_test.go
@@ -0,0 +1,35 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/class /*2*/testClass {
+ static staticMethod() { }
+ method() { }
+}
+
+/*3*/module /*4*/testClass {
+ export interface Bar {
+
+ }
+ export var s = 0;
+}
+
+var c1: /*5*/testClass;
+var c2: /*6*/testClass.Bar;
+/*7*/testClass.staticMethod();
+/*8*/testClass.prototype.method();
+/*9*/testClass.bind(this);
+/*10*/testClass.s;
+new /*11*/testClass();`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations5_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations5_test.go
new file mode 100644
index 0000000000..a98370171a
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations5_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface /*1*/Foo { }
+module /*2*/Foo { export interface Bar { } }
+function /*3*/Foo() { }
+
+export = /*4*/Foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations6_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations6_test.go
new file mode 100644
index 0000000000..cfcf88cdb6
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations6_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Foo { }
+/*1*/module /*2*/Foo {
+ export interface Bar { }
+ export module Bar { export interface Baz { } }
+ export function Bar() { }
+}
+
+// module
+import a1 = /*3*/Foo;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations7_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations7_test.go
new file mode 100644
index 0000000000..83354b51fd
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations7_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations7(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Foo { }
+module Foo {
+ export interface /*1*/Bar { }
+ export module /*2*/Bar { export interface Baz { } }
+ export function /*3*/Bar() { }
+}
+
+// module, value and type
+import a2 = Foo./*4*/Bar;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations8_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations8_test.go
new file mode 100644
index 0000000000..f2486e8de1
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations8_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations8(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface Foo { }
+module Foo {
+ export interface Bar { }
+ /*1*/export module /*2*/Bar { export interface Baz { } }
+ export function Bar() { }
+}
+
+// module
+import a3 = Foo./*3*/Bar.Baz;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForMergedDeclarations_test.go b/internal/fourslash/tests/gen/referencesForMergedDeclarations_test.go
new file mode 100644
index 0000000000..5a427d3099
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForMergedDeclarations_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForMergedDeclarations(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/interface /*2*/Foo {
+}
+
+/*3*/module /*4*/Foo {
+ export interface Bar { }
+}
+
+/*5*/function /*6*/Foo(): void {
+}
+
+var f1: /*7*/Foo.Bar;
+var f2: /*8*/Foo;
+/*9*/Foo.bind(this);`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9")
+}
diff --git a/internal/fourslash/tests/gen/referencesForModifiers_test.go b/internal/fourslash/tests/gen/referencesForModifiers_test.go
new file mode 100644
index 0000000000..2157e37b6a
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForModifiers_test.go
@@ -0,0 +1,27 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForModifiers(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `[|/*declareModifier*/declare /*abstractModifier*/abstract class C1 {
+ [|/*staticModifier*/static a;|]
+ [|/*readonlyModifier*/readonly b;|]
+ [|/*publicModifier*/public c;|]
+ [|/*protectedModifier*/protected d;|]
+ [|/*privateModifier*/private e;|]
+}|]
+[|/*constModifier*/const enum E {
+}|]
+[|/*asyncModifier*/async function fn() {}|]
+[|/*exportModifier*/export /*defaultModifier*/default class C2 {}|]`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "declareModifier", "abstractModifier", "staticModifier", "readonlyModifier", "publicModifier", "protectedModifier", "privateModifier", "constModifier", "asyncModifier", "exportModifier", "defaultModifier")
+}
diff --git a/internal/fourslash/tests/gen/referencesForNoContext_test.go b/internal/fourslash/tests/gen/referencesForNoContext_test.go
new file mode 100644
index 0000000000..dd1d223397
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForNoContext_test.go
@@ -0,0 +1,36 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForNoContext(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `module modTest {
+ //Declare
+ export var modVar:number;
+ /*1*/
+
+ //Increments
+ modVar++;
+
+ class testCls{
+ /*2*/
+ }
+
+ function testFn(){
+ //Increments
+ modVar++;
+ } /*3*/
+/*4*/
+ module testMod {
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForNumericLiteralPropertyNames_test.go b/internal/fourslash/tests/gen/referencesForNumericLiteralPropertyNames_test.go
new file mode 100644
index 0000000000..8940ca7c27
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForNumericLiteralPropertyNames_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForNumericLiteralPropertyNames(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ public /*1*/12: any;
+}
+
+var x: Foo;
+x[12];
+x = { "12": 0 };
+x = { 12: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForObjectLiteralProperties_test.go b/internal/fourslash/tests/gen/referencesForObjectLiteralProperties_test.go
new file mode 100644
index 0000000000..80ffe95456
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForObjectLiteralProperties_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForObjectLiteralProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var x = { /*1*/add: 0, b: "string" };
+x["/*2*/add"];
+x./*3*/add;
+var y = x;
+y./*4*/add;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesForOverrides_test.go b/internal/fourslash/tests/gen/referencesForOverrides_test.go
new file mode 100644
index 0000000000..c428243a11
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForOverrides_test.go
@@ -0,0 +1,90 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForOverrides(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `module FindRef3 {
+ module SimpleClassTest {
+ export class Foo {
+ public /*foo*/foo(): void {
+ }
+ }
+ export class Bar extends Foo {
+ public foo(): void {
+ }
+ }
+ }
+
+ module SimpleInterfaceTest {
+ export interface IFoo {
+ /*ifoo*/ifoo(): void;
+ }
+ export interface IBar extends IFoo {
+ ifoo(): void;
+ }
+ }
+
+ module SimpleClassInterfaceTest {
+ export interface IFoo {
+ /*icfoo*/icfoo(): void;
+ }
+ export class Bar implements IFoo {
+ public icfoo(): void {
+ }
+ }
+ }
+
+ module Test {
+ export interface IBase {
+ /*field*/field: string;
+ /*method*/method(): void;
+ }
+
+ export interface IBlah extends IBase {
+ field: string;
+ }
+
+ export interface IBlah2 extends IBlah {
+ field: string;
+ }
+
+ export interface IDerived extends IBlah2 {
+ method(): void;
+ }
+
+ export class Bar implements IDerived {
+ public field: string;
+ public method(): void { }
+ }
+
+ export class BarBlah extends Bar {
+ public field: string;
+ }
+ }
+
+ function test() {
+ var x = new SimpleClassTest.Bar();
+ x.foo();
+
+ var y: SimpleInterfaceTest.IBar = null;
+ y.ifoo();
+
+ var w: SimpleClassInterfaceTest.Bar = null;
+ w.icfoo();
+
+ var z = new Test.BarBlah();
+ z.field = "";
+ z.method();
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "foo", "ifoo", "icfoo", "field", "method")
+}
diff --git a/internal/fourslash/tests/gen/referencesForPropertiesOfGenericType_test.go b/internal/fourslash/tests/gen/referencesForPropertiesOfGenericType_test.go
new file mode 100644
index 0000000000..6172ff9100
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForPropertiesOfGenericType_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForPropertiesOfGenericType(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface IFoo {
+ /*1*/doSomething(v: T): T;
+}
+
+var x: IFoo;
+x./*2*/doSomething("ss");
+
+var y: IFoo;
+y./*3*/doSomething(12);`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStatementKeywords_test.go b/internal/fourslash/tests/gen/referencesForStatementKeywords_test.go
new file mode 100644
index 0000000000..fcec2a2070
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStatementKeywords_test.go
@@ -0,0 +1,69 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStatementKeywords(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @filename: /main.ts
+// import ... = ...
+[|{| "id": "importEqualsDecl1" |}/*importEqualsDecl1_importKeyword*/[|import|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importEqualsDecl1" |}A|] = /*importEqualsDecl1_requireKeyword*/[|require|]("[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importEqualsDecl1" |}./a|]");|]
+[|{| "id": "namespaceDecl1" |}namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "namespaceDecl1" |}N|] { }|]
+[|{| "id": "importEqualsDecl2" |}/*importEqualsDecl2_importKeyword*/[|import|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importEqualsDecl2" |}N2|] = [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importEqualsDecl2" |}N|];|]
+
+// import ... from ...
+[|{| "id": "importDecl1" |}/*importDecl1_importKeyword*/[|import|] /*importDecl1_typeKeyword*/[|type|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importDecl1" |}B|] /*importDecl1_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importDecl1" |}./b|]";|]
+[|{| "id": "importDecl2" |}/*importDecl2_importKeyword*/[|import|] /*importDecl2_typeKeyword*/[|type|] * /*importDecl2_asKeyword*/[|as|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importDecl2" |}C|] /*importDecl2_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importDecl2" |}./c|]";|]
+[|{| "id": "importDecl3" |}/*importDecl3_importKeyword*/[|import|] /*importDecl3_typeKeyword*/[|type|] { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importDecl3" |}D|] } /*importDecl3_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importDecl3" |}./d|]";|]
+[|{| "id": "importDecl4" |}/*importDecl4_importKeyword*/[|import|] /*importDecl4_typeKeyword*/[|type|] { e1, e2 /*importDecl4_asKeyword*/[|as|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "importDecl4" |}e3|] } /*importDecl4_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importDecl4" |}./e|]";|]
+
+// import "module"
+[|{| "id": "importDecl5" |}/*importDecl5_importKeyword*/[|import|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "importDecl5" |}./f|]";|]
+
+// export ... from ...
+[|{| "id": "exportDecl1" |}/*exportDecl1_exportKeyword*/[|export|] /*exportDecl1_typeKeyword*/[|type|] * /*exportDecl1_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportDecl1" |}./g|]";|]
+[|{| "id": "exportDecl2" |}/*exportDecl2_exportKeyword*/[|export|] /*exportDecl2_typeKeyword*/[|type|] [|{| "id": "exportDecl2_namespaceExport" |}* /*exportDecl2_asKeyword*/[|as|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "exportDecl2" |}H|]|] /*exportDecl2_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportDecl2" |}./h|]";|]
+[|{| "id": "exportDecl3" |}/*exportDecl3_exportKeyword*/[|export|] /*exportDecl3_typeKeyword*/[|type|] { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "exportDecl3" |}I|] } /*exportDecl3_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportDecl3" |}./i|]";|]
+[|{| "id": "exportDecl4" |}/*exportDecl4_exportKeyword*/[|export|] /*exportDecl4_typeKeyword*/[|type|] { j1, j2 /*exportDecl4_asKeyword*/[|as|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "exportDecl4" |}j3|] } /*exportDecl4_fromKeyword*/[|from|] "[|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportDecl4" |}./j|]";|]
+[|{| "id": "typeDecl1" |}type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "typeDecl1" |}Z1|] = 1;|]
+[|{| "id": "exportDecl5" |}/*exportDecl5_exportKeyword*/[|export|] /*exportDecl5_typeKeyword*/[|type|] { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "exportDecl5" |}Z1|] };|]
+type Z2 = 2;
+type Z3 = 3;
+[|{| "id": "exportDecl6" |}/*exportDecl6_exportKeyword*/[|export|] /*exportDecl6_typeKeyword*/[|type|] { z2, z3 /*exportDecl6_asKeyword*/[|as|] [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "exportDecl6" |}z4|] };|]
+// @filename: /main2.ts
+[|{| "id": "varDecl1" |}const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "varDecl1" |}x|] = {};|]
+[|{| "id": "exportAssignment1" |}/*exportAssignment1_exportKeyword*/[|export|] = [|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportAssignment1"|}x|];|]
+// @filename: /main3.ts
+[|{| "id": "varDecl3" |}const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "varDecl3" |}y|] = {};|]
+[|{| "id": "exportAssignment2" |}/*exportAssignment2_exportKeyword*/[|export|] [|default|] [|{| "isWriteAccess": false, "isDefinition": false, "contextRangeId": "exportAssignment2"|}y|];|]
+// @filename: /a.ts
+export const a = 1;
+// @filename: /b.ts
+[|{| "id": "classDecl1" |}export default class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "classDecl1" |}B|] {}|]
+// @filename: /c.ts
+export const c = 1;
+// @filename: /d.ts
+[|{| "id": "classDecl2" |}export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "classDecl2" |}D|] {}|]
+// @filename: /e.ts
+export const e1 = 1;
+export const e2 = 2;
+// @filename: /f.ts
+export const f = 1;
+// @filename: /g.ts
+export const g = 1;
+// @filename: /h.ts
+export const h = 1;
+// @filename: /i.ts
+[|{| "id": "classDecl3" |}export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "classDecl3" |}I|] {}|]
+// @filename: /j.ts
+export const j1 = 1;
+export const j2 = 2;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "importEqualsDecl1_importKeyword", "importEqualsDecl1_requireKeyword", "importEqualsDecl2_importKeyword", "importDecl1_importKeyword", "importDecl1_typeKeyword", "importDecl1_fromKeyword", "importDecl2_importKeyword", "importDecl2_typeKeyword", "importDecl2_asKeyword", "importDecl2_fromKeyword", "importDecl3_importKeyword", "importDecl3_typeKeyword", "importDecl3_fromKeyword", "importDecl4_importKeyword", "importDecl4_typeKeyword", "importDecl4_fromKeyword", "importDecl4_asKeyword", "importDecl5_importKeyword", "exportDecl1_exportKeyword", "exportDecl1_typeKeyword", "exportDecl1_fromKeyword", "exportDecl2_exportKeyword", "exportDecl2_typeKeyword", "exportDecl2_asKeyword", "exportDecl2_fromKeyword", "exportDecl3_exportKeyword", "exportDecl3_typeKeyword", "exportDecl3_fromKeyword", "exportDecl4_exportKeyword", "exportDecl4_typeKeyword", "exportDecl4_fromKeyword", "exportDecl4_asKeyword", "exportDecl5_exportKeyword", "exportDecl5_typeKeyword", "exportDecl6_exportKeyword", "exportDecl6_typeKeyword", "exportDecl6_asKeyword", "exportAssignment1_exportKeyword", "exportAssignment2_exportKeyword")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStatic_test.go b/internal/fourslash/tests/gen/referencesForStatic_test.go
new file mode 100644
index 0000000000..84434f05fb
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStatic_test.go
@@ -0,0 +1,42 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStatic(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: referencesOnStatic_1.ts
+var n = 43;
+
+class foo {
+ /*1*/static /*2*/n = '';
+
+ public bar() {
+ foo./*3*/n = "'";
+ if(foo./*4*/n) {
+ var x = foo./*5*/n;
+ }
+ }
+}
+
+class foo2 {
+ private x = foo./*6*/n;
+ constructor() {
+ foo./*7*/n = x;
+ }
+
+ function b(n) {
+ n = foo./*8*/n;
+ }
+}
+// @Filename: referencesOnStatic_2.ts
+var q = foo./*9*/n;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStaticsAndMembersWithSameNames_test.go b/internal/fourslash/tests/gen/referencesForStaticsAndMembersWithSameNames_test.go
new file mode 100644
index 0000000000..cae12914f9
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStaticsAndMembersWithSameNames_test.go
@@ -0,0 +1,40 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStaticsAndMembersWithSameNames(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `module FindRef4 {
+ module MixedStaticsClassTest {
+ export class Foo {
+ /*1*/bar: Foo;
+ /*2*/static /*3*/bar: Foo;
+
+ /*4*/public /*5*/foo(): void {
+ }
+ /*6*/public static /*7*/foo(): void {
+ }
+ }
+ }
+
+ function test() {
+ // instance function
+ var x = new MixedStaticsClassTest.Foo();
+ x./*8*/foo();
+ x./*9*/bar;
+
+ // static function
+ MixedStaticsClassTest.Foo./*10*/foo();
+ MixedStaticsClassTest.Foo./*11*/bar;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames2_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames2_test.go
new file mode 100644
index 0000000000..b804e7556e
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames2_test.go
@@ -0,0 +1,22 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ /*1*/"/*2*/blah"() { return 0; }
+}
+
+var x: Foo;
+x./*3*/blah;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames3_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames3_test.go
new file mode 100644
index 0000000000..f43888eb6d
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames3_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo2 {
+ /*1*/get "/*2*/42"() { return 0; }
+ /*3*/set /*4*/42(n) { }
+}
+
+var y: Foo2;
+y[/*5*/42];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames4_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames4_test.go
new file mode 100644
index 0000000000..033bfa432d
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames4_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var x = { "/*1*/someProperty": 0 }
+x[/*2*/"someProperty"] = 3;
+x.someProperty = 5;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames5_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames5_test.go
new file mode 100644
index 0000000000..f8e1ce2aa3
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames5_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `var x = { "/*1*/someProperty": 0 }
+x["/*2*/someProperty"] = 3;
+x.someProperty = 5;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames6_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames6_test.go
new file mode 100644
index 0000000000..646c17e9f1
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames6_test.go
@@ -0,0 +1,19 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const x = function () { return 111111; }
+x./*1*/someProperty = 5;
+x["/*2*/someProperty"] = 3;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames7_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames7_test.go
new file mode 100644
index 0000000000..4b3f174c07
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames7_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames7(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: foo.js
+// @noEmit: true
+// @allowJs: true
+// @checkJs: true
+var x = { "/*1*/someProperty": 0 }
+x["/*2*/someProperty"] = 3;
+x.someProperty = 5;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames_test.go b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames_test.go
new file mode 100644
index 0000000000..14c62731c7
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForStringLiteralPropertyNames_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForStringLiteralPropertyNames(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `class Foo {
+ public "/*1*/ss": any;
+}
+
+var x: Foo;
+x.ss;
+x["ss"];
+x = { "ss": 0 };
+x = { ss: 0 };`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesForTypeKeywords_test.go b/internal/fourslash/tests/gen/referencesForTypeKeywords_test.go
new file mode 100644
index 0000000000..f7ed16407f
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForTypeKeywords_test.go
@@ -0,0 +1,23 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForTypeKeywords(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface I {}
+function f() {}
+type A1 = T /*conditionalType_extendsKeyword*/extends U ? 1 : 0;
+type A2 = T extends /*inferType_inferKeyword*/infer U ? 1 : 0;
+type A3 = { [P /*mappedType_inOperator*/in keyof T]: 1 };
+type A4 = /*keyofOperator_keyofKeyword*/keyof T;
+type A5 = /*readonlyOperator_readonlyKeyword*/readonly T[];`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "typeParam_extendsKeyword", "conditionalType_extendsKeyword", "inferType_inferKeyword", "mappedType_inOperator", "keyofOperator_keyofKeyword", "readonlyOperator_readonlyKeyword")
+}
diff --git a/internal/fourslash/tests/gen/referencesForUnionProperties_test.go b/internal/fourslash/tests/gen/referencesForUnionProperties_test.go
new file mode 100644
index 0000000000..678abc04dc
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesForUnionProperties_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesForUnionProperties(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `interface One {
+ common: { /*one*/a: number; };
+}
+
+interface Base {
+ /*base*/a: string;
+ b: string;
+}
+
+interface HasAOrB extends Base {
+ a: string;
+ b: string;
+}
+
+interface Two {
+ common: HasAOrB;
+}
+
+var x : One | Two;
+
+x.common./*x*/a;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "one", "base", "x")
+}
diff --git a/internal/fourslash/tests/gen/referencesInComment_test.go b/internal/fourslash/tests/gen/referencesInComment_test.go
new file mode 100644
index 0000000000..307dc29267
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesInComment_test.go
@@ -0,0 +1,20 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesInComment(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// References to /*1*/foo or b/*2*/ar
+/* in comments should not find fo/*3*/o or bar/*4*/ */
+class foo { }
+var bar = 0;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/referencesInConfiguredProject_test.go b/internal/fourslash/tests/gen/referencesInConfiguredProject_test.go
new file mode 100644
index 0000000000..618ebb7428
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesInConfiguredProject_test.go
@@ -0,0 +1,24 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesInConfiguredProject(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/referencesForGlobals_1.ts
+class /*0*/globalClass {
+ public f() { }
+}
+// @Filename: /home/src/workspaces/project/referencesForGlobals_2.ts
+var c = /*1*/globalClass();
+// @Filename: /home/src/workspaces/project/tsconfig.json
+{ "files": ["referencesForGlobals_1.ts", "referencesForGlobals_2.ts"] }`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesInEmptyFileWithMultipleProjects_test.go b/internal/fourslash/tests/gen/referencesInEmptyFileWithMultipleProjects_test.go
new file mode 100644
index 0000000000..04141f4343
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesInEmptyFileWithMultipleProjects_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesInEmptyFileWithMultipleProjects(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/a/tsconfig.json
+{ "files": ["a.ts"] }
+// @Filename: /home/src/workspaces/project/a/a.ts
+///
+/*1*/;
+// @Filename: /home/src/workspaces/project/b/tsconfig.json
+{ "files": ["b.ts"] }
+// @Filename: /home/src/workspaces/project/b/b.ts
+/*2*/;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesInEmptyFile_test.go b/internal/fourslash/tests/gen/referencesInEmptyFile_test.go
new file mode 100644
index 0000000000..7afa6fcc96
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesInEmptyFile_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesInEmptyFile(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `/*1*/`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesInStringLiteralValueWithMultipleProjects_test.go b/internal/fourslash/tests/gen/referencesInStringLiteralValueWithMultipleProjects_test.go
new file mode 100644
index 0000000000..2cbc1cc5d7
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesInStringLiteralValueWithMultipleProjects_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesInStringLiteralValueWithMultipleProjects(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /home/src/workspaces/project/a/tsconfig.json
+{ "files": ["a.ts"] }
+// @Filename: /home/src/workspaces/project/a/a.ts
+///
+const str: string = "hello/*1*/";
+// @Filename: /home/src/workspaces/project/b/tsconfig.json
+{ "files": ["b.ts"] }
+// @Filename: /home/src/workspaces/project/b/b.ts
+const str2: string = "hello/*2*/";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/referencesIsAvailableThroughGlobalNoCrash_test.go b/internal/fourslash/tests/gen/referencesIsAvailableThroughGlobalNoCrash_test.go
new file mode 100644
index 0000000000..0ea3c6e347
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesIsAvailableThroughGlobalNoCrash_test.go
@@ -0,0 +1,29 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesIsAvailableThroughGlobalNoCrash(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts
+declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
+export = debug;
+export as namespace debug;
+declare namespace debug {
+ interface Debug {
+ coerce: (val: any) => any;
+ }
+}
+// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/package.json
+{ "types": "index.d.ts" }
+// @Filename: /packages/playwright-core/src/index.ts
+export const debug: typeof import('../bundles/utils/node_modules//*1*/@types/debug') = require('./utilsBundleImpl').debug;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesToNonPropertyNameStringLiteral_test.go b/internal/fourslash/tests/gen/referencesToNonPropertyNameStringLiteral_test.go
new file mode 100644
index 0000000000..43e383c407
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesToNonPropertyNameStringLiteral_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesToNonPropertyNameStringLiteral(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const str: string = "hello/*1*/";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/referencesToStringLiteralValue_test.go b/internal/fourslash/tests/gen/referencesToStringLiteralValue_test.go
new file mode 100644
index 0000000000..8db6a6fca4
--- /dev/null
+++ b/internal/fourslash/tests/gen/referencesToStringLiteralValue_test.go
@@ -0,0 +1,17 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestReferencesToStringLiteralValue(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `const s: string = "some /*1*/ string";`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/remoteGetReferences_test.go b/internal/fourslash/tests/gen/remoteGetReferences_test.go
new file mode 100644
index 0000000000..4781235aaf
--- /dev/null
+++ b/internal/fourslash/tests/gen/remoteGetReferences_test.go
@@ -0,0 +1,191 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestRemoteGetReferences(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: remoteGetReferences_1.ts
+// Comment Refence Test: globalVar
+var globalVar: number = 2;
+
+class fooCls {
+ static clsSVar = 1;
+ //Declare
+ clsVar = 1;
+
+ constructor (public clsParam: number) {
+ //Increments
+ globalVar++;
+ this.clsVar++;
+ fooCls.clsSVar++;
+ this.clsParam++;
+ modTest.modVar++;
+ }
+}
+
+function foo(x: number) {
+ //Declare
+ var fnVar = 1;
+
+ //Increments
+ fooCls.clsSVar++;
+ globalVar++;
+ modTest.modVar++;
+ fnVar++;
+
+ //Return
+ return x++;
+}
+
+module modTest {
+ //Declare
+ export var modVar:number;
+
+ //Increments
+ globalVar++;
+ fooCls.clsSVar++;
+ modVar++;
+
+ class testCls {
+ static boo = foo;
+ }
+
+ function testFn(){
+ static boo = foo;
+
+ //Increments
+ globalVar++;
+ fooCls.clsSVar++;
+ modVar++;
+ }
+
+ module testMod {
+ var boo = foo;
+ }
+}
+
+//Type test
+var clsTest: fooCls;
+
+//Arguments
+clsTest = new fooCls(globalVar);
+foo(globalVar);
+
+//Increments
+fooCls.clsSVar++;
+modTest.modVar++;
+globalVar = globalVar + globalVar;
+
+//ETC - Other cases
+globalVar = 3;
+foo = foo + 1;
+err = err++;
+
+//Shadowed fn Parameter
+function shdw(globalVar: number) {
+ //Increments
+ globalVar++;
+ return globalVar;
+}
+
+//Remotes
+//Type test
+var remoteclsTest: /*1*/remotefooCls;
+
+//Arguments
+remoteclsTest = new /*2*/remotefooCls(/*3*/remoteglobalVar);
+remotefoo(/*4*/remoteglobalVar);
+
+//Increments
+/*5*/remotefooCls./*6*/remoteclsSVar++;
+remotemodTest.remotemodVar++;
+/*7*/remoteglobalVar = /*8*/remoteglobalVar + /*9*/remoteglobalVar;
+
+//ETC - Other cases
+/*10*/remoteglobalVar = 3;
+
+//Find References misses method param
+var
+
+
+
+ array = ["f", "o", "o"];
+
+array.forEach(
+
+
+function(str) {
+
+
+
+ return str + " ";
+
+});
+// @Filename: remoteGetReferences_2.ts
+/*11*/var /*12*/remoteglobalVar: number = 2;
+
+/*13*/class /*14*/remotefooCls {
+ //Declare
+ /*15*/remoteclsVar = 1;
+ /*16*/static /*17*/remoteclsSVar = 1;
+
+ constructor(public remoteclsParam: number) {
+ //Increments
+ /*18*/remoteglobalVar++;
+ this./*19*/remoteclsVar++;
+ /*20*/remotefooCls./*21*/remoteclsSVar++;
+ this.remoteclsParam++;
+ remotemodTest.remotemodVar++;
+ }
+}
+
+function remotefoo(remotex: number) {
+ //Declare
+ var remotefnVar = 1;
+
+ //Increments
+ /*22*/remotefooCls./*23*/remoteclsSVar++;
+ /*24*/remoteglobalVar++;
+ remotemodTest.remotemodVar++;
+ remotefnVar++;
+
+ //Return
+ return remotex++;
+}
+
+module remotemodTest {
+ //Declare
+ export var remotemodVar: number;
+
+ //Increments
+ /*25*/remoteglobalVar++;
+ /*26*/remotefooCls./*27*/remoteclsSVar++;
+ remotemodVar++;
+
+ class remotetestCls {
+ static remoteboo = remotefoo;
+ }
+
+ function remotetestFn(){
+ static remoteboo = remotefoo;
+
+ //Increments
+ /*28*/remoteglobalVar++;
+ /*29*/remotefooCls./*30*/remoteclsSVar++;
+ remotemodVar++;
+ }
+
+ module remotetestMod {
+ var remoteboo = remotefoo;
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30")
+}
diff --git a/internal/fourslash/tests/gen/renameJsExports02_test.go b/internal/fourslash/tests/gen/renameJsExports02_test.go
new file mode 100644
index 0000000000..cd8ee36596
--- /dev/null
+++ b/internal/fourslash/tests/gen/renameJsExports02_test.go
@@ -0,0 +1,21 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestRenameJsExports02(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: a.js
+module.exports = class /*1*/A {}
+// @Filename: b.js
+const /*2*/A = require("./a");`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2")
+}
diff --git a/internal/fourslash/tests/gen/renameJsExports03_test.go b/internal/fourslash/tests/gen/renameJsExports03_test.go
new file mode 100644
index 0000000000..4e4415d72e
--- /dev/null
+++ b/internal/fourslash/tests/gen/renameJsExports03_test.go
@@ -0,0 +1,25 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestRenameJsExports03(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @allowJs: true
+// @Filename: a.js
+class /*1*/A {
+ /*2*/constructor() { }
+}
+module.exports = A;
+// @Filename: b.js
+const /*3*/A = require("./a");
+new /*4*/A;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/tslibFindAllReferencesOnRuntimeImportWithPaths1_test.go b/internal/fourslash/tests/gen/tslibFindAllReferencesOnRuntimeImportWithPaths1_test.go
new file mode 100644
index 0000000000..872403577e
--- /dev/null
+++ b/internal/fourslash/tests/gen/tslibFindAllReferencesOnRuntimeImportWithPaths1_test.go
@@ -0,0 +1,37 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTslibFindAllReferencesOnRuntimeImportWithPaths1(t *testing.T) {
+ t.Parallel()
+ t.Skip()
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `// @Filename: project/src/foo.ts
+import * as x from /**/"tslib";
+// @Filename: project/src/bar.ts
+export default "";
+// @Filename: project/src/bal.ts
+
+// @Filename: project/src/dir/tslib.d.ts
+export function __importDefault(...args: any): any;
+export function __importStar(...args: any): any;
+// @Filename: project/tsconfig.json
+{
+ "compilerOptions": {
+ "moduleResolution": "node",
+ "module": "es2020",
+ "importHelpers": true,
+ "moduleDetection": "force",
+ "paths": {
+ "tslib": ["./src/dir/tslib"]
+ }
+ }
+}`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences10_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences10_test.go
new file mode 100644
index 0000000000..5f8d62dba5
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences10_test.go
@@ -0,0 +1,44 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences10(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface ClickableProps {
+ children?: string;
+ className?: string;
+ }
+ interface ButtonProps extends ClickableProps {
+ /*1*/onClick(event?: React.MouseEvent): void;
+ }
+ interface LinkProps extends ClickableProps {
+ goTo: string;
+ }
+ declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+ declare function MainButton(linkProps: LinkProps): JSX.Element;
+ declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+ let opt = ;
+ let opt = ;
+ let opt = {}} />;
+ let opt = {}} ignore-prop />;
+ let opt = ;
+ let opt = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences11_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences11_test.go
new file mode 100644
index 0000000000..31e45fa9de
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences11_test.go
@@ -0,0 +1,39 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences11(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface ClickableProps {
+ children?: string;
+ className?: string;
+ }
+ interface ButtonProps extends ClickableProps {
+ onClick(event?: React.MouseEvent): void;
+ }
+ interface LinkProps extends ClickableProps {
+ goTo: string;
+ }
+ declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+ declare function MainButton(linkProps: LinkProps): JSX.Element;
+ declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+ let opt = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences1_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences1_test.go
new file mode 100644
index 0000000000..b7dc7d442f
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences1_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ /*1*/div: {
+ name?: string;
+ isOpen?: boolean;
+ };
+ span: { n: string; };
+ }
+ }
+ var x = /*2*/*3*/div />;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences2_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences2_test.go
new file mode 100644
index 0000000000..e7631db8b4
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences2_test.go
@@ -0,0 +1,28 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ div: {
+ /*1*/name?: string;
+ isOpen?: boolean;
+ };
+ span: { n: string; };
+ }
+ }
+ var x = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences3_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences3_test.go
new file mode 100644
index 0000000000..001241a3f8
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences3_test.go
@@ -0,0 +1,31 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences3(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props }
+ }
+ class MyClass {
+ props: {
+ /*1*/name?: string;
+ size?: number;
+ }
+
+
+ var x = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences4_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences4_test.go
new file mode 100644
index 0000000000..3221f7255d
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences4_test.go
@@ -0,0 +1,31 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences4(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props }
+ }
+ /*1*/class /*2*/MyClass {
+ props: {
+ name?: string;
+ size?: number;
+ }
+
+
+ var x = /*3*/*4*/MyClass name='hello'>/*5*/MyClass>;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences5_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences5_test.go
new file mode 100644
index 0000000000..3b06c56a3e
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences5_test.go
@@ -0,0 +1,36 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences5(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface OptionPropBag {
+ propx: number
+ propString: string
+ optional?: boolean
+ }
+ /*1*/declare function /*2*/Opt(attributes: OptionPropBag): JSX.Element;
+ let opt = /*3*/*4*/Opt />;
+ let opt1 = /*5*/*6*/Opt propx={100} propString />;
+ let opt2 = /*7*/*8*/Opt propx={100} optional/>;
+ let opt3 = /*9*/*10*/Opt wrong />;
+ let opt4 = /*11*/*12*/Opt propx={100} propString="hi" />;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences6_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences6_test.go
new file mode 100644
index 0000000000..96922cf8d6
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences6_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences6(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface OptionPropBag {
+ propx: number
+ propString: string
+ optional?: boolean
+ }
+ declare function Opt(attributes: OptionPropBag): JSX.Element;
+ let opt = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences7_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences7_test.go
new file mode 100644
index 0000000000..66a1e9d48d
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences7_test.go
@@ -0,0 +1,35 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences7(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface OptionPropBag {
+ /*1*/propx: number
+ propString: string
+ optional?: boolean
+ }
+ declare function Opt(attributes: OptionPropBag): JSX.Element;
+ let opt = ;
+ let opt1 = ;
+ let opt2 = ;
+ let opt3 = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences8_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences8_test.go
new file mode 100644
index 0000000000..77818118d9
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences8_test.go
@@ -0,0 +1,44 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences8(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface ClickableProps {
+ children?: string;
+ className?: string;
+ }
+ interface ButtonProps extends ClickableProps {
+ onClick(event?: React.MouseEvent): void;
+ }
+ interface LinkProps extends ClickableProps {
+ goTo: string;
+ }
+ /*1*/declare function /*2*/MainButton(buttonProps: ButtonProps): JSX.Element;
+ /*3*/declare function /*4*/MainButton(linkProps: LinkProps): JSX.Element;
+ /*5*/declare function /*6*/MainButton(props: ButtonProps | LinkProps): JSX.Element;
+ let opt = /*7*/*8*/MainButton />;
+ let opt = /*9*/*10*/MainButton children="chidlren" />;
+ let opt = /*11*/*12*/MainButton onClick={()=>{}} />;
+ let opt = /*13*/*14*/MainButton onClick={()=>{}} ignore-prop />;
+ let opt = /*15*/*16*/MainButton goTo="goTo" />;
+ let opt = /*17*/*18*/MainButton wrong />;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferences9_test.go b/internal/fourslash/tests/gen/tsxFindAllReferences9_test.go
new file mode 100644
index 0000000000..a8b2e41414
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferences9_test.go
@@ -0,0 +1,45 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferences9(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ interface ClickableProps {
+ children?: string;
+ className?: string;
+ }
+ interface ButtonProps extends ClickableProps {
+ onClick(event?: React.MouseEvent): void;
+ }
+ interface LinkProps extends ClickableProps {
+ /*1*/goTo: string;
+ }
+ declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+ declare function MainButton(linkProps: LinkProps): JSX.Element;
+ declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+ let opt = ;
+ let opt = ;
+ let opt = {}} />;
+ let opt = {}} ignore-prop />;
+ let opt = ;
+ let opt = ;
+ let opt = ;`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType1_test.go b/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType1_test.go
new file mode 100644
index 0000000000..b4e3518efc
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType1_test.go
@@ -0,0 +1,33 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferencesUnionElementType1(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ declare module JSX {
+ interface Element { }
+ interface IntrinsicElements {
+ }
+ interface ElementAttributesProperty { props; }
+ }
+ function SFC1(prop: { x: number }) {
+ return hello
;
+ };
+ function SFC2(prop: { x: boolean }) {
+ return World
;
+ }
+ /*1*/var /*2*/SFCComp = SFC1 || SFC2;
+ /*3*/*4*/SFCComp x={ "hi" } />`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType2_test.go b/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType2_test.go
new file mode 100644
index 0000000000..704de86965
--- /dev/null
+++ b/internal/fourslash/tests/gen/tsxFindAllReferencesUnionElementType2_test.go
@@ -0,0 +1,32 @@
+package fourslash_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/fourslash"
+ "github.com/microsoft/typescript-go/internal/testutil"
+)
+
+func TestTsxFindAllReferencesUnionElementType2(t *testing.T) {
+ t.Parallel()
+
+ defer testutil.RecoverAndFail(t, "Panic on fourslash test")
+ const content = `//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+ class RC1 extends React.Component<{}, {}> {
+ render() {
+ return null;
+ }
+ }
+ class RC2 extends React.Component<{}, {}> {
+ render() {
+ return null;
+ }
+ private method() { }
+ }
+ /*1*/var /*2*/RCComp = RC1 || RC2;
+ /*3*/*4*/RCComp />`
+ f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
+ f.VerifyBaselineFindAllReferences(t, "1", "2", "3", "4")
+}
diff --git a/internal/ls/findallreferences_test.go b/internal/ls/findallreferences_test.go
index df9c521cf8..eba909ce5d 100644
--- a/internal/ls/findallreferences_test.go
+++ b/internal/ls/findallreferences_test.go
@@ -23,7 +23,7 @@ func runFindReferencesTest(t *testing.T, input string, expectedLocations map[str
// for each marker location, calculate the expected ref location ahead of time so we don't have to re-calculate each location for every reference call
allExpectedLocations := map[lsproto.Location]string{}
for _, expectedRange := range testData.Ranges {
- allExpectedLocations[*service.GetExpectedReferenceFromMarker(expectedRange.FileName, expectedRange.Position)] = *expectedRange.Name
+ allExpectedLocations[*service.GetExpectedReferenceFromMarker(expectedRange.FileName(), expectedRange.Position)] = *expectedRange.Name
}
for requestMarkerName, expectedSet := range expectedLocations {
@@ -32,7 +32,7 @@ func runFindReferencesTest(t *testing.T, input string, expectedLocations map[str
t.Fatalf("No marker found for '%s'", requestMarkerName)
}
- referencesResult := service.TestProvideReferences(marker.FileName, marker.Position)
+ referencesResult := service.TestProvideReferences(marker.FileName(), marker.Position)
libReference := 0
for _, loc := range referencesResult {
diff --git a/internal/ls/linemap.go b/internal/ls/linemap.go
index 04b67dc571..612eca39d0 100644
--- a/internal/ls/linemap.go
+++ b/internal/ls/linemap.go
@@ -1,6 +1,8 @@
package ls
import (
+ "cmp"
+ "slices"
"strings"
"unicode/utf8"
@@ -48,3 +50,20 @@ func ComputeLineStarts(text string) *LineMap {
AsciiOnly: asciiOnly,
}
}
+
+func (lm *LineMap) ComputeIndexOfLineStart(targetPos core.TextPos) int {
+ // port of computeLineOfPosition(lineStarts: readonly number[], position: number, lowerBound?: number): number {
+ lineNumber, ok := slices.BinarySearchFunc(lm.LineStarts, targetPos, func(p, t core.TextPos) int {
+ return cmp.Compare(int(p), int(t))
+ })
+ if !ok && lineNumber > 0 {
+ // If the actual position was not found, the binary search returns where the target line start would be inserted
+ // if the target was in the slice.
+ // e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20
+ // then the search will return (3, false).
+ //
+ // We want the index of the previous line start, so we subtract 1.
+ lineNumber = lineNumber - 1
+ }
+ return lineNumber
+}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/AmbientShorthandFindAllRefs.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/AmbientShorthandFindAllRefs.baseline.jsonc
new file mode 100644
index 0000000000..188cdbb005
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/AmbientShorthandFindAllRefs.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /user.ts ===
+
+// import {/*FIND ALL REFS*/[|x|]} from "jquery";
+
+
+
+
+// === findAllReferences ===
+// === /user2.ts ===
+
+// import {/*FIND ALL REFS*/[|x|]} from "jquery";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/AutoImportProvider_referencesCrash.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/AutoImportProvider_referencesCrash.baseline.jsonc
new file mode 100644
index 0000000000..982ae704a7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/AutoImportProvider_referencesCrash.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.d.ts ===
+
+// declare class[| A|] {
+// }
+// //# sourceMappingURL=index.d.ts.map
+
+
+// === /home/src/workspaces/project/b/b.ts ===
+
+// ///
+// new A/*FIND ALL REFS*/[| A|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences1.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences1.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences2.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences2.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences3.baseline.jsonc
new file mode 100644
index 0000000000..b8678d9946
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences3.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /constructorFindAllReferences3.ts ===
+
+// export class[| C|] {
+// /*FIND ALL REFS*/constructor() { }
+// public foo() { }
+// }
+//
+// new[| C|]().foo();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences4.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ConstructorFindAllReferences4.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences.baseline.jsonc
new file mode 100644
index 0000000000..dd4a0a5fb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /abc.d.ts ===
+
+// declare module "a" {
+// export const /*FIND ALL REFS*/[| x|]: number;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /abc.d.ts ===
+
+// declare module "a" {
+// export const[| x|]: number;
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences2.baseline.jsonc
new file mode 100644
index 0000000000..3995e0e898
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/EsModuleInteropFindAllReferences2.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.d.ts ===
+
+// export as namespace abc;
+// export const /*FIND ALL REFS*/[| x|]: number;
+
+
+
+
+// === findAllReferences ===
+// === /a.d.ts ===
+
+// export as namespace abc;
+// export const[| x|]: number;
+
+
+// === /b.ts ===
+
+// import a from "./a";
+// a./*FIND ALL REFS*/[|x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ExplainFilesNodeNextWithTypesReference.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ExplainFilesNodeNextWithTypesReference.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ExplainFilesNodeNextWithTypesReference.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferPropertyAccessExpressionHeritageClause.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferPropertyAccessExpressionHeritageClause.baseline.jsonc
new file mode 100644
index 0000000000..888592014d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferPropertyAccessExpressionHeritageClause.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /findAllReferPropertyAccessExpressionHeritageClause.ts ===
+
+// class B {}
+// function foo() {
+// return {/*FIND ALL REFS*/[|B|]: B};
+// }
+// class C extends (foo()).[|B|] {}
+// class C1 extends foo().[|B|] {}
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferPropertyAccessExpressionHeritageClause.ts ===
+
+// class B {}
+// function foo() {
+// return {[|B|]: B};
+// }
+// class C extends (foo())./*FIND ALL REFS*/[|B|] {}
+// class C1 extends foo().[|B|] {}
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferPropertyAccessExpressionHeritageClause.ts ===
+
+// class B {}
+// function foo() {
+// return {[|B|]: B};
+// }
+// class C extends (foo()).[|B|] {}
+// class C1 extends foo()./*FIND ALL REFS*/[|B|] {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesDynamicImport1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesDynamicImport1.baseline.jsonc
new file mode 100644
index 0000000000..4b3b49b5b3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesDynamicImport1.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFilteringMappedTypeProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFilteringMappedTypeProperty.baseline.jsonc
new file mode 100644
index 0000000000..76a2e0a8ed
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFilteringMappedTypeProperty.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+// === /findAllReferencesFilteringMappedTypeProperty.ts ===
+
+// const obj = { /*FIND ALL REFS*/[| a|]: 1, b: 2 };
+// const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { a: 0 };
+// filtered.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesFilteringMappedTypeProperty.ts ===
+
+// const obj = { a: 1, b: 2 };
+// const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { /*FIND ALL REFS*/[| a|]: 0 };
+// filtered.a;
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesFilteringMappedTypeProperty.ts ===
+
+// const obj = {[| a|]: 1, b: 2 };
+// const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { a: 0 };
+// filtered./*FIND ALL REFS*/[|a|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference1.baseline.jsonc
new file mode 100644
index 0000000000..f60874c300
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference1.baseline.jsonc
@@ -0,0 +1,7 @@
+// === findAllReferences ===
+// === /findAllReferencesFromLinkTagReference1.ts ===
+
+// enum E {[|
+// /** {@link /*FIND ALL REFS*/[|A|]} */
+// A|]
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference2.baseline.jsonc
new file mode 100644
index 0000000000..0da7a34eae
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference2.baseline.jsonc
@@ -0,0 +1,10 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// enum E {[|
+// /** {@link /*FIND ALL REFS*/[|Foo|]} */
+// Foo|]
+// }
+// interface Foo {
+// foo: E.[|Foo|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference3.baseline.jsonc
new file mode 100644
index 0000000000..d28991d065
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference3.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// interface Foo {
+// foo: E.[|Foo|];
+// }
+
+
+// === /b.ts ===
+
+// enum E {[|
+// /** {@link /*FIND ALL REFS*/[|Foo|]} */
+// Foo|]
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference4.baseline.jsonc
new file mode 100644
index 0000000000..57eea27c7d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference4.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /findAllReferencesFromLinkTagReference4.ts ===
+
+// enum E {
+// /** {@link /*FIND ALL REFS*/[|B|]} */
+// A,[|
+// B|]
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference5.baseline.jsonc
new file mode 100644
index 0000000000..79ce00e00f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesFromLinkTagReference5.baseline.jsonc
@@ -0,0 +1,7 @@
+// === findAllReferences ===
+// === /findAllReferencesFromLinkTagReference5.ts ===
+
+// enum E {[|
+// /** {@link E./*FIND ALL REFS*/[|A|]} */
+// A|]
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesImportMeta.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesImportMeta.baseline.jsonc
new file mode 100644
index 0000000000..42c49a22d3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesImportMeta.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+// === /findAllReferencesImportMeta.ts ===
+
+// // Haha that's so meta!
+//
+// let x = import.meta/*FIND ALL REFS*/[|meta|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionNew.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionNew.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionNew.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionThis.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionThis.baseline.jsonc
new file mode 100644
index 0000000000..fb3b9fe424
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJSDocFunctionThis.baseline.jsonc
@@ -0,0 +1,5 @@
+// === findAllReferences ===
+// === /Foo.js ===
+
+// /** @type {function (this: string, string): string} */
+// var f = function (s) { return /*FIND ALL REFS*/[| this|] + s; }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsDocTypeLiteral.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsDocTypeLiteral.baseline.jsonc
new file mode 100644
index 0000000000..89425d9242
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsDocTypeLiteral.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /foo.js ===
+
+// --- (line: 5) skipped ---
+// * @param {boolean} o.nested.great - much greatness
+// * @param {number} o.nested.times - twice? probably!??
+// */
+// function f(o) { return o.nested./*FIND ALL REFS*/[|great|]; }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc
new file mode 100644
index 0000000000..cdad8e08f2
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsOverloadedFunctionParameter.baseline.jsonc
@@ -0,0 +1,10 @@
+// === findAllReferences ===
+// === /foo.js ===
+
+// --- (line: 9) skipped ---
+// * @param {unknown} x
+// * @returns {unknown}
+// */
+// function foo(x/*FIND ALL REFS*/[|x|]) {
+// return[| x|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring.baseline.jsonc
new file mode 100644
index 0000000000..955a942afc
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+// === /bar.js ===
+
+// const { /*FIND ALL REFS*/[| foo|]: bar } = require('./foo');
+
+
+// === /foo.js ===
+
+// module.exports = {[|
+// foo|]: '1'
+// };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring1.baseline.jsonc
new file mode 100644
index 0000000000..30c9d17602
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesJsRequireDestructuring1.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /X.js ===
+
+// module.exports = {[| x|]: 1 };
+
+
+// === /Y.js ===
+
+// const { /*FIND ALL REFS*/[| x|]: { y } } = require("./X");
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc
new file mode 100644
index 0000000000..54de00df9b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag1.baseline.jsonc
@@ -0,0 +1,178 @@
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// class C {[|
+// m|]/*FIND ALL REFS*/() { }
+// n = 1
+// static s() { }
+// /**
+// * {@link m}
+// * @see {m}
+// * {@link C.m}
+// * @see {C.m}
+// * {@link C#m}
+// * @see {C#m}
+// * {@link C.prototype.[|m|]}
+// * @see {C.prototype.m}
+// */
+// p() { }
+// // --- (line: 16) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// class C {
+// m() { }[|
+// n|]/*FIND ALL REFS*/ = 1
+// static s() { }
+// /**
+// * {@link m}
+// // --- (line: 7) skipped ---
+
+
+// --- (line: 19) skipped ---
+// * @see {C.n}
+// * {@link C#n}
+// * @see {C#n}
+// * {@link C.prototype.[|n|]}
+// * @see {C.prototype.n}
+// */
+// q() { }
+// // --- (line: 27) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// class C {
+// m() { }
+// n = 1
+// static s/*FIND ALL REFS*/[| s|]() { }
+// /**
+// * {@link m}
+// * @see {m}
+// // --- (line: 8) skipped ---
+
+
+// --- (line: 26) skipped ---
+// /**
+// * {@link s}
+// * @see {s}
+// * {@link C.[|s|]}
+// * @see {C.s}
+// */
+// r() { }
+// // --- (line: 34) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// --- (line: 32) skipped ---
+// r() { }
+// }
+//
+// interface I {[|
+// a|]/*FIND ALL REFS*/()
+// b: 1
+// /**
+// * {@link a}
+// // --- (line: 41) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// --- (line: 33) skipped ---
+// }
+//
+// interface I {
+// a()[|
+// b|]/*FIND ALL REFS*/: 1
+// /**
+// * {@link a}
+// * @see {a}
+// // --- (line: 42) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// --- (line: 54) skipped ---
+// }
+//
+// function nestor() {
+// /** {@link [|r2|]} */
+// function ref() { }
+// /** @see {r2} */
+// function d3() { }
+// function r2/*FIND ALL REFS*/[| r2|]() { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// class C/*FIND ALL REFS*/[| C|] {
+// m() { }
+// n = 1
+// static s() { }
+// /**
+// * {@link m}
+// * @see {m}
+// * {@link [|C|].m}
+// * @see {C.m}
+// * {@link [|C|]#m}
+// * @see {C#m}
+// * {@link [|C|].prototype.m}
+// * @see {C.prototype.m}
+// */
+// p() { }
+// /**
+// * {@link n}
+// * @see {n}
+// * {@link [|C|].n}
+// * @see {C.n}
+// * {@link [|C|]#n}
+// * @see {C#n}
+// * {@link [|C|].prototype.n}
+// * @see {C.prototype.n}
+// */
+// q() { }
+// /**
+// * {@link s}
+// * @see {s}
+// * {@link [|C|].s}
+// * @see {C.s}
+// */
+// r() { }
+// // --- (line: 34) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag1.ts ===
+
+// --- (line: 32) skipped ---
+// r() { }
+// }
+//
+// interface I/*FIND ALL REFS*/[| I|] {
+// a()
+// b: 1
+// /**
+// // --- (line: 40) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc
new file mode 100644
index 0000000000..199831b51f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag2.baseline.jsonc
@@ -0,0 +1,106 @@
+// === findAllReferences ===
+// === /findAllReferencesLinkTag2.ts ===
+
+// namespace NPR {
+// export class Consider {
+// This = class {
+// show() { }
+// }[|
+// m|]/*FIND ALL REFS*/() { }
+// }
+// /**
+// * @see {Consider.prototype.m}
+// // --- (line: 10) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag2.ts ===
+
+// namespace NPR {
+// export class Consider {
+// This = class {[|
+// show|]/*FIND ALL REFS*/() { }
+// }
+// m() { }
+// }
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag2.ts ===
+
+// namespace NPR {
+// export class Consider {[|
+// This|]/*FIND ALL REFS*/ = class {
+// show() { }
+// }
+// m() { }
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag2.ts ===
+
+// namespace NPR {
+// export class Consider/*FIND ALL REFS*/[| Consider|] {
+// This = class {
+// show() { }
+// }
+// m() { }
+// }
+// /**
+// * @see {Consider.prototype.m}
+// * {@link [|Consider|]#m}
+// * @see {Consider#This#show}
+// * {@link [|Consider|].This.show}
+// * @see {NPR.Consider#This#show}
+// * {@link NPR.[|Consider|].This#show}
+// * @see {NPR.Consider#This.show} # doesn't parse trailing .
+// * @see {NPR.Consider.This.show}
+// */
+// export function ref() { }
+// }
+// /**
+// * {@link NPR.[|Consider|]#This#show hello hello}
+// * {@link NPR.[|Consider|].This#show}
+// * @see {NPR.Consider#This.show} # doesn't parse trailing .
+// * @see {NPR.Consider.This.show}
+// */
+// export function outerref() { }
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag2.ts ===
+
+// namespace NPR/*FIND ALL REFS*/[| NPR|] {
+// export class Consider {
+// This = class {
+// show() { }
+// // --- (line: 5) skipped ---
+
+
+// --- (line: 10) skipped ---
+// * @see {Consider#This#show}
+// * {@link Consider.This.show}
+// * @see {NPR.Consider#This#show}
+// * {@link [|NPR|].Consider.This#show}
+// * @see {NPR.Consider#This.show} # doesn't parse trailing .
+// * @see {NPR.Consider.This.show}
+// */
+// export function ref() { }
+// }
+// /**
+// * {@link [|NPR|].Consider#This#show hello hello}
+// * {@link [|NPR|].Consider.This#show}
+// * @see {NPR.Consider#This.show} # doesn't parse trailing .
+// * @see {NPR.Consider.This.show}
+// */
+// export function outerref() { }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc
new file mode 100644
index 0000000000..5f8c3d6307
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesLinkTag3.baseline.jsonc
@@ -0,0 +1,110 @@
+// === findAllReferences ===
+// === /findAllReferencesLinkTag3.ts ===
+
+// namespace NPR {
+// export class Consider {
+// This = class {
+// show() { }
+// }[|
+// m|]/*FIND ALL REFS*/() { }
+// }
+// /**
+// * {@linkcode Consider.prototype.[|m|]}
+// * {@linkplain Consider#m}
+// * {@linkcode Consider#This#show}
+// * {@linkplain Consider.This.show}
+// // --- (line: 13) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag3.ts ===
+
+// namespace NPR {
+// export class Consider {
+// This = class {[|
+// show|]/*FIND ALL REFS*/() { }
+// }
+// m() { }
+// }
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag3.ts ===
+
+// namespace NPR {
+// export class Consider {[|
+// This|]/*FIND ALL REFS*/ = class {
+// show() { }
+// }
+// m() { }
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag3.ts ===
+
+// namespace NPR {
+// export class Consider/*FIND ALL REFS*/[| Consider|] {
+// This = class {
+// show() { }
+// }
+// m() { }
+// }
+// /**
+// * {@linkcode [|Consider|].prototype.m}
+// * {@linkplain [|Consider|]#m}
+// * {@linkcode [|Consider|]#This#show}
+// * {@linkplain [|Consider|].This.show}
+// * {@linkcode NPR.[|Consider|]#This#show}
+// * {@linkplain NPR.[|Consider|].This#show}
+// * {@linkcode NPR.[|Consider|]#This.show} # doesn't parse trailing .
+// * {@linkcode NPR.[|Consider|].This.show}
+// */
+// export function ref() { }
+// }
+// /**
+// * {@linkplain NPR.[|Consider|]#This#show hello hello}
+// * {@linkplain NPR.[|Consider|].This#show}
+// * {@linkcode NPR.[|Consider|]#This.show} # doesn't parse trailing .
+// * {@linkcode NPR.[|Consider|].This.show}
+// */
+// export function outerref() { }
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesLinkTag3.ts ===
+
+// namespace NPR/*FIND ALL REFS*/[| NPR|] {
+// export class Consider {
+// This = class {
+// show() { }
+// // --- (line: 5) skipped ---
+
+
+// --- (line: 9) skipped ---
+// * {@linkplain Consider#m}
+// * {@linkcode Consider#This#show}
+// * {@linkplain Consider.This.show}
+// * {@linkcode [|NPR|].Consider#This#show}
+// * {@linkplain [|NPR|].Consider.This#show}
+// * {@linkcode [|NPR|].Consider#This.show} # doesn't parse trailing .
+// * {@linkcode [|NPR|].Consider.This.show}
+// */
+// export function ref() { }
+// }
+// /**
+// * {@linkplain [|NPR|].Consider#This#show hello hello}
+// * {@linkplain [|NPR|].Consider.This#show}
+// * {@linkcode [|NPR|].Consider#This.show} # doesn't parse trailing .
+// * {@linkcode [|NPR|].Consider.This.show}
+// */
+// export function outerref() { }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesNonExistentExportBinding.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesNonExistentExportBinding.baseline.jsonc
new file mode 100644
index 0000000000..dd280b7f95
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesNonExistentExportBinding.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /bar.ts ===
+
+// import { Foo/*FIND ALL REFS*/[| Foo|] } from "./foo";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor.baseline.jsonc
new file mode 100644
index 0000000000..e18ac3d5dd
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor.baseline.jsonc
@@ -0,0 +1,53 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// export class[| C|] {
+// /*FIND ALL REFS*/constructor(n: number);
+// constructor();
+// constructor(n?: number){}
+// static f() {
+// this.f();
+// new this();
+// }
+// }
+// new[| C|]();
+// const D =[| C|];
+// new D();
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export class[| C|] {
+// constructor(n: number);
+// /*FIND ALL REFS*/constructor();
+// constructor(n?: number){}
+// static f() {
+// this.f();
+// new this();
+// }
+// }
+// new[| C|]();
+// const D =[| C|];
+// new D();
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export class[| C|] {
+// constructor(n: number);
+// constructor();
+// /*FIND ALL REFS*/constructor(n?: number){}
+// static f() {
+// this.f();
+// new this();
+// }
+// }
+// new[| C|]();
+// const D =[| C|];
+// new D();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor_badOverload.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor_badOverload.baseline.jsonc
new file mode 100644
index 0000000000..8f764d409f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfConstructor_badOverload.baseline.jsonc
@@ -0,0 +1,18 @@
+// === findAllReferences ===
+// === /findAllReferencesOfConstructor_badOverload.ts ===
+
+// class[| C|] {
+// /*FIND ALL REFS*/constructor(n: number);
+// constructor(){}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllReferencesOfConstructor_badOverload.ts ===
+
+// class[| C|] {
+// constructor(n: number);
+// /*FIND ALL REFS*/constructor(){}
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfJsonModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfJsonModule.baseline.jsonc
new file mode 100644
index 0000000000..7b0e9c8a19
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesOfJsonModule.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import /*FIND ALL REFS*/[| settings|] from "./settings.json";[|
+// settings|];
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import[| settings|] from "./settings.json";[|
+// /*FIND ALL REFS*/settings|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesUndefined.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesUndefined.baseline.jsonc
new file mode 100644
index 0000000000..8b4fe44dc0
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllReferencesUndefined.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// /*FIND ALL REFS*/[|undefined|];
+//
+// void[| undefined|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsBadImport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsBadImport.baseline.jsonc
new file mode 100644
index 0000000000..39923a226d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsBadImport.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsBadImport.ts ===
+
+// import { ab as /*FIND ALL REFS*/[| cd|] } from "doesNotExist";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsCatchClause.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsCatchClause.baseline.jsonc
new file mode 100644
index 0000000000..7deff71f24
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsCatchClause.baseline.jsonc
@@ -0,0 +1,18 @@
+// === findAllReferences ===
+// === /findAllRefsCatchClause.ts ===
+
+// try { }
+// catch (/*FIND ALL REFS*/[|err|]) {[|
+// err|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsCatchClause.ts ===
+
+// try { }
+// catch ([|err|]) {[|
+// /*FIND ALL REFS*/err|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression0.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression0.baseline.jsonc
new file mode 100644
index 0000000000..e54d4fb96f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression0.baseline.jsonc
@@ -0,0 +1,34 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// export = class /*FIND ALL REFS*/[| A|] {
+// m() {[| A|]; }
+// };
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export = class[| A|] {
+// m() { /*FIND ALL REFS*/[| A|]; }
+// };
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import /*FIND ALL REFS*/[| A|] = require("./a");[|
+// A|];
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import[| A|] = require("./a");[|
+// /*FIND ALL REFS*/A|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression1.baseline.jsonc
new file mode 100644
index 0000000000..6ea8c2dc56
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression1.baseline.jsonc
@@ -0,0 +1,22 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// module.exports = class /*FIND ALL REFS*/[| A|] {};
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// import /*FIND ALL REFS*/[| A|] = require("./a");[|
+// A|];
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// import[| A|] = require("./a");[|
+// /*FIND ALL REFS*/A|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression2.baseline.jsonc
new file mode 100644
index 0000000000..b2dbc68d29
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassExpression2.baseline.jsonc
@@ -0,0 +1,22 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// exports./*FIND ALL REFS*/[|A|] = class {};
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// import { /*FIND ALL REFS*/[| A|] } from "./a";[|
+// A|];
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// import {[| A|] } from "./a";[|
+// /*FIND ALL REFS*/A|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassStaticBlocks.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassStaticBlocks.baseline.jsonc
new file mode 100644
index 0000000000..2055edb717
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsClassStaticBlocks.baseline.jsonc
@@ -0,0 +1,41 @@
+// === findAllReferences ===
+// === /findAllRefsClassStaticBlocks.ts ===
+
+// class ClassStaticBocks {
+// static x;[|
+// /*FIND ALL REFS*/static|] {}
+// static y;
+// static {}
+// static y;
+// static {}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsClassStaticBlocks.ts ===
+
+// class ClassStaticBocks {
+// static x;
+// static {}
+// static y;[|
+// /*FIND ALL REFS*/static|] {}
+// static y;
+// static {}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsClassStaticBlocks.ts ===
+
+// class ClassStaticBocks {
+// static x;
+// static {}
+// static y;
+// static {}
+// static y;[|
+// /*FIND ALL REFS*/static|] {}
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsConstructorFunctions.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsConstructorFunctions.baseline.jsonc
new file mode 100644
index 0000000000..5013f28c12
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsConstructorFunctions.baseline.jsonc
@@ -0,0 +1,39 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// function f() {[|
+// /*FIND ALL REFS*/this|].x = 0;
+// }
+// f.prototype.setX = function() {
+// this.x = 1;
+// }
+// f.prototype.useX = function() { this.x; }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// function f() {
+// this.x = 0;
+// }
+// f.prototype.setX = function() {[|
+// /*FIND ALL REFS*/this|].x = 1;
+// }
+// f.prototype.useX = function() { this.x; }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDeclareClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDeclareClass.baseline.jsonc
new file mode 100644
index 0000000000..478412ef18
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDeclareClass.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDeclareClass.ts ===
+
+// declare class /*FIND ALL REFS*/[| C|] {
+// static m(): void;
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefaultImport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefaultImport.baseline.jsonc
new file mode 100644
index 0000000000..f09f9c4e49
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefaultImport.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// export default function /*FIND ALL REFS*/[| a|]() {}
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import /*FIND ALL REFS*/[| a|], * as ns from "./a";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefinition.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefinition.baseline.jsonc
new file mode 100644
index 0000000000..40d5f4b498
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDefinition.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /findAllRefsDefinition.ts ===
+
+// const /*FIND ALL REFS*/[| x|] = 0;[|
+// x|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDefinition.ts ===
+
+// const[| x|] = 0;[|
+// /*FIND ALL REFS*/x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGeneric.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGeneric.baseline.jsonc
new file mode 100644
index 0000000000..ae081854db
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGeneric.baseline.jsonc
@@ -0,0 +1,20 @@
+// === findAllReferences ===
+// === /findAllRefsDestructureGeneric.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/x|]: boolean;
+// }
+// declare const i: I;
+// const {[| x|] } = i;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGeneric.ts ===
+
+// interface I {[|
+// x|]: boolean;
+// }
+// declare const i: I;
+// const { /*FIND ALL REFS*/[| x|] } = i;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGetter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGetter.baseline.jsonc
new file mode 100644
index 0000000000..c2db086387
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsDestructureGetter.baseline.jsonc
@@ -0,0 +1,80 @@
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get /*FIND ALL REFS*/[| x|]() { return 0; }
+//
+// set y(a: number) {}
+// }
+// const {[| x|], y } = new Test();
+// x; y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get[| x|]() { return 0; }
+//
+// set y(a: number) {}
+// }
+// const { /*FIND ALL REFS*/[| x|], y } = new Test();[|
+// x|]; y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get x() { return 0; }
+//
+// set y(a: number) {}
+// }
+// const {[| x|], y } = new Test();[|
+// /*FIND ALL REFS*/x|]; y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get x() { return 0; }
+//
+// set /*FIND ALL REFS*/[| y|](a: number) {}
+// }
+// const { x,[| y|] } = new Test();
+// x; y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get x() { return 0; }
+//
+// set[| y|](a: number) {}
+// }
+// const { x, /*FIND ALL REFS*/[| y|] } = new Test();
+// x;[| y|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsDestructureGetter.ts ===
+
+// class Test {
+// get x() { return 0; }
+//
+// set y(a: number) {}
+// }
+// const { x,[| y|] } = new Test();
+// x; /*FIND ALL REFS*/[| y|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumAsNamespace.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumAsNamespace.baseline.jsonc
new file mode 100644
index 0000000000..2d3b02c21b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumAsNamespace.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsEnumAsNamespace.ts ===
+
+// enum /*FIND ALL REFS*/[| E|] { A }
+// let e:[| E|].A;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsEnumAsNamespace.ts ===
+
+// enum[| E|] { A }
+// let e: /*FIND ALL REFS*/[| E|].A;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumMember.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumMember.baseline.jsonc
new file mode 100644
index 0000000000..ebfe4dbd2e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsEnumMember.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+// === /findAllRefsEnumMember.ts ===
+
+// enum E { /*FIND ALL REFS*/[| A|], B }
+// const e: E.[|A|] = E.[|A|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsEnumMember.ts ===
+
+// enum E {[| A|], B }
+// const e: E./*FIND ALL REFS*/[|A|] = E.[|A|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsEnumMember.ts ===
+
+// enum E {[| A|], B }
+// const e: E.A = E./*FIND ALL REFS*/[|A|] = E.[|A|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportConstEqualToClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportConstEqualToClass.baseline.jsonc
new file mode 100644
index 0000000000..070a9cbcc6
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportConstEqualToClass.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// class C {}
+// export const /*FIND ALL REFS*/[| D|] = C;
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import { /*FIND ALL REFS*/[| D|] } from "./a";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportDefaultClassConstructor.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportDefaultClassConstructor.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportDefaultClassConstructor.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportNotAtTopLevel.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportNotAtTopLevel.baseline.jsonc
new file mode 100644
index 0000000000..3aa05f1125
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsExportNotAtTopLevel.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsExportNotAtTopLevel.ts ===
+
+// {
+// export const /*FIND ALL REFS*/[| x|] = 0;[|
+// x|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsExportNotAtTopLevel.ts ===
+
+// {
+// export const[| x|] = 0;[|
+// /*FIND ALL REFS*/x|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties.baseline.jsonc
new file mode 100644
index 0000000000..823084f233
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties.baseline.jsonc
@@ -0,0 +1,45 @@
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties.ts ===
+
+// interface I {
+// ["/*FIND ALL REFS*/[|"prop1"|]]: () => void;
+// }
+//
+// class C implements I {
+// [[|"prop1"|]]: any;
+// }
+//
+// var x: I = {
+// ["prop1"]: function () { },
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties.ts ===
+
+// interface I {
+// [[|"prop1"|]]: () => void;
+// }
+//
+// class C implements I {
+// ["/*FIND ALL REFS*/[|"prop1"|]]: any;
+// }
+//
+// var x: I = {
+// ["prop1"]: function () { },
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties.ts ===
+
+// --- (line: 6) skipped ---
+// }
+//
+// var x: I = {
+// ["/*FIND ALL REFS*/[|"prop1"|]]: function () { },
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties2.baseline.jsonc
new file mode 100644
index 0000000000..5f379d5a98
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForComputedProperties2.baseline.jsonc
@@ -0,0 +1,45 @@
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties2.ts ===
+
+// interface I {
+// [/*FIND ALL REFS*/[|42|]](): void;
+// }
+//
+// class C implements I {
+// [[|42|]]: any;
+// }
+//
+// var x: I = {
+// ["42"]: function () { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties2.ts ===
+
+// interface I {
+// [[|42|]](): void;
+// }
+//
+// class C implements I {
+// [/*FIND ALL REFS*/[|42|]]: any;
+// }
+//
+// var x: I = {
+// ["42"]: function () { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForComputedProperties2.ts ===
+
+// --- (line: 6) skipped ---
+// }
+//
+// var x: I = {
+// ["/*FIND ALL REFS*/[|"42"|]]: function () { }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport01.baseline.jsonc
new file mode 100644
index 0000000000..5a6bf77c53
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport01.baseline.jsonc
@@ -0,0 +1,40 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport01.ts ===
+
+// export default class /*FIND ALL REFS*/[| DefaultExportedClass|] {
+// }
+//
+// var x:[| DefaultExportedClass|];
+//
+// var y = new[| DefaultExportedClass|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport01.ts ===
+
+// export default class[| DefaultExportedClass|] {
+// }
+//
+// var x: /*FIND ALL REFS*/[| DefaultExportedClass|];
+//
+// var y = new[| DefaultExportedClass|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport01.ts ===
+
+// export default class[| DefaultExportedClass|] {
+// }
+//
+// var x:[| DefaultExportedClass|];
+//
+// var y = new /*FIND ALL REFS*/[| DefaultExportedClass|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport02.baseline.jsonc
new file mode 100644
index 0000000000..26e1edd768
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport02.baseline.jsonc
@@ -0,0 +1,87 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport02.ts ===
+
+// export default function /*FIND ALL REFS*/[| DefaultExportedFunction|]() {
+// return[| DefaultExportedFunction|];
+// }
+//
+// var x: typeof[| DefaultExportedFunction|];
+//
+// var y =[| DefaultExportedFunction|]();
+//
+// namespace DefaultExportedFunction {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport02.ts ===
+
+// export default function[| DefaultExportedFunction|]() {
+// return /*FIND ALL REFS*/[| DefaultExportedFunction|];
+// }
+//
+// var x: typeof[| DefaultExportedFunction|];
+//
+// var y =[| DefaultExportedFunction|]();
+//
+// namespace DefaultExportedFunction {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport02.ts ===
+
+// export default function[| DefaultExportedFunction|]() {
+// return[| DefaultExportedFunction|];
+// }
+//
+// var x: typeof /*FIND ALL REFS*/[| DefaultExportedFunction|];
+//
+// var y =[| DefaultExportedFunction|]();
+//
+// namespace DefaultExportedFunction {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport02.ts ===
+
+// export default function[| DefaultExportedFunction|]() {
+// return[| DefaultExportedFunction|];
+// }
+//
+// var x: typeof[| DefaultExportedFunction|];
+//
+// var y = /*FIND ALL REFS*/[| DefaultExportedFunction|]();
+//
+// namespace DefaultExportedFunction {
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultExport02.ts ===
+
+// --- (line: 5) skipped ---
+//
+// var y = DefaultExportedFunction();
+//
+// namespace /*FIND ALL REFS*/[| DefaultExportedFunction|] {
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport04.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport04.baseline.jsonc
new file mode 100644
index 0000000000..21f95ef1b4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport04.baseline.jsonc
@@ -0,0 +1,37 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// const /*FIND ALL REFS*/[| a|] = 0;
+// export default[| a|];
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// const[| a|] = 0;
+// export default /*FIND ALL REFS*/[| a|];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import /*FIND ALL REFS*/[| a|] from "./a";[|
+// a|];
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import[| a|] from "./a";[|
+// /*FIND ALL REFS*/a|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport09.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport09.baseline.jsonc
new file mode 100644
index 0000000000..028711bb09
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport09.baseline.jsonc
@@ -0,0 +1,106 @@
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import * as /*FIND ALL REFS*/[| a|] from "./a.js"
+// import aDefault from "./a.js"
+// import * as b from "./b.js"
+// import bDefault from "./b.js"
+// // --- (line: 5) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import * as a from "./a.js"
+// import /*FIND ALL REFS*/[| aDefault|] from "./a.js"
+// import * as b from "./b.js"
+// import bDefault from "./b.js"
+//
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import * as a from "./a.js"
+// import aDefault from "./a.js"
+// import * as /*FIND ALL REFS*/[| b|] from "./b.js"
+// import bDefault from "./b.js"
+//
+// import * as c from "./c"
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import * as a from "./a.js"
+// import aDefault from "./a.js"
+// import * as b from "./b.js"
+// import /*FIND ALL REFS*/[| bDefault|] from "./b.js"
+//
+// import * as c from "./c"
+// import cDefault from "./c"
+// import * as d from "./d"
+// import dDefault from "./d"
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// import * as a from "./a.js"
+// import aDefault from "./a.js"
+// import * as b from "./b.js"
+// import bDefault from "./b.js"
+//
+// import * as /*FIND ALL REFS*/[| c|] from "./c"
+// import cDefault from "./c"
+// import * as d from "./d"
+// import dDefault from "./d"
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// --- (line: 3) skipped ---
+// import bDefault from "./b.js"
+//
+// import * as c from "./c"
+// import /*FIND ALL REFS*/[| cDefault|] from "./c"
+// import * as d from "./d"
+// import dDefault from "./d"
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// --- (line: 4) skipped ---
+//
+// import * as c from "./c"
+// import cDefault from "./c"
+// import * as /*FIND ALL REFS*/[| d|] from "./d"
+// import dDefault from "./d"
+
+
+
+
+// === findAllReferences ===
+// === /foo.ts ===
+
+// --- (line: 5) skipped ---
+// import * as c from "./c"
+// import cDefault from "./c"
+// import * as d from "./d"
+// import /*FIND ALL REFS*/[| dDefault|] from "./d"
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_anonymous.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_anonymous.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_anonymous.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_reExport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_reExport.baseline.jsonc
new file mode 100644
index 0000000000..ca6992ba1a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultExport_reExport.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+// === /export.ts ===
+
+// const /*FIND ALL REFS*/[| foo|] = 1;
+// export default[| foo|];
+
+
+
+
+// === findAllReferences ===
+// === /export.ts ===
+
+// const[| foo|] = 1;
+// export default /*FIND ALL REFS*/[| foo|];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /re-export-dep.ts ===
+
+// import /*FIND ALL REFS*/[| fooDefault|] from "./re-export";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultKeyword.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultKeyword.baseline.jsonc
new file mode 100644
index 0000000000..7cf9d56844
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForDefaultKeyword.baseline.jsonc
@@ -0,0 +1,30 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForDefaultKeyword.ts ===
+
+// --- (line: 5) skipped ---
+//
+// class default {}
+//
+// const foo = {[|
+// /*FIND ALL REFS*/default|]: 1
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForFunctionExpression01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForFunctionExpression01.baseline.jsonc
new file mode 100644
index 0000000000..3644f6d08b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForFunctionExpression01.baseline.jsonc
@@ -0,0 +1,61 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function /*FIND ALL REFS*/[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// foo|]([|foo|],[| foo|]);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function foo(a = /*FIND ALL REFS*/[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// foo|]([|foo|],[| foo|]);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function foo(a = foo(), b = () => /*FIND ALL REFS*/[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// foo|]([|foo|],[| foo|]);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// /*FIND ALL REFS*/foo|]([|foo|],[| foo|]);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// foo(/*FIND ALL REFS*/|]([|foo|],[| foo|]);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// var foo = function[| foo|](a =[| foo|](), b = () =>[| foo|]) {[|
+// foo(foo, /*FIND ALL REFS*/|]([|foo|],[| foo|]);
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCall.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCall.baseline.jsonc
new file mode 100644
index 0000000000..6ba97d494a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCall.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /app.ts ===
+
+// export function he/*FIND ALL REFS*/[| hello|]() {};
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCallType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCallType.baseline.jsonc
new file mode 100644
index 0000000000..6ba97d494a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForImportCallType.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /app.ts ===
+
+// export function he/*FIND ALL REFS*/[| hello|]() {};
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForMappedType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForMappedType.baseline.jsonc
new file mode 100644
index 0000000000..284a8945a5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForMappedType.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /findAllRefsForMappedType.ts ===
+
+// interface T { /*FIND ALL REFS*/[| a|]: number };
+// type U = { [K in keyof T]: string };
+// type V = { [K in keyof U]: boolean };
+// const u: U = { a: "" }
+// const v: V = { a: true }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectLiteralProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectLiteralProperties.baseline.jsonc
new file mode 100644
index 0000000000..3048eb1713
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectLiteralProperties.baseline.jsonc
@@ -0,0 +1,43 @@
+// === findAllReferences ===
+// === /findAllRefsForObjectLiteralProperties.ts ===
+
+// var x = {[|
+// /*FIND ALL REFS*/property|]: {}
+// };
+//
+// x.[|property|];
+//
+// let {[|property|]: pVar} = x;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForObjectLiteralProperties.ts ===
+
+// var x = {[|
+// property|]: {}
+// };
+//
+// x./*FIND ALL REFS*/[|property|];
+//
+// let {[|property|]: pVar} = x;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForObjectLiteralProperties.ts ===
+
+// var x = {[|
+// property|]: {}
+// };
+//
+// x.[|property|];
+//
+// let {/*FIND ALL REFS*/[|property|]: pVar} = x;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectSpread.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectSpread.baseline.jsonc
new file mode 100644
index 0000000000..951e638635
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForObjectSpread.baseline.jsonc
@@ -0,0 +1,52 @@
+// === findAllReferences ===
+// === /findAllRefsForObjectSpread.ts ===
+
+// interface A1 { readonly /*FIND ALL REFS*/[| a|]: string };
+// interface A2 { a?: number };
+// let a1: A1;
+// let a2: A2;
+// let a12 = { ...a1, ...a2 };
+// a12.[|a|];
+// a1.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForObjectSpread.ts ===
+
+// interface A1 { readonly a: string };
+// interface A2 { /*FIND ALL REFS*/[| a|]?: number };
+// let a1: A1;
+// let a2: A2;
+// let a12 = { ...a1, ...a2 };
+// a12.[|a|];
+// a1.a;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForObjectSpread.ts ===
+
+// interface A1 { readonly[| a|]: string };
+// interface A2 {[| a|]?: number };
+// let a1: A1;
+// let a2: A2;
+// let a12 = { ...a1, ...a2 };
+// a12./*FIND ALL REFS*/[|a|];
+// a1.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForObjectSpread.ts ===
+
+// interface A1 { readonly[| a|]: string };
+// interface A2 { a?: number };
+// let a1: A1;
+// let a2: A2;
+// let a12 = { ...a1, ...a2 };
+// a12.[|a|];
+// a1./*FIND ALL REFS*/[|a|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForRest.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForRest.baseline.jsonc
new file mode 100644
index 0000000000..ecad05c10e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForRest.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+// === /findAllRefsForRest.ts ===
+
+// interface Gen {
+// x: number[|
+// /*FIND ALL REFS*/parent|]: Gen;
+// millenial: string;
+// }
+// let t: Gen;
+// var { x, ...rest } = t;
+// rest.[|parent|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForRest.ts ===
+
+// interface Gen {
+// x: number[|
+// parent|]: Gen;
+// millenial: string;
+// }
+// let t: Gen;
+// var { x, ...rest } = t;
+// rest./*FIND ALL REFS*/[|parent|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstanceMethodInheritance.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstanceMethodInheritance.baseline.jsonc
new file mode 100644
index 0000000000..0b9a5ee847
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstanceMethodInheritance.baseline.jsonc
@@ -0,0 +1,100 @@
+// === findAllReferences ===
+// === /findAllRefsForStaticInstanceMethodInheritance.ts ===
+
+// class X{[|
+// /*FIND ALL REFS*/foo|](): void{}
+// }
+//
+// class Y extends X{
+// static foo(): void{}
+// }
+//
+// class Z extends Y{
+// static foo(): void{}[|
+// foo|](): void{}
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|]();
+// y.[|foo|]();
+// z.[|foo|]();
+// Y.foo();
+// Z.foo();
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstanceMethodInheritance.ts ===
+
+// class X{
+// foo(): void{}
+// }
+//
+// class Y extends X{
+// static /*FIND ALL REFS*/[| foo|](): void{}
+// }
+//
+// class Z extends Y{
+// // --- (line: 10) skipped ---
+
+
+// --- (line: 16) skipped ---
+// x.foo();
+// y.foo();
+// z.foo();
+// Y.[|foo|]();
+// Z.foo();
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstanceMethodInheritance.ts ===
+
+// --- (line: 6) skipped ---
+// }
+//
+// class Z extends Y{
+// static /*FIND ALL REFS*/[| foo|](): void{}
+// foo(): void{}
+// }
+//
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 17) skipped ---
+// y.foo();
+// z.foo();
+// Y.foo();
+// Z.[|foo|]();
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstanceMethodInheritance.ts ===
+
+// class X{[|
+// foo|](): void{}
+// }
+//
+// class Y extends X{
+// static foo(): void{}
+// }
+//
+// class Z extends Y{
+// static foo(): void{}[|
+// /*FIND ALL REFS*/foo|](): void{}
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|]();
+// y.[|foo|]();
+// z.[|foo|]();
+// Y.foo();
+// Z.foo();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstancePropertyInheritance.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstancePropertyInheritance.baseline.jsonc
new file mode 100644
index 0000000000..e209837da4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStaticInstancePropertyInheritance.baseline.jsonc
@@ -0,0 +1,232 @@
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{[|
+// /*FIND ALL REFS*/foo|]:any
+// }
+//
+// class Y extends X{
+// static foo:any
+// }
+//
+// class Z extends Y{
+// static foo:any[|
+// foo|]:any
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|];
+// y.[|foo|];
+// z.[|foo|];
+// Y.foo;
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{
+// foo:any
+// }
+//
+// class Y extends X{
+// static /*FIND ALL REFS*/[| foo|]:any
+// }
+//
+// class Z extends Y{
+// // --- (line: 10) skipped ---
+
+
+// --- (line: 16) skipped ---
+// x.foo;
+// y.foo;
+// z.foo;
+// Y.[|foo|];
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// --- (line: 6) skipped ---
+// }
+//
+// class Z extends Y{
+// static /*FIND ALL REFS*/[| foo|]:any
+// foo:any
+// }
+//
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 17) skipped ---
+// y.foo;
+// z.foo;
+// Y.foo;
+// Z.[|foo|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{[|
+// foo|]:any
+// }
+//
+// class Y extends X{
+// static foo:any
+// }
+//
+// class Z extends Y{
+// static foo:any[|
+// /*FIND ALL REFS*/foo|]:any
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|];
+// y.[|foo|];
+// z.[|foo|];
+// Y.foo;
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{[|
+// foo|]:any
+// }
+//
+// class Y extends X{
+// static foo:any
+// }
+//
+// class Z extends Y{
+// static foo:any[|
+// foo|]:any
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x./*FIND ALL REFS*/[|foo|];
+// y.[|foo|];
+// z.[|foo|];
+// Y.foo;
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{[|
+// foo|]:any
+// }
+//
+// class Y extends X{
+// static foo:any
+// }
+//
+// class Z extends Y{
+// static foo:any[|
+// foo|]:any
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|];
+// y./*FIND ALL REFS*/[|foo|];
+// z.[|foo|];
+// Y.foo;
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{[|
+// foo|]:any
+// }
+//
+// class Y extends X{
+// static foo:any
+// }
+//
+// class Z extends Y{
+// static foo:any[|
+// foo|]:any
+// }
+//
+// const x = new X();
+// const y = new Y();
+// const z = new Z();
+// x.[|foo|];
+// y.[|foo|];
+// z./*FIND ALL REFS*/[|foo|];
+// Y.foo;
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// class X{
+// foo:any
+// }
+//
+// class Y extends X{
+// static[| foo|]:any
+// }
+//
+// class Z extends Y{
+// // --- (line: 10) skipped ---
+
+
+// --- (line: 16) skipped ---
+// x.foo;
+// y.foo;
+// z.foo;
+// Y./*FIND ALL REFS*/[|foo|];
+// Z.foo;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForStaticInstancePropertyInheritance.ts ===
+
+// --- (line: 6) skipped ---
+// }
+//
+// class Z extends Y{
+// static[| foo|]:any
+// foo:any
+// }
+//
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 17) skipped ---
+// y.foo;
+// z.foo;
+// Y.foo;
+// Z./*FIND ALL REFS*/[|foo|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteral.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteral.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteral.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteralTypes.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteralTypes.baseline.jsonc
new file mode 100644
index 0000000000..7130888416
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForStringLiteralTypes.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForUMDModuleAlias1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForUMDModuleAlias1.baseline.jsonc
new file mode 100644
index 0000000000..20b23783eb
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForUMDModuleAlias1.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /0.d.ts ===
+
+// export function doThing(): string;
+// export function doTheOtherThing(): void;
+// export as namespace /*FIND ALL REFS*/[| myLib|];
+
+
+
+
+// === findAllReferences ===
+// === /0.d.ts ===
+
+// export function doThing(): string;
+// export function doTheOtherThing(): void;
+// export as namespace[| myLib|];
+
+
+// === /1.ts ===
+
+// [|///
+// /*FIND ALL REFS*/myLib|].doThing();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause01.baseline.jsonc
new file mode 100644
index 0000000000..80a5ed8019
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause01.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForVariableInExtendsClause01.ts ===
+
+// var /*FIND ALL REFS*/[| Base|] = class { };
+// class C extends[| Base|] { }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForVariableInExtendsClause01.ts ===
+
+// var[| Base|] = class { };
+// class C extends /*FIND ALL REFS*/[| Base|] { }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause02.baseline.jsonc
new file mode 100644
index 0000000000..3ca4224415
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInExtendsClause02.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForVariableInExtendsClause02.ts ===
+
+// interface /*FIND ALL REFS*/[| Base|] { }
+// namespace n {
+// var Base = class { };
+// interface I extends[| Base|] { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsForVariableInExtendsClause02.ts ===
+
+// interface[| Base|] { }
+// namespace n {
+// var Base = class { };
+// interface I extends /*FIND ALL REFS*/[| Base|] { }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInImplementsClause01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInImplementsClause01.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsForVariableInImplementsClause01.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsGlobalThisKeywordInModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsGlobalThisKeywordInModule.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsGlobalThisKeywordInModule.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportEquals.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportEquals.baseline.jsonc
new file mode 100644
index 0000000000..3de6dcb22e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportEquals.baseline.jsonc
@@ -0,0 +1,5 @@
+// === findAllReferences ===
+// === /findAllRefsImportEquals.ts ===
+
+// import j = N./*FIND ALL REFS*/[|q|];
+// namespace N { export const q = 0; }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportType.baseline.jsonc
new file mode 100644
index 0000000000..0634c3f22f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsImportType.baseline.jsonc
@@ -0,0 +1,15 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// module.exports = 0;
+// export type /*FIND ALL REFS*/[| N|] = number;
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInClassExpression.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInClassExpression.baseline.jsonc
new file mode 100644
index 0000000000..b011dea7d1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInClassExpression.baseline.jsonc
@@ -0,0 +1,18 @@
+// === findAllReferences ===
+// === /findAllRefsInClassExpression.ts ===
+
+// interface I { /*FIND ALL REFS*/[| boom|](): void; }
+// new class C implements I {[|
+// boom|](){}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInClassExpression.ts ===
+
+// interface I {[| boom|](): void; }
+// new class C implements I {[|
+// /*FIND ALL REFS*/boom|](){}
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIndexedAccessTypes.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIndexedAccessTypes.baseline.jsonc
new file mode 100644
index 0000000000..aac7f16a57
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIndexedAccessTypes.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /findAllRefsIndexedAccessTypes.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/0|]: number;
+// s: string;
+// }
+// interface J {
+// a: I[[|0|]],
+// b: I["s"],
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIndexedAccessTypes.ts ===
+
+// interface I {
+// 0: number;[|
+// /*FIND ALL REFS*/s|]: string;
+// }
+// interface J {
+// a: I[0],
+// b: I[[|"s"|]],
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIndexedAccessTypes.ts ===
+
+// interface I {[|
+// 0|]: number;
+// s: string;
+// }
+// interface J {
+// a: I[/*FIND ALL REFS*/[|0|]],
+// b: I["s"],
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIndexedAccessTypes.ts ===
+
+// interface I {
+// 0: number;[|
+// s|]: string;
+// }
+// interface J {
+// a: I[0],
+// b: I["/*FIND ALL REFS*/[|"s"|]],
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties1.baseline.jsonc
new file mode 100644
index 0000000000..531ad17e50
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties1.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties1.ts ===
+
+// class class1 extends class1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class1;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties1.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+//
+// var v: class1;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties1.ts ===
+
+// class class1 extends class1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class1;
+// v./*FIND ALL REFS*/[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties1.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class1;
+// v.doStuff();
+// v./*FIND ALL REFS*/[|propName|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties2.baseline.jsonc
new file mode 100644
index 0000000000..14d61c4578
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties2.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties2.ts ===
+
+// interface interface1 extends interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void; // r0
+// propName: string; // r1
+// }
+//
+// var v: interface1;
+// v.[|doStuff|](); // r2
+// v.propName; // r3
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties2.ts ===
+
+// interface interface1 extends interface1 {
+// doStuff(): void;[| // r0
+// /*FIND ALL REFS*/propName|]: string; // r1
+// }
+//
+// var v: interface1;
+// v.doStuff(); // r2
+// v.[|propName|]; // r3
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties2.ts ===
+
+// interface interface1 extends interface1 {[|
+// doStuff|](): void; // r0
+// propName: string; // r1
+// }
+//
+// var v: interface1;
+// v./*FIND ALL REFS*/[|doStuff|](); // r2
+// v.propName; // r3
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties2.ts ===
+
+// interface interface1 extends interface1 {
+// doStuff(): void;[| // r0
+// propName|]: string; // r1
+// }
+//
+// var v: interface1;
+// v.doStuff(); // r2
+// v./*FIND ALL REFS*/[|propName|]; // r3
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties3.baseline.jsonc
new file mode 100644
index 0000000000..2aefa97417
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties3.baseline.jsonc
@@ -0,0 +1,180 @@
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {[|
+// doStuff|](): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {[|
+// doStuff|](): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v./*FIND ALL REFS*/[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// propName|]: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties3.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// propName|]: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v./*FIND ALL REFS*/[|propName|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties4.baseline.jsonc
new file mode 100644
index 0000000000..13aa0f8668
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties4.baseline.jsonc
@@ -0,0 +1,72 @@
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties4.ts ===
+
+// interface C extends D {[|
+// /*FIND ALL REFS*/prop0|]: string;
+// prop1: number;
+// }
+//
+// interface D extends C {[|
+// prop0|]: string;
+// }
+//
+// var d: D;
+// d.[|prop0|];
+// d.prop1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties4.ts ===
+
+// interface C extends D {[|
+// prop0|]: string;
+// prop1: number;
+// }
+//
+// interface D extends C {[|
+// /*FIND ALL REFS*/prop0|]: string;
+// }
+//
+// var d: D;
+// d.[|prop0|];
+// d.prop1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties4.ts ===
+
+// interface C extends D {[|
+// prop0|]: string;
+// prop1: number;
+// }
+//
+// interface D extends C {[|
+// prop0|]: string;
+// }
+//
+// var d: D;
+// d./*FIND ALL REFS*/[|prop0|];
+// d.prop1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties4.ts ===
+
+// interface C extends D {
+// prop0: string;[|
+// /*FIND ALL REFS*/prop1|]: number;
+// }
+//
+// interface D extends C {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties5.baseline.jsonc
new file mode 100644
index 0000000000..ce8f8bfa60
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInheritedProperties5.baseline.jsonc
@@ -0,0 +1,66 @@
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties5.ts ===
+
+// class C extends D {[|
+// /*FIND ALL REFS*/prop0|]: string;
+// prop1: number;
+// }
+//
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties5.ts ===
+
+// class C extends D {
+// prop0: string;[|
+// /*FIND ALL REFS*/prop1|]: number;
+// }
+//
+// class D extends C {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties5.ts ===
+
+// class C extends D {
+// prop0: string;
+// prop1: number;
+// }
+//
+// class D extends C {[|
+// /*FIND ALL REFS*/prop0|]: string;
+// }
+//
+// var d: D;
+// d.[|prop0|];
+// d.prop1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInheritedProperties5.ts ===
+
+// class C extends D {
+// prop0: string;
+// prop1: number;
+// }
+//
+// class D extends C {[|
+// prop0|]: string;
+// }
+//
+// var d: D;
+// d./*FIND ALL REFS*/[|prop0|];
+// d.prop1;
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates1.baseline.jsonc
new file mode 100644
index 0000000000..35f968e946
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates1.baseline.jsonc
@@ -0,0 +1,28 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates1.ts ===
+
+// var /*FIND ALL REFS*/[| x|] = 10;
+// var y = `${[| x|] } ${[| x|] }`
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates1.ts ===
+
+// var[| x|] = 10;
+// var y = `${ /*FIND ALL REFS*/[| x|] } ${[| x|] }`
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates1.ts ===
+
+// var[| x|] = 10;
+// var y = `${ x } ${ /*FIND ALL REFS*/[| x|] } ${[| x|] }`
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates2.baseline.jsonc
new file mode 100644
index 0000000000..beb9581ee7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideTemplates2.baseline.jsonc
@@ -0,0 +1,37 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates2.ts ===
+
+// function /*FIND ALL REFS*/[| f|](...rest: any[]) { }[|
+// f|] `${[| f|] } ${[| f|] }`
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates2.ts ===
+
+// function[| f|](...rest: any[]) { }[|
+// /*FIND ALL REFS*/f|] `${[| f|] } ${[| f|] }`
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates2.ts ===
+
+// function[| f|](...rest: any[]) { }[|
+// f `${ /*FIND ALL REFS*/|] `${[| f|] } ${[| f|] }`
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideTemplates2.ts ===
+
+// function[| f|](...rest: any[]) { }[|
+// f `${ f } ${ /*FIND ALL REFS*/|] `${[| f|] } ${[| f|] }`
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideWithBlock.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideWithBlock.baseline.jsonc
new file mode 100644
index 0000000000..3b7884e79e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsInsideWithBlock.baseline.jsonc
@@ -0,0 +1,46 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideWithBlock.ts ===
+
+// var /*FIND ALL REFS*/[| x|] = 0;
+//
+// with ({}) {
+// var y = x; // Reference of x here should not be picked
+// y++; // also reference for y should be ignored
+// }[|
+//
+// x|] =[| x|] + 1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideWithBlock.ts ===
+
+// var[| x|] = 0;
+//
+// with ({}) {
+// var y = x; // Reference of x here should not be picked
+// y++; // also reference for y should be ignored
+// }[|
+//
+// /*FIND ALL REFS*/x|] =[| x|] + 1;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsInsideWithBlock.ts ===
+
+// var[| x|] = 0;
+//
+// with ({}) {
+// var y = x; // Reference of x here should not be picked
+// y++; // also reference for y should be ignored
+// }[|
+//
+// x = /*FIND ALL REFS*/|] =[| x|] + 1;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIsDefinition.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIsDefinition.baseline.jsonc
new file mode 100644
index 0000000000..e76d34113f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsIsDefinition.baseline.jsonc
@@ -0,0 +1,117 @@
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// declare function[| foo|](a: number): number;
+// declare function[| foo|](a: string): string;
+// declare function foo/*FIND ALL REFS*/[| foo|](a: string | number): string | number;
+//
+// function foon(a: number): number;
+// function foon(a: string): string;
+// function foon(a: string | number): string | number {
+// return a
+// }[|
+//
+// foo|]; foon;
+//
+// export const bar = 123;
+// console.log({ bar });
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// declare function foo(a: number): number;
+// declare function foo(a: string): string;
+// declare function foo(a: string | number): string | number;
+//
+// function[| foon|](a: number): number;
+// function[| foon|](a: string): string;
+// function foon/*FIND ALL REFS*/[| foon|](a: string | number): string | number {
+// return a
+// }
+//
+// foo;[| foon|];
+//
+// export const bar = 123;
+// console.log({ bar });
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// --- (line: 9) skipped ---
+//
+// foo; foon;
+//
+// export const bar/*FIND ALL REFS*/[| bar|] = 123;
+// console.log({[| bar|] });
+//
+// interface IFoo {
+// foo(): void;
+// // --- (line: 18) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// --- (line: 12) skipped ---
+// export const bar = 123;
+// console.log({ bar });
+//
+// interface IFoo {[|
+// foo|]/*FIND ALL REFS*/(): void;
+// }
+// class Foo implements IFoo {
+// constructor(n: number)
+// constructor()
+// constructor(n: number?) { }[|
+// foo|](): void { }
+// static init() { return new this() }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// --- (line: 15) skipped ---
+// interface IFoo {
+// foo(): void;
+// }
+// class[| Foo|] implements IFoo {
+// constructor(n: number)
+// constructor()
+// /*FIND ALL REFS*/constructor(n: number?) { }
+// foo(): void { }
+// static init() { return new this() }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsIsDefinition.ts ===
+
+// --- (line: 12) skipped ---
+// export const bar = 123;
+// console.log({ bar });
+//
+// interface IFoo {[|
+// foo|](): void;
+// }
+// class Foo implements IFoo {
+// constructor(n: number)
+// constructor()
+// constructor(n: number?) { }[|
+// foo|]/*FIND ALL REFS*/(): void { }
+// static init() { return new this() }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc
new file mode 100644
index 0000000000..bb32cd209b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag2.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /player.js ===
+
+// import[| Component|] from './component.js';
+//
+// /**
+// * @extends Component/*FIND ALL REFS*/[|Component|]
+// */
+// export class Player extends[| Component|] {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc
new file mode 100644
index 0000000000..19b80b4920
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag3.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /player.js ===
+
+// import {[| Component|] } from './component.js';
+//
+// /**
+// * @extends Component/*FIND ALL REFS*/[|Component|]
+// */
+// export class Player extends[| Component|] {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag4.baseline.jsonc
new file mode 100644
index 0000000000..74303d3b74
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag4.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /player.js ===
+
+// import * as[| C|] from './component.js';
+//
+// /**
+// * @extends C/*FIND ALL REFS*/[|C|].Component
+// */
+// export class Player extends Component {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc
new file mode 100644
index 0000000000..e2d1c9698c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocImportTag5.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// export default function /*FIND ALL REFS*/[| a|]() {}
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_class.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_class.baseline.jsonc
new file mode 100644
index 0000000000..f578bd15a5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_class.baseline.jsonc
@@ -0,0 +1,10 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsJsDocTemplateTag_class.ts ===
+
+// /** @template T */
+// class C*FIND ALL REFS*/[|T|]> {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_function.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_function.baseline.jsonc
new file mode 100644
index 0000000000..07e37b22fc
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTemplateTag_function.baseline.jsonc
@@ -0,0 +1,10 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsJsDocTemplateTag_function.ts ===
+
+// /** @template T */
+// function f*FIND ALL REFS*/[|T|]>() {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTypeDef.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTypeDef.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsDocTypeDef.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment.baseline.jsonc
new file mode 100644
index 0000000000..e2bf8c4f1f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment.baseline.jsonc
@@ -0,0 +1,30 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// import { infer } from "./infer";
+// infer({
+// m() {
+// this.[|x|] = 1;
+// this./*FIND ALL REFS*/[|x|];
+// },
+// });
+
+
+// === /infer.d.ts ===
+
+// export declare function infer(o: { m(): void } & ThisType<{[| x|]: number }>): void;
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// --- (line: 4) skipped ---
+// function infer(o) {}
+// infer({
+// m() {
+// this.[|x|] = 2;
+// this./*FIND ALL REFS*/[|x|];
+// },
+// });
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment2.baseline.jsonc
new file mode 100644
index 0000000000..cecf65049e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsJsThisPropertyAssignment2.baseline.jsonc
@@ -0,0 +1,51 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// import { infer } from "./infer";
+// infer({
+// m: {
+// initData() {
+// this.[|x|] = 1;
+// this./*FIND ALL REFS*/[|x|];
+// },
+// }
+// });
+
+
+// === /infer.d.ts ===
+
+// export declare function infer(o: { m: Record } & ThisType<{[| x|]: number }>): void;
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// import { infer } from "./infer";
+// infer({
+// m: {
+// initData() {
+// this.[|x|] = 1;
+// this.[|x|];
+// },
+// }
+// });
+
+
+// === /b.ts ===
+
+// import { infer } from "./infer";
+// infer({
+// m: {
+// initData() {
+// this.[|x|] = 1;
+// this./*FIND ALL REFS*/[|x|];
+// },
+// }
+// });
+
+
+// === /infer.d.ts ===
+
+// export declare function infer(o: { m: Record } & ThisType<{[| x|]: number }>): void;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType.baseline.jsonc
new file mode 100644
index 0000000000..c41e31f80d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /findAllRefsMappedType.ts ===
+
+// interface T { /*FIND ALL REFS*/[| a|]: number; }
+// type U = { readonly [K in keyof T]?: string };
+// declare const t: T;
+// t.[|a|];
+// declare const u: U;
+// u.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsMappedType.ts ===
+
+// interface T {[| a|]: number; }
+// type U = { readonly [K in keyof T]?: string };
+// declare const t: T;
+// t./*FIND ALL REFS*/[|a|];
+// declare const u: U;
+// u.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsMappedType.ts ===
+
+// interface T {[| a|]: number; }
+// type U = { readonly [K in keyof T]?: string };
+// declare const t: T;
+// t.[|a|];
+// declare const u: U;
+// u./*FIND ALL REFS*/[|a|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType_nonHomomorphic.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType_nonHomomorphic.baseline.jsonc
new file mode 100644
index 0000000000..a424fcaed1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMappedType_nonHomomorphic.baseline.jsonc
@@ -0,0 +1,18 @@
+// === findAllReferences ===
+// === /findAllRefsMappedType_nonHomomorphic.ts ===
+
+// function f(x: { [K in "m"]: number; }) {
+// x./*FIND ALL REFS*/[|m|];
+// x.[|m|]
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsMappedType_nonHomomorphic.ts ===
+
+// function f(x: { [K in "m"]: number; }) {
+// x.[|m|];
+// x./*FIND ALL REFS*/[|m|]
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMissingModulesOverlappingSpecifiers.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMissingModulesOverlappingSpecifiers.baseline.jsonc
new file mode 100644
index 0000000000..59c6f3de0c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsMissingModulesOverlappingSpecifiers.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsMissingModulesOverlappingSpecifiers.ts ===
+
+// // https://github.com/microsoft/TypeScript/issues/5551
+// import { resolve as resolveUrl } from "idontcare";
+// import { resolve/*FIND ALL REFS*/[| resolve|] } from "whatever";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoImportClause.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoImportClause.baseline.jsonc
new file mode 100644
index 0000000000..78c3733121
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoImportClause.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export const /*FIND ALL REFS*/[| x|] = 0;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoSubstitutionTemplateLiteralNoCrash1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoSubstitutionTemplateLiteralNoCrash1.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNoSubstitutionTemplateLiteralNoCrash1.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonModule.baseline.jsonc
new file mode 100644
index 0000000000..71b72ba405
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonModule.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonexistentPropertyNoCrash1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonexistentPropertyNoCrash1.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsNonexistentPropertyNoCrash1.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName01.baseline.jsonc
new file mode 100644
index 0000000000..bad2f9dbb6
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName01.baseline.jsonc
@@ -0,0 +1,29 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName01.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var {[| property1|]: prop1 } = foo;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName01.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var { /*FIND ALL REFS*/[| property1|]: prop1 } = foo;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName02.baseline.jsonc
new file mode 100644
index 0000000000..c825bcd01b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName02.baseline.jsonc
@@ -0,0 +1,29 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName02.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var {[| property1|]: {} } = foo;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName02.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var { /*FIND ALL REFS*/[| property1|]: {} } = foo;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName03.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName03.baseline.jsonc
new file mode 100644
index 0000000000..f32aef1855
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName03.baseline.jsonc
@@ -0,0 +1,24 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName03.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var [ {[| property1|]: prop1 }, {[| property1|], property2 } ] = [foo, foo];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName03.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var foo: I;
+// var [ { property1: prop1 }, { /*FIND ALL REFS*/[| property1|]: prop1 }, {[| property1|], property2 } ] = [foo, foo];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName04.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName04.baseline.jsonc
new file mode 100644
index 0000000000..2454a338e9
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName04.baseline.jsonc
@@ -0,0 +1,66 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName04.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/property1|]: number;
+// property2: string;
+// }
+//
+// function f({[| property1|]: p1 }: I,
+// {[| property1|] }: I,
+// { property1: p2 }) {
+//
+// return property1 + 1;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName04.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// function f({ /*FIND ALL REFS*/[| property1|]: p1 }: I,
+// {[| property1|] }: I,
+// { property1: p2 }) {
+//
+// return property1 + 1;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName04.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// function f({[| property1|]: p1 }: I,
+// { /*FIND ALL REFS*/[| property1|] }: I,
+// { property1: p2 }) {
+//
+// return[| property1|] + 1;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName04.ts ===
+
+// --- (line: 3) skipped ---
+// }
+//
+// function f({ property1: p1 }: I,
+// {[| property1|] }: I,
+// { property1: p2 }) {
+//
+// return /*FIND ALL REFS*/[| property1|] + 1;
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName05.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName05.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName05.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName06.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName06.baseline.jsonc
new file mode 100644
index 0000000000..6809e7c21c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName06.baseline.jsonc
@@ -0,0 +1,97 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName06.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/property1|]: number;
+// property2: string;
+// }
+//
+// var elems: I[];
+// for (let {[| property1|]: p } of elems) {
+// }
+// for (let {[| property1|] } of elems) {
+// }
+// for (var {[| property1|]: p1 } of elems) {
+// }
+// var p2;
+// for ({ property1 : p2 } of elems) {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName06.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var elems: I[];
+// for (let { /*FIND ALL REFS*/[| property1|]: p } of elems) {
+// }
+// for (let {[| property1|] } of elems) {
+// }
+// for (var {[| property1|]: p1 } of elems) {
+// }
+// var p2;
+// for ({ property1 : p2 } of elems) {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName06.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var elems: I[];
+// for (let {[| property1|]: p } of elems) {
+// }
+// for (let {[| property1|] } of elems) {
+// }
+// for (var { /*FIND ALL REFS*/[| property1|]: p1 } of elems) {
+// }
+// var p2;
+// for ({ property1 : p2 } of elems) {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName06.ts ===
+
+// --- (line: 10) skipped ---
+// for (var { property1: p1 } of elems) {
+// }
+// var p2;
+// for ({ /*FIND ALL REFS*/[| property1|] : p2 } of elems) {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName06.ts ===
+
+// interface I {[|
+// property1|]: number;
+// property2: string;
+// }
+//
+// var elems: I[];
+// for (let {[| property1|]: p } of elems) {
+// }
+// for (let { /*FIND ALL REFS*/[| property1|] } of elems) {
+// }
+// for (var {[| property1|]: p1 } of elems) {
+// }
+// var p2;
+// for ({ property1 : p2 } of elems) {
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName07.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName07.baseline.jsonc
new file mode 100644
index 0000000000..cb5f6a27a8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName07.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName07.ts ===
+
+// let p, b;
+//
+// p, [{ /*FIND ALL REFS*/[| a|]: p, b }] = [{ a: 10, b: true }];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName10.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName10.baseline.jsonc
new file mode 100644
index 0000000000..158e57f749
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsObjectBindingElementPropertyName10.baseline.jsonc
@@ -0,0 +1,43 @@
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName10.ts ===
+
+// interface Recursive {[|
+// /*FIND ALL REFS*/next|]?: Recursive;
+// value: any;
+// }
+//
+// function f ({[| next|]: {[| next|]: x} }: Recursive) {
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName10.ts ===
+
+// interface Recursive {[|
+// next|]?: Recursive;
+// value: any;
+// }
+//
+// function f ({ /*FIND ALL REFS*/[| next|]: {[| next|]: x} }: Recursive) {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsObjectBindingElementPropertyName10.ts ===
+
+// interface Recursive {[|
+// next|]?: Recursive;
+// value: any;
+// }
+//
+// function f ({ next: { /*FIND ALL REFS*/[| next|]: {[| next|]: x} }: Recursive) {
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOfConstructor_withModifier.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOfConstructor_withModifier.baseline.jsonc
new file mode 100644
index 0000000000..4f6c32058e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOfConstructor_withModifier.baseline.jsonc
@@ -0,0 +1,7 @@
+// === findAllReferences ===
+// === /findAllRefsOfConstructor_withModifier.ts ===
+
+// class[| X|] {
+// public /*FIND ALL REFS*/constructor() {}
+// }
+// var x = new[| X|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDecorators.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDecorators.baseline.jsonc
new file mode 100644
index 0000000000..c4fa145b22
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDecorators.baseline.jsonc
@@ -0,0 +1,83 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// function /*FIND ALL REFS*/[| decorator|](target) {
+// return target;
+// }[|
+// decorator|]();
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// function[| decorator|](target) {
+// return target;
+// }[|
+// /*FIND ALL REFS*/decorator|]();
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// function[| decorator|](target) {
+// return target;
+// }[|
+// decorator|]();
+
+
+// === /b.ts ===
+
+// @/*FIND ALL REFS*/[|decorator|] @[|decorator|]("again")
+// class C {
+// @[|decorator|]
+// method() {}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// function[| decorator|](target) {
+// return target;
+// }[|
+// decorator|]();
+
+
+// === /b.ts ===
+
+// @decorator @/*FIND ALL REFS*/[|decorator|] @[|decorator|]("again")
+// class C {
+// @[|decorator|]
+// method() {}
+// }
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// function[| decorator|](target) {
+// return target;
+// }[|
+// decorator|]();
+
+
+// === /b.ts ===
+
+// @[|decorator|] @[|decorator|]("again")
+// class C {
+// @/*FIND ALL REFS*/[|decorator|]
+// method() {}
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition.baseline.jsonc
new file mode 100644
index 0000000000..bd933687c5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition.baseline.jsonc
@@ -0,0 +1,42 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnDefinition-import.ts ===
+
+// --- (line: 3) skipped ---
+//
+// }
+//
+// public /*FIND ALL REFS*/[| start|](){
+// return this;
+// }
+//
+// // --- (line: 11) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnDefinition-import.ts ===
+
+// --- (line: 3) skipped ---
+//
+// }
+//
+// public[| start|](){
+// return this;
+// }
+//
+// // --- (line: 11) skipped ---
+
+
+// === /findAllRefsOnDefinition.ts ===
+
+// import Second = require("./findAllRefsOnDefinition-import");
+//
+// var second = new Second.Test()
+// second./*FIND ALL REFS*/[|start|]();
+// second.stop();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition2.baseline.jsonc
new file mode 100644
index 0000000000..4286f5bf41
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnDefinition2.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnDefinition2-import.ts ===
+
+// export module Test{
+//
+// export interface /*FIND ALL REFS*/[| start|] { }
+//
+// export interface stop { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnDefinition2-import.ts ===
+
+// export module Test{
+//
+// export interface[| start|] { }
+//
+// export interface stop { }
+// }
+
+
+// === /findAllRefsOnDefinition2.ts ===
+
+// import Second = require("./findAllRefsOnDefinition2-import");
+//
+// var start: Second.Test./*FIND ALL REFS*/[|start|];
+// var stop: Second.Test.stop;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnImportAliases.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnImportAliases.baseline.jsonc
new file mode 100644
index 0000000000..84c9a02501
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnImportAliases.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// export class /*FIND ALL REFS*/[| Class|] {
+// }
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import { /*FIND ALL REFS*/[| Class|] } from "./a";
+//
+// var c = new[| Class|]();
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import {[| Class|] } from "./a";
+//
+// var c = new /*FIND ALL REFS*/[| Class|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnPrivateParameterProperty1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnPrivateParameterProperty1.baseline.jsonc
new file mode 100644
index 0000000000..f4e6079687
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsOnPrivateParameterProperty1.baseline.jsonc
@@ -0,0 +1,31 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnPrivateParameterProperty1.ts ===
+
+// class ABCD {
+// constructor(private x: number, public y: number, private /*FIND ALL REFS*/[| z|]: number) {
+// }
+//
+// func() {
+// return this.[|z|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsOnPrivateParameterProperty1.ts ===
+
+// class ABCD {
+// constructor(private x: number, public y: number, private[| z|]: number) {
+// }
+//
+// func() {
+// return this./*FIND ALL REFS*/[|z|];
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration1.baseline.jsonc
new file mode 100644
index 0000000000..476cefe28d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration1.baseline.jsonc
@@ -0,0 +1,9 @@
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration1.ts ===
+
+// class Foo {
+// constructor(private /*FIND ALL REFS*/[| privateParam|]: number) {
+// let localPrivate =[| privateParam|];
+// this.[|privateParam|] += 10;
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration2.baseline.jsonc
new file mode 100644
index 0000000000..312781db6b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration2.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration2.ts ===
+
+// class Foo {
+// constructor(public /*FIND ALL REFS*/[| publicParam|]: number) {
+// let localPublic =[| publicParam|];
+// this.[|publicParam|] += 10;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration2.ts ===
+
+// class Foo {
+// constructor(public[| publicParam|]: number) {
+// let localPublic = /*FIND ALL REFS*/[| publicParam|];
+// this.[|publicParam|] += 10;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration2.ts ===
+
+// class Foo {
+// constructor(public[| publicParam|]: number) {
+// let localPublic =[| publicParam|];
+// this./*FIND ALL REFS*/[|publicParam|] += 10;
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration3.baseline.jsonc
new file mode 100644
index 0000000000..51d582769c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration3.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration3.ts ===
+
+// class Foo {
+// constructor(protected /*FIND ALL REFS*/[| protectedParam|]: number) {
+// let localProtected =[| protectedParam|];
+// this.[|protectedParam|] += 10;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration3.ts ===
+
+// class Foo {
+// constructor(protected[| protectedParam|]: number) {
+// let localProtected = /*FIND ALL REFS*/[| protectedParam|];
+// this.[|protectedParam|] += 10;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration3.ts ===
+
+// class Foo {
+// constructor(protected[| protectedParam|]: number) {
+// let localProtected =[| protectedParam|];
+// this./*FIND ALL REFS*/[|protectedParam|] += 10;
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration_inheritance.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration_inheritance.baseline.jsonc
new file mode 100644
index 0000000000..ab757cf2f5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsParameterPropertyDeclaration_inheritance.baseline.jsonc
@@ -0,0 +1,61 @@
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration_inheritance.ts ===
+
+// class C {
+// constructor(public /*FIND ALL REFS*/[| x|]: string) {[|
+// x|];
+// }
+// }
+// class D extends C {
+// constructor(public[| x|]: string) {
+// super([|x|]);
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration_inheritance.ts ===
+
+// class C {
+// constructor(public[| x|]: string) {[|
+// /*FIND ALL REFS*/x|];
+// }
+// }
+// class D extends C {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration_inheritance.ts ===
+
+// class C {
+// constructor(public[| x|]: string) {[|
+// x|];
+// }
+// }
+// class D extends C {
+// constructor(public /*FIND ALL REFS*/[| x|]: string) {
+// super([|x|]);
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsParameterPropertyDeclaration_inheritance.ts ===
+
+// class C {
+// constructor(public[| x|]: string) {[|
+// x|];
+// }
+// }
+// class D extends C {
+// constructor(public[| x|]: string) {
+// super(/*FIND ALL REFS*/[|x|]);
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrimitiveJsDoc.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrimitiveJsDoc.baseline.jsonc
new file mode 100644
index 0000000000..ae7e2fe2e4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrimitiveJsDoc.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /findAllRefsPrimitiveJsDoc.ts ===
+
+// /**
+// * @param {/*FIND ALL REFS*/[|number|]} n
+// * @returns {[|number|]}
+// */
+// function f(n:[| number|]):[| number|] {}
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrimitiveJsDoc.ts ===
+
+// /**
+// * @param {[|number|]} n
+// * @returns {/*FIND ALL REFS*/[|number|]}
+// */
+// function f(n:[| number|]):[| number|] {}
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrimitiveJsDoc.ts ===
+
+// /**
+// * @param {[|number|]} n
+// * @returns {[|number|]}
+// */
+// function f(n: /*FIND ALL REFS*/[| number|]):[| number|] {}
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrimitiveJsDoc.ts ===
+
+// /**
+// * @param {[|number|]} n
+// * @returns {[|number|]}
+// */
+// function f(n: number): /*FIND ALL REFS*/[| number|]):[| number|] {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameAccessors.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameAccessors.baseline.jsonc
new file mode 100644
index 0000000000..45510f41ea
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameAccessors.baseline.jsonc
@@ -0,0 +1,115 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// class C {
+// get /*FIND ALL REFS*/[| #foo|](){ return 1; }
+// set[| #foo|](value: number){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// class C {
+// get[| #foo|](){ return 1; }
+// set /*FIND ALL REFS*/[| #foo|](value: number){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// class C {
+// get[| #foo|](){ return 1; }
+// set[| #foo|](value: number){ }
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|]();
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// --- (line: 11) skipped ---
+// }
+// }
+// class E {
+// get /*FIND ALL REFS*/[| #foo|](){ return 1; }
+// set[| #foo|](value: number){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// --- (line: 11) skipped ---
+// }
+// }
+// class E {
+// get[| #foo|](){ return 1; }
+// set /*FIND ALL REFS*/[| #foo|](value: number){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameAccessors.ts ===
+
+// --- (line: 11) skipped ---
+// }
+// }
+// class E {
+// get[| #foo|](){ return 1; }
+// set[| #foo|](value: number){ }
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|]();
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameMethods.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameMethods.baseline.jsonc
new file mode 100644
index 0000000000..843e873d7d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameMethods.baseline.jsonc
@@ -0,0 +1,60 @@
+// === findAllReferences ===
+// === /findAllRefsPrivateNameMethods.ts ===
+
+// class C {[|
+// /*FIND ALL REFS*/#foo|](){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+// class D extends C {
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameMethods.ts ===
+
+// class C {[|
+// #foo|](){ }
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|]();
+// }
+// }
+// class D extends C {
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameMethods.ts ===
+
+// --- (line: 9) skipped ---
+// this.#foo = 20;
+// }
+// }
+// class E {[|
+// /*FIND ALL REFS*/#foo|](){ }
+// constructor() {
+// this.[|#foo|]();
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameMethods.ts ===
+
+// --- (line: 9) skipped ---
+// this.#foo = 20;
+// }
+// }
+// class E {[|
+// #foo|](){ }
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|]();
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameProperties.baseline.jsonc
new file mode 100644
index 0000000000..67b7fbec40
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPrivateNameProperties.baseline.jsonc
@@ -0,0 +1,78 @@
+// === findAllReferences ===
+// === /findAllRefsPrivateNameProperties.ts ===
+
+// class C {[|
+// /*FIND ALL REFS*/#foo|] = 10;
+// constructor() {
+// this.[|#foo|] = 20;[|
+// #foo|] in this;
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameProperties.ts ===
+
+// class C {[|
+// #foo|] = 10;
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|] = 20;[|
+// #foo|] in this;
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameProperties.ts ===
+
+// class C {[|
+// #foo|] = 10;
+// constructor() {
+// this.[|#foo|] = 20;[|
+// /*FIND ALL REFS*/#foo|] in this;
+// }
+// }
+// class D extends C {
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameProperties.ts ===
+
+// --- (line: 10) skipped ---
+// this.#foo = 20;
+// }
+// }
+// class E {[|
+// /*FIND ALL REFS*/#foo|]: number;
+// constructor() {
+// this.[|#foo|] = 20;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsPrivateNameProperties.ts ===
+
+// --- (line: 10) skipped ---
+// this.#foo = 20;
+// }
+// }
+// class E {[|
+// #foo|]: number;
+// constructor() {
+// this./*FIND ALL REFS*/[|#foo|] = 20;
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPropertyContextuallyTypedByTypeParam01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPropertyContextuallyTypedByTypeParam01.baseline.jsonc
new file mode 100644
index 0000000000..787cd4eabe
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsPropertyContextuallyTypedByTypeParam01.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /findAllRefsPropertyContextuallyTypedByTypeParam01.ts ===
+
+// interface IFoo {[|
+// /*FIND ALL REFS*/a|]: string;
+// }
+// class C {
+// method() {
+// var x: T = {
+// a: ""
+// };
+// x.[|a|];
+// }
+// }
+//
+// // --- (line: 13) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsReExport_broken2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsReExport_broken2.baseline.jsonc
new file mode 100644
index 0000000000..7130888416
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsReExport_broken2.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRedeclaredPropertyInDerivedInterface.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRedeclaredPropertyInDerivedInterface.baseline.jsonc
new file mode 100644
index 0000000000..c24cda7263
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRedeclaredPropertyInDerivedInterface.baseline.jsonc
@@ -0,0 +1,51 @@
+// === findAllReferences ===
+// === /findAllRefsRedeclaredPropertyInDerivedInterface.ts ===
+
+// interface A {
+// readonly /*FIND ALL REFS*/[| x|]: number | string;
+// }
+// interface B extends A {
+// readonly[| x|]: number;
+// }
+// const a: A = { x: 0 };
+// const b: B = { x: 0 };
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRedeclaredPropertyInDerivedInterface.ts ===
+
+// interface A {
+// readonly[| x|]: number | string;
+// }
+// interface B extends A {
+// readonly /*FIND ALL REFS*/[| x|]: number;
+// }
+// const a: A = { x: 0 };
+// const b: B = { x: 0 };
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRedeclaredPropertyInDerivedInterface.ts ===
+
+// --- (line: 3) skipped ---
+// interface B extends A {
+// readonly x: number;
+// }
+// const a: A = { /*FIND ALL REFS*/[| x|]: 0 };
+// const b: B = { x: 0 };
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRedeclaredPropertyInDerivedInterface.ts ===
+
+// --- (line: 4) skipped ---
+// readonly x: number;
+// }
+// const a: A = { x: 0 };
+// const b: B = { /*FIND ALL REFS*/[| x|]: 0 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRootSymbols.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRootSymbols.baseline.jsonc
new file mode 100644
index 0000000000..7a141f8dd2
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsRootSymbols.baseline.jsonc
@@ -0,0 +1,40 @@
+// === findAllReferences ===
+// === /findAllRefsRootSymbols.ts ===
+
+// interface I { /*FIND ALL REFS*/[| x|]: {}; }
+// interface J { x: {}; }
+// declare const o: (I | J) & { x: string };
+// o.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRootSymbols.ts ===
+
+// interface I { x: {}; }
+// interface J { /*FIND ALL REFS*/[| x|]: {}; }
+// declare const o: (I | J) & { x: string };
+// o.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRootSymbols.ts ===
+
+// interface I { x: {}; }
+// interface J { x: {}; }
+// declare const o: (I | J) & { /*FIND ALL REFS*/[| x|]: string };
+// o.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsRootSymbols.ts ===
+
+// interface I {[| x|]: {}; }
+// interface J {[| x|]: {}; }
+// declare const o: (I | J) & {[| x|]: string };
+// o./*FIND ALL REFS*/[|x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeyword.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeyword.baseline.jsonc
new file mode 100644
index 0000000000..9f3540c87c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeyword.baseline.jsonc
@@ -0,0 +1,174 @@
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// /*FIND ALL REFS*/[|this|];
+// function f(this) {
+// return this;
+// function g(this) { return this; }
+// // --- (line: 5) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// this;
+// function f(/*FIND ALL REFS*/[|this|]) {
+// return[| this|];
+// function g(this) { return this; }
+// }
+// class C {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// this;
+// function f([|this|]) {
+// return /*FIND ALL REFS*/[| this|];
+// function g(this) { return this; }
+// }
+// class C {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// this;
+// function f(this) {
+// return this;
+// function g(/*FIND ALL REFS*/[|this|]) { return[| this|]; }
+// }
+// class C {
+// static x() {
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// this;
+// function f(this) {
+// return this;
+// function g(this) { return /*FIND ALL REFS*/[|this|]) { return[| this|]; }
+// }
+// class C {
+// static x() {
+// // --- (line: 8) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 3) skipped ---
+// function g(this) { return this; }
+// }
+// class C {
+// static x() {[|
+// /*FIND ALL REFS*/this|];
+// }
+// static y() {
+// () =>[| this|];
+// }
+// constructor() {
+// this;
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 3) skipped ---
+// function g(this) { return this; }
+// }
+// class C {
+// static x() {[|
+// this|];
+// }
+// static y() {
+// () => /*FIND ALL REFS*/[| this|];
+// }
+// constructor() {
+// this;
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 9) skipped ---
+// static y() {
+// () => this;
+// }
+// constructor() {[|
+// /*FIND ALL REFS*/this|];
+// }
+// method() {
+// () =>[| this|];
+// }
+// }
+// // These are *not* real uses of the 'this' keyword, they are identifiers.
+// const x = { this: 0 }
+// x.this;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 9) skipped ---
+// static y() {
+// () => this;
+// }
+// constructor() {[|
+// this|];
+// }
+// method() {
+// () => /*FIND ALL REFS*/[| this|];
+// }
+// }
+// // These are *not* real uses of the 'this' keyword, they are identifiers.
+// const x = { this: 0 }
+// x.this;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 17) skipped ---
+// }
+// }
+// // These are *not* real uses of the 'this' keyword, they are identifiers.
+// const x = { /*FIND ALL REFS*/[| this|]: 0 }
+// x.[|this|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsThisKeyword.ts ===
+
+// --- (line: 17) skipped ---
+// }
+// }
+// // These are *not* real uses of the 'this' keyword, they are identifiers.
+// const x = {[| this|]: 0 }
+// x./*FIND ALL REFS*/[|this|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeywordMultipleFiles.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeywordMultipleFiles.baseline.jsonc
new file mode 100644
index 0000000000..a335a75f45
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsThisKeywordMultipleFiles.baseline.jsonc
@@ -0,0 +1,70 @@
+// === findAllReferences ===
+// === /file1.ts ===
+
+// /*FIND ALL REFS*/[|this|];[| this|];
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// this; /*FIND ALL REFS*/[|this|];[| this|];
+
+
+
+
+// === findAllReferences ===
+// === /file2.ts ===
+
+// /*FIND ALL REFS*/[|this|];[|
+// this|];
+
+
+
+
+// === findAllReferences ===
+// === /file2.ts ===
+
+// [|this|];[|
+// /*FIND ALL REFS*/this|];
+
+
+
+
+// === findAllReferences ===
+// === /file3.ts ===
+
+// ((x = /*FIND ALL REFS*/[| this|], y) =>[| this|])([|this|],[| this|]);
+// // different 'this'
+// function f(this) { return this; }
+
+
+
+
+// === findAllReferences ===
+// === /file3.ts ===
+
+// ((x = this, y) => /*FIND ALL REFS*/[| this|], y) =>[| this|])([|this|],[| this|]);
+// // different 'this'
+// function f(this) { return this; }
+
+
+
+
+// === findAllReferences ===
+// === /file3.ts ===
+
+// ((x = this, y) => this)(/*FIND ALL REFS*/[| this|], y) =>[| this|])([|this|],[| this|]);
+// // different 'this'
+// function f(this) { return this; }
+
+
+
+
+// === findAllReferences ===
+// === /file3.ts ===
+
+// ((x = this, y) => this)(this, /*FIND ALL REFS*/[| this|], y) =>[| this|])([|this|],[| this|]);
+// // different 'this'
+// function f(this) { return this; }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeParameterInMergedInterface.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeParameterInMergedInterface.baseline.jsonc
new file mode 100644
index 0000000000..5d6fadbeae
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeParameterInMergedInterface.baseline.jsonc
@@ -0,0 +1,32 @@
+// === findAllReferences ===
+// === /findAllRefsTypeParameterInMergedInterface.ts ===
+
+// interface I*FIND ALL REFS*/[|T|]> { a:[| T|] }
+// interface I<[|T|]> { b:[| T|] }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsTypeParameterInMergedInterface.ts ===
+
+// interface I { a: /*FIND ALL REFS*/[|T|]> { a:[| T|] }
+// interface I<[|T|]> { b:[| T|] }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsTypeParameterInMergedInterface.ts ===
+
+// interface I<[|T|]> { a:[| T|] }
+// interface I*FIND ALL REFS*/[|T|]> { b:[| T|] }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsTypeParameterInMergedInterface.ts ===
+
+// interface I<[|T|]> { a:[| T|] }
+// interface I { b: /*FIND ALL REFS*/[|T|]> { b:[| T|] }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc
new file mode 100644
index 0000000000..19ad0586a1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef.baseline.jsonc
@@ -0,0 +1,31 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /**
+// * @typedef I {Object}
+// * @prop /*FIND ALL REFS*/[|p|] {number}
+// */
+//
+// /** @type {I} */
+// let x;
+// x.[|p|];
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /**
+// * @typedef I {Object}
+// * @prop [|p|] {number}
+// */
+//
+// /** @type {I} */
+// let x;
+// x./*FIND ALL REFS*/[|p|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc
new file mode 100644
index 0000000000..6b69058655
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypedef_importType.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// module.exports = 0;
+// /** @typedef {number} /*FIND ALL REFS*/[|Foo|] */
+// const dummy = 0;
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeofImport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeofImport.baseline.jsonc
new file mode 100644
index 0000000000..d7d717b9c1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsTypeofImport.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export const /*FIND ALL REFS*/[| x|] = 0;
+// declare const a: typeof import("./a");
+// a.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export const[| x|] = 0;
+// declare const a: typeof import("./a");
+// a./*FIND ALL REFS*/[|x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnionProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnionProperty.baseline.jsonc
new file mode 100644
index 0000000000..3bb0f678ab
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnionProperty.baseline.jsonc
@@ -0,0 +1,157 @@
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | { /*FIND ALL REFS*/[| type|]: "a", prop: number }
+// | {[| type|]: "b", prop: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// if (t.[|type|] === "a") {
+// t.[|type|];
+// } else {
+// t.[|type|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | {[| type|]: "a", prop: number }
+// | { /*FIND ALL REFS*/[| type|]: "b", prop: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// if (t.[|type|] === "a") {
+// t.[|type|];
+// } else {
+// t.[|type|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | {[| type|]: "a", prop: number }
+// | {[| type|]: "b", prop: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// if (t./*FIND ALL REFS*/[|type|] === "a") {
+// t.[|type|];
+// } else {
+// t.[|type|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | {[| type|]: "a", prop: number }
+// | {[| type|]: "b", prop: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// if (t.[|type|] === "a") {
+// t./*FIND ALL REFS*/[|type|];
+// } else {
+// t.[|type|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | {[| type|]: "a", prop: number }
+// | {[| type|]: "b", prop: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// if (t.[|type|] === "a") {
+// t.[|type|];
+// } else {
+// t./*FIND ALL REFS*/[|type|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | { type: "a", prop: number }
+// | { type: "b", prop: string };
+// const tt: T = {[|
+// /*FIND ALL REFS*/type|]: "a",
+// prop: 0,
+// };
+// declare const t: T;
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | { type: "a", /*FIND ALL REFS*/[| prop|]: number }
+// | { type: "b",[| prop|]: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | { type: "a",[| prop|]: number }
+// | { type: "b", /*FIND ALL REFS*/[| prop|]: string };
+// const tt: T = {
+// type: "a",
+// prop: 0,
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnionProperty.ts ===
+
+// type T =
+// | { type: "a", prop: number }
+// | { type: "b", prop: string };
+// const tt: T = {
+// type: "a",[|
+// /*FIND ALL REFS*/prop|]: 0,
+// };
+// declare const t: T;
+// if (t.type === "a") {
+// // --- (line: 10) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols1.baseline.jsonc
new file mode 100644
index 0000000000..1afdfca3d5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols1.baseline.jsonc
@@ -0,0 +1,126 @@
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: /*FIND ALL REFS*/[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a:[| Bar|];
+// let b: /*FIND ALL REFS*/[| Bar|];
+// let c:[| Bar|];
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c: /*FIND ALL REFS*/[| Bar|];
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: /*FIND ALL REFS*/[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d:[| Bar|].X;
+// let e: /*FIND ALL REFS*/[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f: /*FIND ALL REFS*/[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar./*FIND ALL REFS*/[|X|];
+// let e: Bar.[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar.[|X|];
+// let e: Bar./*FIND ALL REFS*/[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar./*FIND ALL REFS*/[|X|].Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols1.ts ===
+
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X./*FIND ALL REFS*/[|Y|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols2.baseline.jsonc
new file mode 100644
index 0000000000..e96b642ecd
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols2.baseline.jsonc
@@ -0,0 +1,155 @@
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import { /*FIND ALL REFS*/[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a: /*FIND ALL REFS*/[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b: /*FIND ALL REFS*/[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c: /*FIND ALL REFS*/[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d: /*FIND ALL REFS*/[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e: /*FIND ALL REFS*/[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import {[| Bar|] } from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f: /*FIND ALL REFS*/[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import { Bar } from "does-not-exist";
+//
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar./*FIND ALL REFS*/[|X|];
+// let e: Bar.[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// import { Bar } from "does-not-exist";
+//
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar.[|X|];
+// let e: Bar./*FIND ALL REFS*/[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// --- (line: 4) skipped ---
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar./*FIND ALL REFS*/[|X|].Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols2.ts ===
+
+// --- (line: 4) skipped ---
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X./*FIND ALL REFS*/[|Y|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols3.baseline.jsonc
new file mode 100644
index 0000000000..8b880336ae
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsUnresolvedSymbols3.baseline.jsonc
@@ -0,0 +1,155 @@
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as /*FIND ALL REFS*/[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a: /*FIND ALL REFS*/[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b: /*FIND ALL REFS*/[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c: /*FIND ALL REFS*/[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d: /*FIND ALL REFS*/[| Bar|].X;
+// let e:[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e: /*FIND ALL REFS*/[| Bar|].X;
+// let f:[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as[| Bar|] from "does-not-exist";
+//
+// let a:[| Bar|];
+// let b:[| Bar|];
+// let c:[| Bar|];
+// let d:[| Bar|].X;
+// let e:[| Bar|].X;
+// let f: /*FIND ALL REFS*/[| Bar|].X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as Bar from "does-not-exist";
+//
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar./*FIND ALL REFS*/[|X|];
+// let e: Bar.[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// import * as Bar from "does-not-exist";
+//
+// let a: Bar;
+// let b: Bar;
+// let c: Bar;
+// let d: Bar.[|X|];
+// let e: Bar./*FIND ALL REFS*/[|X|];
+// let f: Bar.X.Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// --- (line: 4) skipped ---
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar./*FIND ALL REFS*/[|X|].Y;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsUnresolvedSymbols3.ts ===
+
+// --- (line: 4) skipped ---
+// let c: Bar;
+// let d: Bar.X;
+// let e: Bar.X;
+// let f: Bar.X./*FIND ALL REFS*/[|Y|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames1.baseline.jsonc
new file mode 100644
index 0000000000..9f6a1c1d3b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames1.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames1.ts ===
+
+// class Foo {
+// public /*FIND ALL REFS*/[| _bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|_bar|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames1.ts ===
+
+// class Foo {
+// public[| _bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x./*FIND ALL REFS*/[|_bar|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames2.baseline.jsonc
new file mode 100644
index 0000000000..66d1596dc7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames2.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames2.ts ===
+
+// class Foo {
+// public /*FIND ALL REFS*/[| __bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|__bar|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames2.ts ===
+
+// class Foo {
+// public[| __bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x./*FIND ALL REFS*/[|__bar|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames3.baseline.jsonc
new file mode 100644
index 0000000000..701021dc17
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames3.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames3.ts ===
+
+// class Foo {
+// public /*FIND ALL REFS*/[| ___bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|___bar|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames3.ts ===
+
+// class Foo {
+// public[| ___bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x./*FIND ALL REFS*/[|___bar|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames4.baseline.jsonc
new file mode 100644
index 0000000000..550f992c2e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames4.baseline.jsonc
@@ -0,0 +1,27 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames4.ts ===
+
+// class Foo {
+// public /*FIND ALL REFS*/[| ____bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|____bar|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames4.ts ===
+
+// class Foo {
+// public[| ____bar|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x./*FIND ALL REFS*/[|____bar|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames5.baseline.jsonc
new file mode 100644
index 0000000000..c4fcea8d1b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames5.baseline.jsonc
@@ -0,0 +1,39 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames5.ts ===
+
+// class Foo {
+// public _bar;
+// public __bar;
+// public /*FIND ALL REFS*/[| ___bar|];
+// public ____bar;
+// }
+//
+// var x: Foo;
+// x._bar;
+// x.__bar;
+// x.[|___bar|];
+// x.____bar;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames5.ts ===
+
+// class Foo {
+// public _bar;
+// public __bar;
+// public[| ___bar|];
+// public ____bar;
+// }
+//
+// var x: Foo;
+// x._bar;
+// x.__bar;
+// x./*FIND ALL REFS*/[|___bar|];
+// x.____bar;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames6.baseline.jsonc
new file mode 100644
index 0000000000..ff399f4b6d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames6.baseline.jsonc
@@ -0,0 +1,39 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames6.ts ===
+
+// class Foo {
+// public _bar;
+// public /*FIND ALL REFS*/[| __bar|];
+// public ___bar;
+// public ____bar;
+// }
+//
+// var x: Foo;
+// x._bar;
+// x.[|__bar|];
+// x.___bar;
+// x.____bar;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames6.ts ===
+
+// class Foo {
+// public _bar;
+// public[| __bar|];
+// public ___bar;
+// public ____bar;
+// }
+//
+// var x: Foo;
+// x._bar;
+// x./*FIND ALL REFS*/[|__bar|];
+// x.___bar;
+// x.____bar;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames7.baseline.jsonc
new file mode 100644
index 0000000000..2095da2415
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames7.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames7.ts ===
+
+// function /*FIND ALL REFS*/[| __foo|]() {[|
+// __foo|]();
+// }
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames7.ts ===
+
+// function[| __foo|]() {[|
+// /*FIND ALL REFS*/__foo|]();
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames8.baseline.jsonc
new file mode 100644
index 0000000000..67c7f54750
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames8.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames8.ts ===
+
+// (function /*FIND ALL REFS*/__foo() {[|
+// __foo|]();
+// })
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames8.ts ===
+
+// (function __foo() {[|
+// /*FIND ALL REFS*/__foo|]();
+// })
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames9.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames9.baseline.jsonc
new file mode 100644
index 0000000000..a243689a69
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithLeadingUnderscoreNames9.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames9.ts ===
+
+// (function /*FIND ALL REFS*/___foo() {[|
+// ___foo|]();
+// })
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithLeadingUnderscoreNames9.ts ===
+
+// (function ___foo() {[|
+// /*FIND ALL REFS*/___foo|]();
+// })
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment.baseline.jsonc
new file mode 100644
index 0000000000..3ee61fda6e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment.ts ===
+
+// var /*FIND ALL REFS*/[| name|] = "Foo";
+//
+// var obj = { name };
+// var obj1 = { name: name };
+// obj.name;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment.ts ===
+
+// var name = "Foo";
+//
+// var obj = {[| name|] };
+// var obj1 = { name: /*FIND ALL REFS*/[| name|] };
+// obj.name;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment.ts ===
+
+// var name = "Foo";
+//
+// var obj = { /*FIND ALL REFS*/[| name|] };
+// var obj1 = { name: name };
+// obj.[|name|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment.ts ===
+
+// var name = "Foo";
+//
+// var obj = { name };
+// var obj1 = { /*FIND ALL REFS*/[| name|]: name };
+// obj.name;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment.ts ===
+
+// var name = "Foo";
+//
+// var obj = {[| name|] };
+// var obj1 = { name: name };
+// obj./*FIND ALL REFS*/[|name|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment2.baseline.jsonc
new file mode 100644
index 0000000000..f724e0175f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWithShorthandPropertyAssignment2.baseline.jsonc
@@ -0,0 +1,53 @@
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment2.ts ===
+
+// var /*FIND ALL REFS*/[| dx|] = "Foo";
+//
+// module M { export var dx; }
+// module M {
+// // --- (line: 5) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment2.ts ===
+
+// var dx = "Foo";
+//
+// module M { export var /*FIND ALL REFS*/[| dx|]; }
+// module M {
+// var z = 100;
+// export var y = {[| dx|], z };
+// }
+// M.y.dx;
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment2.ts ===
+
+// var dx = "Foo";
+//
+// module M { export var dx; }
+// module M {
+// var z = 100;
+// export var y = { /*FIND ALL REFS*/[| dx|], z };
+// }
+// M.y.[|dx|];
+
+
+
+
+// === findAllReferences ===
+// === /findAllRefsWithShorthandPropertyAssignment2.ts ===
+
+// var dx = "Foo";
+//
+// module M { export var dx; }
+// module M {
+// var z = 100;
+// export var y = {[| dx|], z };
+// }
+// M.y./*FIND ALL REFS*/[|dx|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWriteAccess.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWriteAccess.baseline.jsonc
new file mode 100644
index 0000000000..1fb06ce607
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefsWriteAccess.baseline.jsonc
@@ -0,0 +1,20 @@
+// === findAllReferences ===
+// === /findAllRefsWriteAccess.ts ===
+
+// interface Obj {
+// [`/*FIND ALL REFS*/[|`num`|]]: number;
+// }
+//
+// let o: Obj = {
+// // --- (line: 6) skipped ---
+
+
+// --- (line: 9) skipped ---
+// ['num']: 1
+// };
+//
+// o[[|'num'|]] = 2;
+// o[[|`num`|]] = 3;
+//
+// o[[|'num'|]];
+// o[[|`num`|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_js4.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_meaningAtLocation.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_meaningAtLocation.baseline.jsonc
new file mode 100644
index 0000000000..17e19341d7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_meaningAtLocation.baseline.jsonc
@@ -0,0 +1,42 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type /*FIND ALL REFS*/[| T|] = 0;
+// export const T = 0;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type T = 0;
+// export const /*FIND ALL REFS*/[| T|] = 0;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type[| T|] = 0;
+// export const T = 0;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type T = 0;
+// export const[| T|] = 0;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_named.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_named.baseline.jsonc
new file mode 100644
index 0000000000..b8d3e9f825
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_importType_named.baseline.jsonc
@@ -0,0 +1,42 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type /*FIND ALL REFS*/[| T|] = number;
+// export type U = string;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type T = number;
+// export type /*FIND ALL REFS*/[| U|] = string;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type[| T|] = number;
+// export type U = string;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// export type T = number;
+// export type[| U|] = string;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_jsEnum.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_jsEnum.baseline.jsonc
new file mode 100644
index 0000000000..3b70aa90f3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindAllRefs_jsEnum.baseline.jsonc
@@ -0,0 +1,42 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @enum {string} */
+// const /*FIND ALL REFS*/[| E|] = { A: "" };[|
+// E|]["A"];
+// /** @type {E} */
+// const e =[| E|].A;
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @enum {string} */
+// const[| E|] = { A: "" };[|
+// /*FIND ALL REFS*/E|]["A"];
+// /** @type {E} */
+// const e =[| E|].A;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @enum {string} */
+// const[| E|] = { A: "" };[|
+// E|]["A"];
+// /** @type {E} */
+// const e = /*FIND ALL REFS*/[| E|].A;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAcrossMultipleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAcrossMultipleProjects.baseline.jsonc
new file mode 100644
index 0000000000..26566f4605
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesAcrossMultipleProjects.baseline.jsonc
@@ -0,0 +1,43 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// var /*FIND ALL REFS*/[| x|]: number;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// var[| x|]: number;
+
+
+// === /b.ts ===
+
+// [|///
+// /*FIND ALL REFS*/x|]++;
+
+
+
+
+// === findAllReferences ===
+// === /a.ts ===
+
+// var[| x|]: number;
+
+
+// === /b.ts ===
+
+// [|///
+// x|]++;
+
+
+// === /c.ts ===
+
+// [|///
+// /*FIND ALL REFS*/x|]++;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash1.baseline.jsonc
new file mode 100644
index 0000000000..33160e5645
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash1.baseline.jsonc
@@ -0,0 +1,5 @@
+// === findAllReferences ===
+// === /src/index.ts ===
+
+// import { useQuery } from "use-query";
+// const { /*FIND ALL REFS*/[| data|] } = useQuery();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash2.baseline.jsonc
new file mode 100644
index 0000000000..33160e5645
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesBindingPatternInJsdocNoCrash2.baseline.jsonc
@@ -0,0 +1,5 @@
+// === findAllReferences ===
+// === /src/index.ts ===
+
+// import { useQuery } from "use-query";
+// const { /*FIND ALL REFS*/[| data|] } = useQuery();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesDefinitionDisplayParts.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesDefinitionDisplayParts.baseline.jsonc
new file mode 100644
index 0000000000..31394e7c02
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesDefinitionDisplayParts.baseline.jsonc
@@ -0,0 +1,42 @@
+// === findAllReferences ===
+// === /findReferencesDefinitionDisplayParts.ts ===
+
+// class Gre/*FIND ALL REFS*/[| Greeter|] {
+// someFunction() { this; }
+// }
+//
+// // --- (line: 5) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /findReferencesDefinitionDisplayParts.ts ===
+
+// class Greeter {
+// someFunction() { th/*FIND ALL REFS*/[| this|]; }
+// }
+//
+// type Options = "option 1" | "option 2";
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /findReferencesDefinitionDisplayParts.ts ===
+
+// class Greeter {
+// someFunction() { this; }
+// }
+//
+// type Options = "option 1" | "option 2";
+// let myOption: Options = "option 1";[|
+//
+// some/*FIND ALL REFS*/Label|]:
+// break[| someLabel|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName.baseline.jsonc
new file mode 100644
index 0000000000..6ddc7cac58
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName.baseline.jsonc
@@ -0,0 +1,17 @@
+// === findAllReferences ===
+// === /index.tsx ===
+
+// import { /*FIND ALL REFS*/[| SubmissionComp|] } from "./RedditSubmission"
+// function displaySubreddit(subreddit: string) {
+// let components = submissions
+// .map((value, index) => <[|SubmissionComp|] key={ index } elementPosition= { index } {...value.data} />);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /RedditSubmission.ts ===
+
+// export const /*FIND ALL REFS*/[| SubmissionComp|] = (submission: SubmissionProps) =>
+// ;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName2.baseline.jsonc
new file mode 100644
index 0000000000..f0599f3d0a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesJSXTagName2.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /index.tsx ===
+
+// const /*FIND ALL REFS*/[| obj|] = {Component: () => };
+// const element = <[|obj|].Component/>;
+
+
+
+
+// === findAllReferences ===
+// === /index.tsx ===
+
+// const[| obj|] = {Component: () => };
+// const element = *FIND ALL REFS*/[|obj|].Component/>;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc
new file mode 100644
index 0000000000..cf4c6eae38
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/FindReferencesSeeTagInTs.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /findReferencesSeeTagInTs.ts ===
+
+// function doStuffWithStuff/*FIND ALL REFS*/[| doStuffWithStuff|](stuff: { quantity: number }) {}
+//
+// declare const stuff: { quantity: number };
+// /** @see {doStuffWithStuff} */
+// if (stuff.quantity) {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc
new file mode 100644
index 0000000000..50992749cf
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfArrowFunction.ts ===
+
+// var /*FIND ALL REFS*/[| f|] = x => x + 1;[|
+// f|](12);
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfArrowFunction.ts ===
+
+// var[| f|] = x => x + 1;[|
+// /*FIND ALL REFS*/f|](12);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfBindingPattern.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfBindingPattern.baseline.jsonc
new file mode 100644
index 0000000000..8c3e1b7643
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfBindingPattern.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfBindingPattern.ts ===
+
+// const { /*FIND ALL REFS*/[| x|], y } = {[| x|]: 1, y: 2 };
+// const z =[| x|];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfBindingPattern.ts ===
+
+// const { x, y } = { /*FIND ALL REFS*/[| x|], y } = {[| x|]: 1, y: 2 };
+// const z = x;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfBindingPattern.ts ===
+
+// const {[| x|], y } = { x: 1, y: 2 };
+// const z = /*FIND ALL REFS*/[| x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfClass.baseline.jsonc
new file mode 100644
index 0000000000..ae9ace7817
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfClass.baseline.jsonc
@@ -0,0 +1,29 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfClass.ts ===
+
+// class /*FIND ALL REFS*/[| C|] {
+// n: number;
+// constructor() {
+// this.n = 12;
+// }
+// }
+// let c = new[| C|]();
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfClass.ts ===
+
+// class[| C|] {
+// n: number;
+// constructor() {
+// this.n = 12;
+// }
+// }
+// let c = new /*FIND ALL REFS*/[| C|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfComputedProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfComputedProperty.baseline.jsonc
new file mode 100644
index 0000000000..f9df2bdf10
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfComputedProperty.baseline.jsonc
@@ -0,0 +1,31 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfComputedProperty.ts ===
+
+// let o = { ["/*FIND ALL REFS*/[|"foo"|]]: 12 };
+// let y = o.[|foo|];
+// let z = o[[|'foo'|]];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfComputedProperty.ts ===
+
+// let o = { [[|"foo"|]]: 12 };
+// let y = o./*FIND ALL REFS*/[|foo|];
+// let z = o[[|'foo'|]];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfComputedProperty.ts ===
+
+// let o = { [[|"foo"|]]: 12 };
+// let y = o.[|foo|];
+// let z = o['/*FIND ALL REFS*/[|'foo'|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfEnum.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfEnum.baseline.jsonc
new file mode 100644
index 0000000000..dfb5291278
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfEnum.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfEnum.ts ===
+
+// enum /*FIND ALL REFS*/[| E|] {
+// First,
+// Second
+// }
+// let first =[| E|].First;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfEnum.ts ===
+
+// enum[| E|] {
+// First,
+// Second
+// }
+// let first = /*FIND ALL REFS*/[| E|].First;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfExport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfExport.baseline.jsonc
new file mode 100644
index 0000000000..871e506774
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfExport.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+// === /m.ts ===
+
+// export var /*FIND ALL REFS*/[| x|] = 12;
+
+
+
+
+// === findAllReferences ===
+// === /main.ts ===
+
+// import { /*FIND ALL REFS*/[| x|] } from "./m";
+// const y =[| x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfFunction.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfFunction.baseline.jsonc
new file mode 100644
index 0000000000..fda7246da9
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfFunction.baseline.jsonc
@@ -0,0 +1,21 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfFunction.ts ===
+
+// function /*FIND ALL REFS*/[| func|](x: number) {
+// }[|
+// func|](x)
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfFunction.ts ===
+
+// function[| func|](x: number) {
+// }[|
+// /*FIND ALL REFS*/func|](x)
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterface.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterface.baseline.jsonc
new file mode 100644
index 0000000000..2bf3199047
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterface.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterface.ts ===
+
+// interface /*FIND ALL REFS*/[| I|] {
+// p: number;
+// }
+// let i:[| I|] = { p: 12 };
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterface.ts ===
+
+// interface[| I|] {
+// p: number;
+// }
+// let i: /*FIND ALL REFS*/[| I|] = { p: 12 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc
new file mode 100644
index 0000000000..5defdee331
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc
@@ -0,0 +1,111 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts ===
+
+// interface /*FIND ALL REFS*/[| Numbers|] {
+// p: number;
+// }
+// interface[| Numbers|] {
+// m: number;
+// }
+// class[| Numbers|] {
+// f(n: number) {
+// return this.p + this.m + n;
+// }
+// }
+// let i:[| Numbers|] = new[| Numbers|]();
+// let x = i.f(i.p + i.m);
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts ===
+
+// interface[| Numbers|] {
+// p: number;
+// }
+// interface /*FIND ALL REFS*/[| Numbers|] {
+// m: number;
+// }
+// class[| Numbers|] {
+// f(n: number) {
+// return this.p + this.m + n;
+// }
+// }
+// let i:[| Numbers|] = new[| Numbers|]();
+// let x = i.f(i.p + i.m);
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts ===
+
+// interface[| Numbers|] {
+// p: number;
+// }
+// interface[| Numbers|] {
+// m: number;
+// }
+// class /*FIND ALL REFS*/[| Numbers|] {
+// f(n: number) {
+// return this.p + this.m + n;
+// }
+// }
+// let i:[| Numbers|] = new[| Numbers|]();
+// let x = i.f(i.p + i.m);
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts ===
+
+// interface[| Numbers|] {
+// p: number;
+// }
+// interface[| Numbers|] {
+// m: number;
+// }
+// class[| Numbers|] {
+// f(n: number) {
+// return this.p + this.m + n;
+// }
+// }
+// let i: /*FIND ALL REFS*/[| Numbers|] = new[| Numbers|]();
+// let x = i.f(i.p + i.m);
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts ===
+
+// interface[| Numbers|] {
+// p: number;
+// }
+// interface[| Numbers|] {
+// m: number;
+// }
+// class[| Numbers|] {
+// f(n: number) {
+// return this.p + this.m + n;
+// }
+// }
+// let i: Numbers = new /*FIND ALL REFS*/[| Numbers|] = new[| Numbers|]();
+// let x = i.f(i.p + i.m);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNamespace.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNamespace.baseline.jsonc
new file mode 100644
index 0000000000..d9485d18ec
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNamespace.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfNamespace.ts ===
+
+// namespace /*FIND ALL REFS*/[| Numbers|] {
+// export var n = 12;
+// }
+// let x =[| Numbers|].n + 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfNamespace.ts ===
+
+// namespace[| Numbers|] {
+// export var n = 12;
+// }
+// let x = /*FIND ALL REFS*/[| Numbers|].n + 1;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNumberNamedProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNumberNamedProperty.baseline.jsonc
new file mode 100644
index 0000000000..f376a0f7fb
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfNumberNamedProperty.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfNumberNamedProperty.ts ===
+
+// let o = { /*FIND ALL REFS*/[| 1|]: 12 };
+// let y = o[[|1|]];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfNumberNamedProperty.ts ===
+
+// let o = {[| 1|]: 12 };
+// let y = o[/*FIND ALL REFS*/[|1|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfParameter.baseline.jsonc
new file mode 100644
index 0000000000..ddc8cd40d1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfParameter.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfParameter.ts ===
+
+// function f(/*FIND ALL REFS*/[|x|]: number) {
+// return[| x|] + 1
+// }
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfParameter.ts ===
+
+// function f([|x|]: number) {
+// return /*FIND ALL REFS*/[| x|] + 1
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfStringNamedProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfStringNamedProperty.baseline.jsonc
new file mode 100644
index 0000000000..b2007932ed
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfStringNamedProperty.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfStringNamedProperty.ts ===
+
+// let o = { /*FIND ALL REFS*/[| "x"|]: 12 };
+// let y = o.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfStringNamedProperty.ts ===
+
+// let o = { "/*FIND ALL REFS*/[| "x"|]: 12 };
+// let y = o.[|x|];
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfStringNamedProperty.ts ===
+
+// let o = {[| "x"|]: 12 };
+// let y = o./*FIND ALL REFS*/[|x|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc
new file mode 100644
index 0000000000..6a82a728f4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc
@@ -0,0 +1,19 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfTypeAlias.ts ===
+
+// type /*FIND ALL REFS*/[| Alias|]= number;
+// let n:[| Alias|] = 12;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfTypeAlias.ts ===
+
+// type[| Alias|]= number;
+// let n: /*FIND ALL REFS*/[| Alias|] = 12;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfVariable.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfVariable.baseline.jsonc
new file mode 100644
index 0000000000..6f19a9cf5a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/GetOccurrencesIsDefinitionOfVariable.baseline.jsonc
@@ -0,0 +1,361 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var /*FIND ALL REFS*/[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide = /*FIND ALL REFS*/[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 + /*FIND ALL REFS*/[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// /*FIND ALL REFS*/x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// /*FIND ALL REFS*/x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x = /*FIND ALL REFS*/|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x = x + /*FIND ALL REFS*/|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// /*FIND ALL REFS*/x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// /*FIND ALL REFS*/x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++/*FIND ALL REFS*/[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement = /*FIND ALL REFS*/[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --/*FIND ALL REFS*/[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement = /*FIND ALL REFS*/[| x|]--;[|
+//
+// x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// /*FIND ALL REFS*/x|] += 1;[|
+// x|] <<= 1;
+
+
+
+
+// === findAllReferences ===
+// === /getOccurrencesIsDefinitionOfVariable.ts ===
+
+// var[| x|] = 0;
+// var assignmentRightHandSide =[| x|];
+// var assignmentRightHandSide2 = 1 +[| x|];[|
+//
+// x|] = 1;[|
+// x|] =[| x|] +[| x|];[|
+//
+// x|] == 1;[|
+// x|] <= 1;
+//
+// var preIncrement = ++[|x|];
+// var postIncrement =[| x|]++;
+// var preDecrement = --[|x|];
+// var postDecrement =[| x|]--;[|
+//
+// x|] += 1;[|
+// /*FIND ALL REFS*/x|] <<= 1;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IndirectJsRequireRename.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IndirectJsRequireRename.baseline.jsonc
new file mode 100644
index 0000000000..d00c8ea6fb
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IndirectJsRequireRename.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /lib/classes/Error.js ===
+
+// module.exports.[|logWarning|] = message => { };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossGlobalProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossGlobalProjects.baseline.jsonc
new file mode 100644
index 0000000000..0dd46fbfe2
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossGlobalProjects.baseline.jsonc
@@ -0,0 +1,136 @@
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// namespace NS {
+// export function /*FIND ALL REFS*/[| FA|]() {
+// FB();
+// }
+// }
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// --- (line: 3) skipped ---
+// }
+// }
+//
+// interface /*FIND ALL REFS*/[| I|] {
+// FA();
+// }
+//
+// const ia:[| I|] = {
+// FA() { },
+// FB() { },
+// FC() { },
+// };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// --- (line: 3) skipped ---
+// }
+// }
+//
+// interface I {[|
+// /*FIND ALL REFS*/FA|]();
+// }
+//
+// const ia: I = {
+// // --- (line: 12) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// namespace NS {
+// export function /*FIND ALL REFS*/[| FB|]() {}
+// }
+//
+// interface I {
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// namespace NS {
+// export function FB() {}
+// }
+//
+// interface /*FIND ALL REFS*/[| I|] {
+// FB();
+// }
+//
+// const ib:[| I|] = { FB() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// namespace NS {
+// export function FB() {}
+// }
+//
+// interface I {[|
+// /*FIND ALL REFS*/FB|]();
+// }
+//
+// const ib: I = { FB() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// namespace NS {
+// export function /*FIND ALL REFS*/[| FC|]() {}
+// }
+//
+// interface I {
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// namespace NS {
+// export function FC() {}
+// }
+//
+// interface /*FIND ALL REFS*/[| I|] {
+// FC();
+// }
+//
+// const ic:[| I|] = { FC() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// namespace NS {
+// export function FC() {}
+// }
+//
+// interface I {[|
+// /*FIND ALL REFS*/FC|]();
+// }
+//
+// const ic: I = { FC() {} };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossModuleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossModuleProjects.baseline.jsonc
new file mode 100644
index 0000000000..6f499d3a61
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionAcrossModuleProjects.baseline.jsonc
@@ -0,0 +1,230 @@
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// import { NS } from "../b";
+// import { I } from "../c";
+//
+// declare module "../b" {
+// export namespace NS {
+// export function /*FIND ALL REFS*/[| FA|]();
+// }
+// }
+//
+// // --- (line: 10) skipped ---
+
+
+// --- (line: 13) skipped ---
+// }
+//
+// const ia: I = {
+// FA: NS.[|FA|],
+// FC() { },
+// };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// --- (line: 7) skipped ---
+// }
+//
+// declare module "../c" {
+// export interface /*FIND ALL REFS*/[| I|] {
+// FA();
+// }
+// }
+// // --- (line: 15) skipped ---
+
+
+// === /home/src/workspaces/project/c/index.ts ===
+
+// export namespace NS {
+// export function FC() {}
+// }
+//
+// export interface[| I|] {
+// FC();
+// }
+//
+// const ic:[| I|] = { FC() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a/index.ts ===
+
+// --- (line: 7) skipped ---
+// }
+//
+// declare module "../c" {
+// export interface I {[|
+// /*FIND ALL REFS*/FA|]();
+// }
+// }
+//
+// // --- (line: 16) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a2/index.ts ===
+
+// import { NS } from "../b";
+// import { I } from "../c";
+//
+// declare module "../b" {
+// export namespace NS {
+// export function /*FIND ALL REFS*/[| FA|]();
+// }
+// }
+//
+// // --- (line: 10) skipped ---
+
+
+// --- (line: 13) skipped ---
+// }
+//
+// const ia: I = {
+// FA: NS.[|FA|],
+// FC() { },
+// };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a2/index.ts ===
+
+// --- (line: 7) skipped ---
+// }
+//
+// declare module "../c" {
+// export interface /*FIND ALL REFS*/[| I|] {
+// FA();
+// }
+// }
+// // --- (line: 15) skipped ---
+
+
+// === /home/src/workspaces/project/c/index.ts ===
+
+// export namespace NS {
+// export function FC() {}
+// }
+//
+// export interface[| I|] {
+// FC();
+// }
+//
+// const ic:[| I|] = { FC() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/a2/index.ts ===
+
+// --- (line: 7) skipped ---
+// }
+//
+// declare module "../c" {
+// export interface I {[|
+// /*FIND ALL REFS*/FA|]();
+// }
+// }
+//
+// // --- (line: 16) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// export namespace NS {
+// export function /*FIND ALL REFS*/[| FB|]() {}
+// }
+//
+// export interface I {
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// export namespace NS {
+// export function FB() {}
+// }
+//
+// export interface /*FIND ALL REFS*/[| I|] {
+// FB();
+// }
+//
+// const ib:[| I|] = { FB() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/b/index.ts ===
+
+// export namespace NS {
+// export function FB() {}
+// }
+//
+// export interface I {[|
+// /*FIND ALL REFS*/FB|]();
+// }
+//
+// const ib: I = { FB() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// export namespace NS {
+// export function /*FIND ALL REFS*/[| FC|]() {}
+// }
+//
+// export interface I {
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// export namespace NS {
+// export function FC() {}
+// }
+//
+// export interface /*FIND ALL REFS*/[| I|] {
+// FC();
+// }
+//
+// const ic:[| I|] = { FC() {} };
+
+
+
+
+// === findAllReferences ===
+// === /home/src/workspaces/project/c/index.ts ===
+
+// export namespace NS {
+// export function FC() {}
+// }
+//
+// export interface I {[|
+// /*FIND ALL REFS*/FC|]();
+// }
+//
+// const ic: I = { FC() {} };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionInterfaceImplementation.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionInterfaceImplementation.baseline.jsonc
new file mode 100644
index 0000000000..0c10206272
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionInterfaceImplementation.baseline.jsonc
@@ -0,0 +1,30 @@
+// === findAllReferences ===
+// === /isDefinitionInterfaceImplementation.ts ===
+
+// interface I {[|
+// /*FIND ALL REFS*/M|](): void;
+// }
+//
+// class C implements I {[|
+// M|]() { }
+// }
+//
+// ({} as I).[|M|]();
+// ({} as C).[|M|]();
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionInterfaceImplementation.ts ===
+
+// interface I {[|
+// M|](): void;
+// }
+//
+// class C implements I {[|
+// /*FIND ALL REFS*/M|]() { }
+// }
+//
+// ({} as I).[|M|]();
+// ({} as C).[|M|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionOverloads.baseline.jsonc
new file mode 100644
index 0000000000..8a612b570a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionOverloads.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /isDefinitionOverloads.ts ===
+
+// function /*FIND ALL REFS*/[| f|](x: number): void;
+// function[| f|](x: string): void;
+// function[| f|](x: number | string) { }[|
+//
+// f|](1);[|
+// f|]("a");
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionOverloads.ts ===
+
+// function[| f|](x: number): void;
+// function /*FIND ALL REFS*/[| f|](x: string): void;
+// function[| f|](x: number | string) { }[|
+//
+// f|](1);[|
+// f|]("a");
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionOverloads.ts ===
+
+// function[| f|](x: number): void;
+// function[| f|](x: string): void;
+// function /*FIND ALL REFS*/[| f|](x: number | string) { }[|
+//
+// f|](1);[|
+// f|]("a");
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionShorthandProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionShorthandProperty.baseline.jsonc
new file mode 100644
index 0000000000..60d20978f3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionShorthandProperty.baseline.jsonc
@@ -0,0 +1,23 @@
+// === findAllReferences ===
+// === /isDefinitionShorthandProperty.ts ===
+
+// const /*FIND ALL REFS*/[| x|] = 1;
+// const y: { x: number } = {[| x|] };
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionShorthandProperty.ts ===
+
+// const x = 1;
+// const y: { /*FIND ALL REFS*/[| x|]: number } = { x };
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionShorthandProperty.ts ===
+
+// const x = 1;
+// const y: { x: number } = { /*FIND ALL REFS*/[| x|] };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleImport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleImport.baseline.jsonc
new file mode 100644
index 0000000000..c4a8ec823a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleImport.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /a.ts ===
+
+// export function /*FIND ALL REFS*/[| f|]() {}
+
+
+
+
+// === findAllReferences ===
+// === /b.ts ===
+
+// import { /*FIND ALL REFS*/[| f|] } from "./a";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleReference.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleReference.baseline.jsonc
new file mode 100644
index 0000000000..2a0bd7d380
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/IsDefinitionSingleReference.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /isDefinitionSingleReference.ts ===
+
+// function /*FIND ALL REFS*/[| f|]() {}[|
+// f|]();
+
+
+
+
+// === findAllReferences ===
+// === /isDefinitionSingleReference.ts ===
+
+// function[| f|]() {}[|
+// /*FIND ALL REFS*/f|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc
new file mode 100644
index 0000000000..45bce806d2
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocSatisfiesTagFindAllReferences.baseline.jsonc
@@ -0,0 +1,10 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// /**
+// * @typedef {Object} T
+// * @property {number} a
+// */
+//
+// /** @satisfies {/*FIND ALL REFS*/[|T|]} comment */
+// const foo = { a: 1 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocThrowsTag_findAllReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocThrowsTag_findAllReferences.baseline.jsonc
new file mode 100644
index 0000000000..f62ab1c76b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocThrowsTag_findAllReferences.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /jsdocThrowsTag_findAllReferences.ts ===
+
+// class /*FIND ALL REFS*/[| E|] extends Error {}
+// /**
+// * @throws {E}
+// */
+// function f() {}
diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc
new file mode 100644
index 0000000000..1eee0d3a9a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning0.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @typedef {number} /*FIND ALL REFS*/[|T|] */
+// const T = 1;
+// /** @type {T} */
+// const n = T;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @typedef {number} T */
+// const /*FIND ALL REFS*/[| T|] = 1;
+// /** @type {T} */
+// const n =[| T|];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @typedef {number} T */
+// const[| T|] = 1;
+// /** @type {T} */
+// const n = /*FIND ALL REFS*/[| T|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning1.baseline.jsonc
new file mode 100644
index 0000000000..17f7fc60f1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/JsdocTypedefTagSemanticMeaning1.baseline.jsonc
@@ -0,0 +1,28 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @typedef {number} */
+// const /*FIND ALL REFS*/[| T|] = 1;
+// /** @type {T} */
+// const n =[| T|];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// /** @typedef {number} */
+// const[| T|] = 1;
+// /** @type {T} */
+// const n = /*FIND ALL REFS*/[| T|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferenceInParameterPropertyDeclaration.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferenceInParameterPropertyDeclaration.baseline.jsonc
new file mode 100644
index 0000000000..fc7bd686bc
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferenceInParameterPropertyDeclaration.baseline.jsonc
@@ -0,0 +1,58 @@
+// === findAllReferences ===
+// === /file1.ts ===
+
+// class Foo {
+// constructor(private /*FIND ALL REFS*/[| privateParam|]: number,
+// public publicParam: string,
+// protected protectedParam: boolean) {
+//
+// let localPrivate =[| privateParam|];
+// this.[|privateParam|] += 10;
+//
+// let localPublic = publicParam;
+// this.publicParam += " Hello!";
+// // --- (line: 11) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// class Foo {
+// constructor(private privateParam: number,
+// public /*FIND ALL REFS*/[| publicParam|]: string,
+// protected protectedParam: boolean) {
+//
+// let localPrivate = privateParam;
+// this.privateParam += 10;
+//
+// let localPublic =[| publicParam|];
+// this.[|publicParam|] += " Hello!";
+//
+// let localProtected = protectedParam;
+// this.protectedParam = false;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /file1.ts ===
+
+// class Foo {
+// constructor(private privateParam: number,
+// public publicParam: string,
+// protected /*FIND ALL REFS*/[| protectedParam|]: boolean) {
+//
+// let localPrivate = privateParam;
+// this.privateParam += 10;
+//
+// let localPublic = publicParam;
+// this.publicParam += " Hello!";
+//
+// let localProtected =[| protectedParam|];
+// this.[|protectedParam|] = false;
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferenceToClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferenceToClass.baseline.jsonc
new file mode 100644
index 0000000000..bdece0bc13
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferenceToClass.baseline.jsonc
@@ -0,0 +1,121 @@
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class /*FIND ALL REFS*/[| foo|] {
+// public n:[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n:[| foo|];
+// public k = new[| foo|]();
+// }
+//
+// module mod {
+// var k:[| foo|] = null;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class[| foo|] {
+// public n: /*FIND ALL REFS*/[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n:[| foo|];
+// public k = new[| foo|]();
+// }
+//
+// module mod {
+// var k:[| foo|] = null;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class[| foo|] {
+// public n:[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n: /*FIND ALL REFS*/[| foo|];
+// public k = new[| foo|]();
+// }
+//
+// module mod {
+// var k:[| foo|] = null;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class[| foo|] {
+// public n:[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n:[| foo|];
+// public k = new /*FIND ALL REFS*/[| foo|]();
+// }
+//
+// module mod {
+// var k:[| foo|] = null;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class[| foo|] {
+// public n:[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n:[| foo|];
+// public k = new[| foo|]();
+// }
+//
+// module mod {
+// var k: /*FIND ALL REFS*/[| foo|] = null;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referenceToClass_1.ts ===
+
+// class[| foo|] {
+// public n:[| foo|];
+// public foo: number;
+// }
+//
+// class bar {
+// public n:[| foo|];
+// public k = new[| foo|]();
+// }
+//
+// module mod {
+// var k:[| foo|] = null;
+// }
+
+
+// === /referenceToClass_2.ts ===
+
+// var k: /*FIND ALL REFS*/[| foo|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferenceToEmptyObject.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferenceToEmptyObject.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferenceToEmptyObject.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/References01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/References01.baseline.jsonc
new file mode 100644
index 0000000000..b3526c1185
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/References01.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /home/src/workspaces/project/referencesForGlobals_1.ts ===
+
+// class[| globalClass|] {
+// public f() { }
+// }
+
+
+// === /home/src/workspaces/project/referencesForGlobals_2.ts ===
+
+// ///
+// var c = /*FIND ALL REFS*/[| globalClass|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters.baseline.jsonc
new file mode 100644
index 0000000000..5f16e9e938
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /declaration.ts ===
+
+// var container = { /*FIND ALL REFS*/[| searchProp|] : 1 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters2.baseline.jsonc
new file mode 100644
index 0000000000..1daa716861
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters2.baseline.jsonc
@@ -0,0 +1,4 @@
+// === findAllReferences ===
+// === /declaration.ts ===
+
+// var container = { /*FIND ALL REFS*/[| 42|]: 1 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters3.baseline.jsonc
new file mode 100644
index 0000000000..3952b6c8af
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesBloomFilters3.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+// === /declaration.ts ===
+
+// enum Test { /*FIND ALL REFS*/[| "42"|] = 1 };
+
+
+
+
+// === findAllReferences ===
+// === /declaration.ts ===
+
+// enum Test { "/*FIND ALL REFS*/[| "42"|] = 1 };
+
+
+
+
+// === findAllReferences ===
+// === /declaration.ts ===
+
+// enum Test {[| "42"|] = 1 };
+
+
+// === /expression.ts ===
+
+// (Test[/*FIND ALL REFS*/[|42|]]);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForAmbients.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForAmbients.baseline.jsonc
new file mode 100644
index 0000000000..2bc6b38756
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForAmbients.baseline.jsonc
@@ -0,0 +1,191 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "/*FIND ALL REFS*/[| "foo"|] {
+// var f: number;
+// }
+//
+// declare module "bar" {
+// export import foo = require([|"foo"|]);
+// var f2: typeof foo.f;
+// }
+//
+// // --- (line: 10) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var /*FIND ALL REFS*/[| f|]: number;
+// }
+//
+// declare module "bar" {
+// export import foo = require("foo");
+// var f2: typeof foo.[|f|];
+// }
+//
+// declare module "baz" {
+// // --- (line: 11) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var f: number;
+// }
+//
+// declare module "/*FIND ALL REFS*/[| "bar"|] {
+// export import foo = require("foo");
+// var f2: typeof foo.f;
+// }
+//
+// declare module "baz" {
+// import bar = require([|"bar"|]);
+// var f2: typeof bar.foo;
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var f: number;
+// }
+//
+// declare module "bar" {
+// export import /*FIND ALL REFS*/[| foo|] = require("foo");
+// var f2: typeof[| foo|].f;
+// }
+//
+// declare module "baz" {
+// import bar = require("bar");
+// var f2: typeof bar.[|foo|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module[| "foo"|] {
+// var f: number;
+// }
+//
+// declare module "bar" {
+// export import foo = require("/*FIND ALL REFS*/[|"foo"|]);
+// var f2: typeof foo.f;
+// }
+//
+// // --- (line: 10) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var f: number;
+// }
+//
+// declare module "bar" {
+// export import[| foo|] = require("foo");
+// var f2: typeof /*FIND ALL REFS*/[| foo|].f;
+// }
+//
+// declare module "baz" {
+// import bar = require("bar");
+// var f2: typeof bar.[|foo|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var[| f|]: number;
+// }
+//
+// declare module "bar" {
+// export import foo = require("foo");
+// var f2: typeof foo./*FIND ALL REFS*/[|f|];
+// }
+//
+// declare module "baz" {
+// // --- (line: 11) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var f: number;
+// }
+//
+// declare module[| "bar"|] {
+// export import foo = require("foo");
+// var f2: typeof foo.f;
+// }
+//
+// declare module "baz" {
+// import bar = require("/*FIND ALL REFS*/[|"bar"|]);
+// var f2: typeof bar.foo;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForAmbients.ts ===
+
+// declare module "foo" {
+// var f: number;
+// }
+//
+// declare module "bar" {
+// export import[| foo|] = require("foo");
+// var f2: typeof[| foo|].f;
+// }
+//
+// declare module "baz" {
+// import bar = require("bar");
+// var f2: typeof bar./*FIND ALL REFS*/[|foo|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassLocal.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassLocal.baseline.jsonc
new file mode 100644
index 0000000000..65032ca162
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassLocal.baseline.jsonc
@@ -0,0 +1,67 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassLocal.ts ===
+
+// var n = 14;
+//
+// class foo {
+// private /*FIND ALL REFS*/[| n|] = 0;
+//
+// public bar() {
+// this.[|n|] = 9;
+// }
+//
+// constructor() {
+// this.[|n|] = 4;
+// }
+//
+// public bar2() {
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassLocal.ts ===
+
+// var n = 14;
+//
+// class foo {
+// private[| n|] = 0;
+//
+// public bar() {
+// this./*FIND ALL REFS*/[|n|] = 9;
+// }
+//
+// constructor() {
+// this.[|n|] = 4;
+// }
+//
+// public bar2() {
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassLocal.ts ===
+
+// var n = 14;
+//
+// class foo {
+// private[| n|] = 0;
+//
+// public bar() {
+// this.[|n|] = 9;
+// }
+//
+// constructor() {
+// this./*FIND ALL REFS*/[|n|] = 4;
+// }
+//
+// public bar2() {
+// // --- (line: 15) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembers.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembers.baseline.jsonc
new file mode 100644
index 0000000000..580a92e03a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembers.baseline.jsonc
@@ -0,0 +1,110 @@
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {[|
+// /*FIND ALL REFS*/a|]: number;
+// method(): void { }
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {[|
+// a|]: number;
+// method(): void { }
+// }
+// class MyClass extends Base {[|
+// /*FIND ALL REFS*/a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {[|
+// a|]: number;
+// method(): void { }
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c./*FIND ALL REFS*/[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {
+// a: number;[|
+// /*FIND ALL REFS*/method|](): void { }
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {
+// a: number;[|
+// method|](): void { }
+// }
+// class MyClass extends Base {
+// a;[|
+// /*FIND ALL REFS*/method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembers.ts ===
+
+// class Base {
+// a: number;[|
+// method|](): void { }
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c./*FIND ALL REFS*/[|method|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingAbstractClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingAbstractClass.baseline.jsonc
new file mode 100644
index 0000000000..99e6ebb547
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingAbstractClass.baseline.jsonc
@@ -0,0 +1,110 @@
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract /*FIND ALL REFS*/[| a|]: number;
+// abstract method(): void;
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract[| a|]: number;
+// abstract method(): void;
+// }
+// class MyClass extends Base {[|
+// /*FIND ALL REFS*/a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract[| a|]: number;
+// abstract method(): void;
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c./*FIND ALL REFS*/[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract a: number;
+// abstract /*FIND ALL REFS*/[| method|](): void;
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract a: number;
+// abstract[| method|](): void;
+// }
+// class MyClass extends Base {
+// a;[|
+// /*FIND ALL REFS*/method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingAbstractClass.ts ===
+
+// abstract class Base {
+// abstract a: number;
+// abstract[| method|](): void;
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c./*FIND ALL REFS*/[|method|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingGenericClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingGenericClass.baseline.jsonc
new file mode 100644
index 0000000000..6b94790332
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassMembersExtendingGenericClass.baseline.jsonc
@@ -0,0 +1,110 @@
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {[|
+// /*FIND ALL REFS*/a|]: this;
+// method(a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {[|
+// a|]: this;
+// method(a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {[|
+// /*FIND ALL REFS*/a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c.[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {[|
+// a|]: this;
+// method(a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {[|
+// a|];
+// method() { }
+// }
+//
+// var c: MyClass;
+// c./*FIND ALL REFS*/[|a|];
+// c.method();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {
+// a: this;[|
+// /*FIND ALL REFS*/method|](a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {
+// a: this;[|
+// method|](a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {
+// a;[|
+// /*FIND ALL REFS*/method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c.[|method|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassMembersExtendingGenericClass.ts ===
+
+// class Base {
+// a: this;[|
+// method|](a?:T, b?:U): this { }
+// }
+// class MyClass extends Base {
+// a;[|
+// method|]() { }
+// }
+//
+// var c: MyClass;
+// c.a;
+// c./*FIND ALL REFS*/[|method|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassParameter.baseline.jsonc
new file mode 100644
index 0000000000..bb68404b4e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForClassParameter.baseline.jsonc
@@ -0,0 +1,70 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassParameter.ts ===
+
+// var p = 2;
+//
+// class p { }
+//
+// class foo {
+// constructor (public /*FIND ALL REFS*/[| p|]: any) {
+// }
+//
+// public f(p) {
+// this.[|p|] = p;
+// }
+//
+// }
+//
+// var n = new foo(undefined);
+// n.[|p|] = null;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassParameter.ts ===
+
+// var p = 2;
+//
+// class p { }
+//
+// class foo {
+// constructor (public[| p|]: any) {
+// }
+//
+// public f(p) {
+// this./*FIND ALL REFS*/[|p|] = p;
+// }
+//
+// }
+//
+// var n = new foo(undefined);
+// n.[|p|] = null;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForClassParameter.ts ===
+
+// var p = 2;
+//
+// class p { }
+//
+// class foo {
+// constructor (public[| p|]: any) {
+// }
+//
+// public f(p) {
+// this.[|p|] = p;
+// }
+//
+// }
+//
+// var n = new foo(undefined);
+// n./*FIND ALL REFS*/[|p|] = null;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedObjectLiteralProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedObjectLiteralProperties.baseline.jsonc
new file mode 100644
index 0000000000..cd93790fc1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedObjectLiteralProperties.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /referencesForContextuallyTypedObjectLiteralProperties.ts ===
+
+// interface IFoo { /*FIND ALL REFS*/[| xy|]: number; }
+//
+// // Assignment
+// var a1: IFoo = { xy: 0 };
+// // --- (line: 5) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties.baseline.jsonc
new file mode 100644
index 0000000000..400013c0c7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties.baseline.jsonc
@@ -0,0 +1,155 @@
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// interface A {
+// a: number;[|
+// /*FIND ALL REFS*/common|]: string;
+// }
+//
+// interface B {
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 3) skipped ---
+// }
+//
+// interface B {
+// b: number;[|
+// /*FIND ALL REFS*/common|]: number;
+// }
+//
+// // Assignment
+// // --- (line: 12) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 8) skipped ---
+// }
+//
+// // Assignment
+// var v1: A | B = { a: 0, /*FIND ALL REFS*/[| common|]: "" };
+// var v2: A | B = { b: 0, common: 3 };
+//
+// // Function call
+// // --- (line: 16) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 9) skipped ---
+//
+// // Assignment
+// var v1: A | B = { a: 0, common: "" };
+// var v2: A | B = { b: 0, /*FIND ALL REFS*/[| common|]: 3 };
+//
+// // Function call
+// function consumer(f: A | B) { }
+// // --- (line: 17) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 13) skipped ---
+//
+// // Function call
+// function consumer(f: A | B) { }
+// consumer({ a: 0, b: 0, /*FIND ALL REFS*/[| common|]: 1 });
+//
+// // Type cast
+// var c = { common: 0, b: 0 };
+// // --- (line: 21) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 16) skipped ---
+// consumer({ a: 0, b: 0, common: 1 });
+//
+// // Type cast
+// var c = { /*FIND ALL REFS*/[| common|]: 0, b: 0 };
+//
+// // Array literal
+// var ar: Array = [{ a: 0, common: "" }, { b: 0, common: 0 }];
+// // --- (line: 24) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 19) skipped ---
+// var c = { common: 0, b: 0 };
+//
+// // Array literal
+// var ar: Array = [{ a: 0, /*FIND ALL REFS*/[| common|]: "" }, { b: 0, common: 0 }];
+//
+// // Nested object literal
+// var ob: { aorb: A|B } = { aorb: { b: 0, common: 0 } };
+// // --- (line: 27) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 19) skipped ---
+// var c = { common: 0, b: 0 };
+//
+// // Array literal
+// var ar: Array = [{ a: 0, common: "" }, { b: 0, /*FIND ALL REFS*/[| common|]: 0 }];
+//
+// // Nested object literal
+// var ob: { aorb: A|B } = { aorb: { b: 0, common: 0 } };
+// // --- (line: 27) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 22) skipped ---
+// var ar: Array = [{ a: 0, common: "" }, { b: 0, common: 0 }];
+//
+// // Nested object literal
+// var ob: { aorb: A|B } = { aorb: { b: 0, /*FIND ALL REFS*/[| common|]: 0 } };
+//
+// // Widened type
+// var w: A|B = { a:0, common: undefined };
+// // --- (line: 30) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties.ts ===
+
+// --- (line: 25) skipped ---
+// var ob: { aorb: A|B } = { aorb: { b: 0, common: 0 } };
+//
+// // Widened type
+// var w: A|B = { a:0, /*FIND ALL REFS*/[| common|]: undefined };
+//
+// // Untped -- should not be included
+// var u1 = { a: 0, b: 0, common: "" };
+// var u2 = { b: 0, common: 0 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties2.baseline.jsonc
new file mode 100644
index 0000000000..8842b3d9ba
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForContextuallyTypedUnionProperties2.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /referencesForContextuallyTypedUnionProperties2.ts ===
+
+// interface A {
+// a: number;
+// common: string;
+// }
+//
+// interface B {[|
+// /*FIND ALL REFS*/b|]: number;
+// common: number;
+// }
+//
+// // --- (line: 11) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForDeclarationKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForDeclarationKeywords.baseline.jsonc
new file mode 100644
index 0000000000..fd6d0d906a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForDeclarationKeywords.baseline.jsonc
@@ -0,0 +1,81 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForEnums.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForEnums.baseline.jsonc
new file mode 100644
index 0000000000..0265709331
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForEnums.baseline.jsonc
@@ -0,0 +1,149 @@
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {[|
+// /*FIND ALL REFS*/value1|] = 1,
+// "value2" =[| value1|],
+// 111 = 11
+// }
+//
+// E.[|value1|];
+// E["value2"];
+// E.value2;
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,[|
+// /*FIND ALL REFS*/"value2"|] = value1,
+// 111 = 11
+// }
+//
+// E.value1;
+// E[[|"value2"|]];
+// E.[|value2|];
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,[|
+// "/*FIND ALL REFS*/value2"|] = value1,
+// 111 = 11
+// }
+//
+// E.value1;
+// E[[|"value2"|]];
+// E.[|value2|];
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {[|
+// value1|] = 1,
+// "value2" = /*FIND ALL REFS*/[| value1|],
+// 111 = 11
+// }
+//
+// E.[|value1|];
+// E["value2"];
+// E.value2;
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,
+// "value2" = value1,[|
+// /*FIND ALL REFS*/111|] = 11
+// }
+//
+// E.value1;
+// E["value2"];
+// E.value2;
+// E[[|111|]];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {[|
+// value1|] = 1,
+// "value2" =[| value1|],
+// 111 = 11
+// }
+//
+// E./*FIND ALL REFS*/[|value1|];
+// E["value2"];
+// E.value2;
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,[|
+// "value2"|] = value1,
+// 111 = 11
+// }
+//
+// E.value1;
+// E["/*FIND ALL REFS*/[|"value2"|]];
+// E.[|value2|];
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,[|
+// "value2"|] = value1,
+// 111 = 11
+// }
+//
+// E.value1;
+// E[[|"value2"|]];
+// E./*FIND ALL REFS*/[|value2|];
+// E[111];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForEnums.ts ===
+
+// enum E {
+// value1 = 1,
+// "value2" = value1,[|
+// 111|] = 11
+// }
+//
+// E.value1;
+// E["value2"];
+// E.value2;
+// E[/*FIND ALL REFS*/[|111|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExpressionKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExpressionKeywords.baseline.jsonc
new file mode 100644
index 0000000000..84862a4004
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExpressionKeywords.baseline.jsonc
@@ -0,0 +1,69 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForExpressionKeywords.ts ===
+
+// class C {
+// static x = 1;
+// }
+// new C();
+// void C;[|
+// /*FIND ALL REFS*/typeof|] C;
+// delete C.x;
+// async function* f() {
+// yield C;
+// // --- (line: 10) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForExpressionKeywords.ts ===
+
+// class[| C|] {
+// static x = 1;
+// }
+// new[| C|]();
+// void[| C|];
+// typeof[| C|];
+// delete[| C|].x;
+// async function* f() {
+// yield[| C|];
+// await[| C|];
+// }
+// "x" in[| C|];
+// undefined /*FIND ALL REFS*/instanceof[| C|];
+// undefined as[| C|];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExternalModuleNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExternalModuleNames.baseline.jsonc
new file mode 100644
index 0000000000..b86cc60874
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForExternalModuleNames.baseline.jsonc
@@ -0,0 +1,31 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// declare module "/*FIND ALL REFS*/[| "foo"|] {
+// var f: number;
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// declare module[| "foo"|] {
+// var f: number;
+// }
+
+
+// === /referencesForGlobals_2.ts ===
+
+// import f = require("/*FIND ALL REFS*/[|"foo"|]);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionOverloads.baseline.jsonc
new file mode 100644
index 0000000000..e32c5f98f7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionOverloads.baseline.jsonc
@@ -0,0 +1,39 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForFunctionOverloads.ts ===
+
+// function /*FIND ALL REFS*/[| foo|](x: string);
+// function[| foo|](x: string, y: number) {[|
+// foo|]('', 43);
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForFunctionOverloads.ts ===
+
+// function[| foo|](x: string);
+// function /*FIND ALL REFS*/[| foo|](x: string, y: number) {[|
+// foo|]('', 43);
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForFunctionOverloads.ts ===
+
+// function[| foo|](x: string);
+// function[| foo|](x: string, y: number) {[|
+// /*FIND ALL REFS*/foo|]('', 43);
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionParameter.baseline.jsonc
new file mode 100644
index 0000000000..9111edbc59
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForFunctionParameter.baseline.jsonc
@@ -0,0 +1,38 @@
+// === findAllReferences ===
+// === /referencesForFunctionParameter.ts ===
+
+// var x;
+// var n;
+//
+// function n(x: number, /*FIND ALL REFS*/[| n|]: number) {[|
+// n|] = 32;
+// x =[| n|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForFunctionParameter.ts ===
+
+// var x;
+// var n;
+//
+// function n(x: number,[| n|]: number) {[|
+// /*FIND ALL REFS*/n|] = 32;
+// x =[| n|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForFunctionParameter.ts ===
+
+// var x;
+// var n;
+//
+// function n(x: number,[| n|]: number) {[|
+// n|] = 32;
+// x = /*FIND ALL REFS*/[| n|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals.baseline.jsonc
new file mode 100644
index 0000000000..e749932f2e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals.baseline.jsonc
@@ -0,0 +1,106 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// var /*FIND ALL REFS*/[| global|] = 2;
+//
+// class foo {
+// constructor (public global) { }
+// public f(global) { }
+// public f2(global) { }
+// }
+//
+// class bar {
+// constructor () {
+// var n =[| global|];
+//
+// var f = new foo('');
+// f.global = '';
+// }
+// }
+//
+// var k =[| global|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// var[| global|] = 2;
+//
+// class foo {
+// constructor (public global) { }
+// public f(global) { }
+// public f2(global) { }
+// }
+//
+// class bar {
+// constructor () {
+// var n = /*FIND ALL REFS*/[| global|];
+//
+// var f = new foo('');
+// f.global = '';
+// }
+// }
+//
+// var k =[| global|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// var[| global|] = 2;
+//
+// class foo {
+// constructor (public global) { }
+// public f(global) { }
+// public f2(global) { }
+// }
+//
+// class bar {
+// constructor () {
+// var n =[| global|];
+//
+// var f = new foo('');
+// f.global = '';
+// }
+// }
+//
+// var k = /*FIND ALL REFS*/[| global|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// var[| global|] = 2;
+//
+// class foo {
+// constructor (public global) { }
+// public f(global) { }
+// public f2(global) { }
+// }
+//
+// class bar {
+// constructor () {
+// var n =[| global|];
+//
+// var f = new foo('');
+// f.global = '';
+// }
+// }
+//
+// var k =[| global|];
+
+
+// === /referencesForGlobals_2.ts ===
+
+// var m = /*FIND ALL REFS*/[| global|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals2.baseline.jsonc
new file mode 100644
index 0000000000..49f2f38ace
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals2.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// class /*FIND ALL REFS*/[| globalClass|] {
+// public f() { }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// class[| globalClass|] {
+// public f() { }
+// }
+
+
+// === /referencesForGlobals_2.ts ===
+
+// var c = /*FIND ALL REFS*/[| globalClass|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals3.baseline.jsonc
new file mode 100644
index 0000000000..4e5b2dc728
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals3.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// interface /*FIND ALL REFS*/[| globalInterface|] {
+// f();
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// interface[| globalInterface|] {
+// f();
+// }
+
+
+// === /referencesForGlobals_2.ts ===
+
+// var i: /*FIND ALL REFS*/[| globalInterface|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals4.baseline.jsonc
new file mode 100644
index 0000000000..365b7ad331
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals4.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// module /*FIND ALL REFS*/[| globalModule|] {
+// export f() { };
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// module[| globalModule|] {
+// export f() { };
+// }
+
+
+// === /referencesForGlobals_2.ts ===
+
+// var m = /*FIND ALL REFS*/[| globalModule|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals5.baseline.jsonc
new file mode 100644
index 0000000000..d7dc8b86e4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobals5.baseline.jsonc
@@ -0,0 +1,30 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// module globalModule {
+// export var x;
+// }
+//
+// import /*FIND ALL REFS*/[| globalAlias|] = globalModule;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobals_1.ts ===
+
+// module globalModule {
+// export var x;
+// }
+//
+// import[| globalAlias|] = globalModule;
+
+
+// === /referencesForGlobals_2.ts ===
+
+// var m = /*FIND ALL REFS*/[| globalAlias|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobalsInExternalModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobalsInExternalModule.baseline.jsonc
new file mode 100644
index 0000000000..4a8f1913eb
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForGlobalsInExternalModule.baseline.jsonc
@@ -0,0 +1,142 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// var /*FIND ALL REFS*/[| topLevelVar|] = 2;
+// var topLevelVar2 =[| topLevelVar|];
+//
+// class topLevelClass { }
+// var c = new topLevelClass();
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// var[| topLevelVar|] = 2;
+// var topLevelVar2 = /*FIND ALL REFS*/[| topLevelVar|];
+//
+// class topLevelClass { }
+// var c = new topLevelClass();
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// var topLevelVar = 2;
+// var topLevelVar2 = topLevelVar;
+//
+// class /*FIND ALL REFS*/[| topLevelClass|] { }
+// var c = new[| topLevelClass|]();
+//
+// interface topLevelInterface { }
+// var i: topLevelInterface;
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// var topLevelVar = 2;
+// var topLevelVar2 = topLevelVar;
+//
+// class[| topLevelClass|] { }
+// var c = new /*FIND ALL REFS*/[| topLevelClass|]();
+//
+// interface topLevelInterface { }
+// var i: topLevelInterface;
+// // --- (line: 9) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// --- (line: 3) skipped ---
+// class topLevelClass { }
+// var c = new topLevelClass();
+//
+// interface /*FIND ALL REFS*/[| topLevelInterface|] { }
+// var i:[| topLevelInterface|];
+//
+// module topLevelModule {
+// export var x;
+// // --- (line: 12) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// --- (line: 3) skipped ---
+// class topLevelClass { }
+// var c = new topLevelClass();
+//
+// interface[| topLevelInterface|] { }
+// var i: /*FIND ALL REFS*/[| topLevelInterface|];
+//
+// module topLevelModule {
+// export var x;
+// // --- (line: 12) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// --- (line: 6) skipped ---
+// interface topLevelInterface { }
+// var i: topLevelInterface;
+//
+// module /*FIND ALL REFS*/[| topLevelModule|] {
+// export var x;
+// }
+// var x =[| topLevelModule|].x;
+//
+// export = x;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForGlobalsInExternalModule.ts ===
+
+// --- (line: 6) skipped ---
+// interface topLevelInterface { }
+// var i: topLevelInterface;
+//
+// module[| topLevelModule|] {
+// export var x;
+// }
+// var x = /*FIND ALL REFS*/[| topLevelModule|].x;
+//
+// export = x;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIllegalAssignment.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIllegalAssignment.baseline.jsonc
new file mode 100644
index 0000000000..003f992eae
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIllegalAssignment.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIllegalAssignment.ts ===
+
+// foo = foo;
+// var /*FIND ALL REFS*/[| bar|] = function () { };[|
+// bar|] =[| bar|] + 1;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForImports.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForImports.baseline.jsonc
new file mode 100644
index 0000000000..e1e5b5afd7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForImports.baseline.jsonc
@@ -0,0 +1,46 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForImports.ts ===
+
+// declare module "jquery" {
+// function $(s: string): any;
+// export = $;
+// }
+// import /*FIND ALL REFS*/[| $|] = require("jquery");[|
+// $|]("a");
+// import $ = require("jquery");
+
+
+
+
+// === findAllReferences ===
+// === /referencesForImports.ts ===
+
+// declare module "jquery" {
+// function $(s: string): any;
+// export = $;
+// }
+// import[| $|] = require("jquery");[|
+// /*FIND ALL REFS*/$|]("a");
+// import $ = require("jquery");
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForImports.ts ===
+
+// --- (line: 3) skipped ---
+// }
+// import $ = require("jquery");
+// $("a");
+// import /*FIND ALL REFS*/[| $|] = require("jquery");
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty.baseline.jsonc
new file mode 100644
index 0000000000..b3480ce9e6
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /referencesForIndexProperty.ts ===
+
+// class Foo {[|
+// /*FIND ALL REFS*/property|]: number;
+// method(): void { }
+// }
+//
+// var f: Foo;
+// f[[|"property"|]];
+// f["method"];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIndexProperty.ts ===
+
+// class Foo {
+// property: number;[|
+// /*FIND ALL REFS*/method|](): void { }
+// }
+//
+// var f: Foo;
+// f["property"];
+// f[[|"method"|]];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIndexProperty.ts ===
+
+// class Foo {[|
+// property|]: number;
+// method(): void { }
+// }
+//
+// var f: Foo;
+// f["/*FIND ALL REFS*/[|"property"|]];
+// f["method"];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIndexProperty.ts ===
+
+// class Foo {
+// property: number;[|
+// method|](): void { }
+// }
+//
+// var f: Foo;
+// f["property"];
+// f["/*FIND ALL REFS*/[|"method"|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty2.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty2.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty3.baseline.jsonc
new file mode 100644
index 0000000000..ff86ce954f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForIndexProperty3.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /referencesForIndexProperty3.ts ===
+
+// interface Object {[|
+// /*FIND ALL REFS*/toMyString|]();
+// }
+//
+// var y: Object;
+// y.[|toMyString|]();
+//
+// var x = {};
+// x[[|"toMyString"|]]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIndexProperty3.ts ===
+
+// interface Object {[|
+// toMyString|]();
+// }
+//
+// var y: Object;
+// y./*FIND ALL REFS*/[|toMyString|]();
+//
+// var x = {};
+// x[[|"toMyString"|]]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForIndexProperty3.ts ===
+
+// interface Object {[|
+// toMyString|]();
+// }
+//
+// var y: Object;
+// y.[|toMyString|]();
+//
+// var x = {};
+// x["/*FIND ALL REFS*/[|"toMyString"|]]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties.baseline.jsonc
new file mode 100644
index 0000000000..d35bd6ed67
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties.baseline.jsonc
@@ -0,0 +1,104 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties.ts ===
+
+// interface interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// }
+//
+// interface interface2 extends interface1{[|
+// doStuff|](): void;
+// }
+//
+// class class1 implements interface2 {[|
+// doStuff|]() {
+//
+// }
+// }
+//
+// class class2 extends class1 {
+//
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties.ts ===
+
+// interface interface1 {[|
+// doStuff|](): void;
+// }
+//
+// interface interface2 extends interface1{[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// }
+//
+// class class1 implements interface2 {[|
+// doStuff|]() {
+//
+// }
+// }
+//
+// class class2 extends class1 {
+//
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties.ts ===
+
+// interface interface1 {[|
+// doStuff|](): void;
+// }
+//
+// interface interface2 extends interface1{[|
+// doStuff|](): void;
+// }
+//
+// class class1 implements interface2 {[|
+// /*FIND ALL REFS*/doStuff|]() {
+//
+// }
+// }
+//
+// class class2 extends class1 {
+//
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties.ts ===
+
+// interface interface1 {[|
+// doStuff|](): void;
+// }
+//
+// interface interface2 extends interface1{[|
+// doStuff|](): void;
+// }
+//
+// class class1 implements interface2 {[|
+// doStuff|]() {
+//
+// }
+// }
+//
+// class class2 extends class1 {
+//
+// }
+//
+// var v: class2;
+// v./*FIND ALL REFS*/[|doStuff|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties2.baseline.jsonc
new file mode 100644
index 0000000000..4a9cb53984
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties2.baseline.jsonc
@@ -0,0 +1,26 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties2.ts ===
+
+// interface interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// }
+//
+// interface interface2 {[|
+// doStuff|](): void;
+// }
+//
+// interface interface2 extends interface1 {
+// }
+//
+// class class1 implements interface2 {[|
+// doStuff|]() {
+//
+// }
+// }
+//
+// class class2 extends class1 {
+//
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties3.baseline.jsonc
new file mode 100644
index 0000000000..d98beac88c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties3.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties3.ts ===
+
+// interface interface1 extends interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// propName: string;
+// }
+//
+// var v: interface1;
+// v.propName;
+// v.[|doStuff|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties3.ts ===
+
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+//
+// var v: interface1;
+// v.[|propName|];
+// v.doStuff();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties3.ts ===
+
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// propName|]: string;
+// }
+//
+// var v: interface1;
+// v./*FIND ALL REFS*/[|propName|];
+// v.doStuff();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties3.ts ===
+
+// interface interface1 extends interface1 {[|
+// doStuff|](): void;
+// propName: string;
+// }
+//
+// var v: interface1;
+// v.propName;
+// v./*FIND ALL REFS*/[|doStuff|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties4.baseline.jsonc
new file mode 100644
index 0000000000..1de2e1a9e6
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties4.baseline.jsonc
@@ -0,0 +1,56 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties4.ts ===
+
+// class class1 extends class1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+//
+// var c: class1;
+// c.[|doStuff|]();
+// c.propName;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties4.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+//
+// var c: class1;
+// c.doStuff();
+// c.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties4.ts ===
+
+// class class1 extends class1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var c: class1;
+// c./*FIND ALL REFS*/[|doStuff|]();
+// c.propName;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties4.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var c: class1;
+// c.doStuff();
+// c./*FIND ALL REFS*/[|propName|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties5.baseline.jsonc
new file mode 100644
index 0000000000..0034250864
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties5.baseline.jsonc
@@ -0,0 +1,34 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties5.ts ===
+
+// interface interface1 extends interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// propName: string;
+// }
+// interface interface2 extends interface1 {[|
+// doStuff|](): void;
+// propName: string;
+// }
+//
+// var v: interface1;
+// v.propName;
+// v.[|doStuff|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties5.ts ===
+
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+// interface interface2 extends interface1 {
+// doStuff(): void;[|
+// propName|]: string;
+// }
+//
+// var v: interface1;
+// v.[|propName|];
+// v.doStuff();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties6.baseline.jsonc
new file mode 100644
index 0000000000..7cddb66af5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties6.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties6.ts ===
+
+// class class1 extends class1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// }
+// class class2 extends class1 {[|
+// doStuff|]() { }
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties7.baseline.jsonc
new file mode 100644
index 0000000000..bfc10331b9
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties7.baseline.jsonc
@@ -0,0 +1,134 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {[|
+// /*FIND ALL REFS*/doStuff|](): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {[|
+// doStuff|]() { }
+// propName: string;
+// }
+// interface interface1 extends interface1 {[|
+// doStuff|](): void;
+// propName: string;
+// }
+// class class2 extends class1 implements interface1 {[|
+// /*FIND ALL REFS*/doStuff|]() { }
+// propName: string;
+// }
+//
+// var v: class2;
+// v.[|doStuff|]();
+// v.propName;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties7.ts ===
+
+// class class1 extends class1 {
+// doStuff() { }[|
+// propName|]: string;
+// }
+// interface interface1 extends interface1 {
+// doStuff(): void;[|
+// propName|]: string;
+// }
+// class class2 extends class1 implements interface1 {
+// doStuff() { }[|
+// /*FIND ALL REFS*/propName|]: string;
+// }
+//
+// var v: class2;
+// v.doStuff();
+// v.[|propName|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties8.baseline.jsonc
new file mode 100644
index 0000000000..656520908d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties8.baseline.jsonc
@@ -0,0 +1,30 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties8.ts ===
+
+// interface C extends D {[|
+// /*FIND ALL REFS*/propD|]: number;
+// }
+// interface D extends C {[|
+// propD|]: string;
+// propC: number;
+// }
+// var d: D;
+// d.[|propD|];
+// d.propC;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties8.ts ===
+
+// interface C extends D {
+// propD: number;
+// }
+// interface D extends C {
+// propD: string;[|
+// /*FIND ALL REFS*/propC|]: number;
+// }
+// var d: D;
+// d.propD;
+// d.[|propC|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties9.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties9.baseline.jsonc
new file mode 100644
index 0000000000..b08fb53d2f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForInheritedProperties9.baseline.jsonc
@@ -0,0 +1,43 @@
+// === findAllReferences ===
+// === /referencesForInheritedProperties9.ts ===
+
+// class D extends C {[|
+// /*FIND ALL REFS*/prop1|]: string;
+// }
+//
+// class C extends D {
+// // --- (line: 6) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties9.ts ===
+
+// class D extends C {
+// prop1: string;
+// }
+//
+// class C extends D {[|
+// /*FIND ALL REFS*/prop1|]: string;
+// }
+//
+// var c: C;
+// c.[|prop1|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForInheritedProperties9.ts ===
+
+// class D extends C {
+// prop1: string;
+// }
+//
+// class C extends D {[|
+// prop1|]: string;
+// }
+//
+// var c: C;
+// c./*FIND ALL REFS*/[|prop1|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel.baseline.jsonc
new file mode 100644
index 0000000000..09d268e6e1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel.baseline.jsonc
@@ -0,0 +1,62 @@
+// === findAllReferences ===
+// === /referencesForLabel.ts ===
+
+// /*FIND ALL REFS*/[|label|]: while (true) {
+// if (false) break[| label|];
+// if (true) continue[| label|];
+// }
+//
+// label: while (false) { }
+// var label = "label";
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel.ts ===
+
+// [|label|]: while (true) {
+// if (false) break /*FIND ALL REFS*/[| label|];
+// if (true) continue[| label|];
+// }
+//
+// label: while (false) { }
+// var label = "label";
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel.ts ===
+
+// [|label|]: while (true) {
+// if (false) break[| label|];
+// if (true) continue /*FIND ALL REFS*/[| label|];
+// }
+//
+// label: while (false) { }
+// var label = "label";
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel.ts ===
+
+// label: while (true) {
+// if (false) break label;
+// if (true) continue label;
+// }[|
+//
+// /*FIND ALL REFS*/label|]: while (false) { }
+// var label = "label";
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel2.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel2.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel3.baseline.jsonc
new file mode 100644
index 0000000000..6679b7164c
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel3.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+// === /referencesForLabel3.ts ===
+
+// /*FIND ALL REFS*/[|label|]: while (true) {
+// var label = "label";
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel4.baseline.jsonc
new file mode 100644
index 0000000000..9fb06c8f44
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel4.baseline.jsonc
@@ -0,0 +1,25 @@
+// === findAllReferences ===
+// === /referencesForLabel4.ts ===
+
+// /*FIND ALL REFS*/[|label|]: function foo(label) {
+// while (true) {
+// break[| label|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel4.ts ===
+
+// [|label|]: function foo(label) {
+// while (true) {
+// break /*FIND ALL REFS*/[| label|];
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel5.baseline.jsonc
new file mode 100644
index 0000000000..f41366162e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel5.baseline.jsonc
@@ -0,0 +1,91 @@
+// === findAllReferences ===
+// === /referencesForLabel5.ts ===
+
+// /*FIND ALL REFS*/[|label|]: while (true) {
+// if (false) break[| label|];
+// function blah() {
+// label: while (true) {
+// if (false) break label;
+// }
+// }
+// if (false) break[| label|];
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel5.ts ===
+
+// [|label|]: while (true) {
+// if (false) break /*FIND ALL REFS*/[| label|];
+// function blah() {
+// label: while (true) {
+// if (false) break label;
+// }
+// }
+// if (false) break[| label|];
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel5.ts ===
+
+// label: while (true) {
+// if (false) break label;
+// function blah() {[|
+// /*FIND ALL REFS*/label|]: while (true) {
+// if (false) break[| label|];
+// }
+// }
+// if (false) break label;
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel5.ts ===
+
+// label: while (true) {
+// if (false) break label;
+// function blah() {[|
+// label|]: while (true) {
+// if (false) break /*FIND ALL REFS*/[| label|];
+// }
+// }
+// if (false) break label;
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel5.ts ===
+
+// [|label|]: while (true) {
+// if (false) break[| label|];
+// function blah() {
+// label: while (true) {
+// if (false) break label;
+// }
+// }
+// if (false) break /*FIND ALL REFS*/[| label|];
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel6.baseline.jsonc
new file mode 100644
index 0000000000..2f0fb95d34
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForLabel6.baseline.jsonc
@@ -0,0 +1,34 @@
+// === findAllReferences ===
+// === /referencesForLabel6.ts ===
+
+// /*FIND ALL REFS*/[|labela|]: while (true) {
+// labelb: while (false) { break labelb; }
+// break labelc;
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel6.ts ===
+
+// labela: while (true) {[|
+// /*FIND ALL REFS*/labelb|]: while (false) { break[| labelb|]; }
+// break labelc;
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForLabel6.ts ===
+
+// labela: while (true) {[|
+// labelb: while (false) { break /*FIND ALL REFS*/|]: while (false) { break[| labelb|]; }
+// break labelc;
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations.baseline.jsonc
new file mode 100644
index 0000000000..b17e210ca3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations.baseline.jsonc
@@ -0,0 +1,125 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// interface /*FIND ALL REFS*/[| Foo|] {
+// }
+//
+// module Foo {
+// // --- (line: 5) skipped ---
+
+
+// --- (line: 8) skipped ---
+// }
+//
+// var f1: Foo.Bar;
+// var f2:[| Foo|];
+// Foo.bind(this);
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// interface Foo {
+// }
+//
+// module /*FIND ALL REFS*/[| Foo|] {
+// export interface Bar { }
+// }
+//
+// function Foo(): void {
+// }
+//
+// var f1:[| Foo|].Bar;
+// var f2: Foo;
+// Foo.bind(this);
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// --- (line: 4) skipped ---
+// export interface Bar { }
+// }
+//
+// function /*FIND ALL REFS*/[| Foo|](): void {
+// }
+//
+// var f1: Foo.Bar;
+// var f2: Foo;[|
+// Foo|].bind(this);
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// interface Foo {
+// }
+//
+// module[| Foo|] {
+// export interface Bar { }
+// }
+//
+// function Foo(): void {
+// }
+//
+// var f1: /*FIND ALL REFS*/[| Foo|].Bar;
+// var f2: Foo;
+// Foo.bind(this);
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// interface[| Foo|] {
+// }
+//
+// module Foo {
+// // --- (line: 5) skipped ---
+
+
+// --- (line: 8) skipped ---
+// }
+//
+// var f1: Foo.Bar;
+// var f2: /*FIND ALL REFS*/[| Foo|];
+// Foo.bind(this);
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations.ts ===
+
+// --- (line: 4) skipped ---
+// export interface Bar { }
+// }
+//
+// function[| Foo|](): void {
+// }
+//
+// var f1: Foo.Bar;
+// var f2: Foo;[|
+// /*FIND ALL REFS*/Foo|].bind(this);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations2.baseline.jsonc
new file mode 100644
index 0000000000..f8d8bbcc2f
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations2.baseline.jsonc
@@ -0,0 +1,46 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations2.ts ===
+
+// --- (line: 3) skipped ---
+//
+// function ATest() { }
+//
+// import /*FIND ALL REFS*/[| alias|] = ATest; // definition
+//
+// var a:[| alias|].Bar;[| // namespace
+// alias|].call(this); // value
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations2.ts ===
+
+// --- (line: 3) skipped ---
+//
+// function ATest() { }
+//
+// import[| alias|] = ATest; // definition
+//
+// var a: /*FIND ALL REFS*/[| alias|].Bar;[| // namespace
+// alias|].call(this); // value
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations2.ts ===
+
+// --- (line: 3) skipped ---
+//
+// function ATest() { }
+//
+// import[| alias|] = ATest; // definition
+//
+// var a:[| alias|].Bar;[| // namespace
+// /*FIND ALL REFS*/alias|].call(this); // value
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations3.baseline.jsonc
new file mode 100644
index 0000000000..e3d7f5b00a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations3.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /referencesForMergedDeclarations3.ts ===
+
+// class testClass {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module /*FIND ALL REFS*/[| testClass|] {
+// export interface Bar {
+//
+// }
+// }
+//
+// var c1: testClass;
+// var c2:[| testClass|].Bar;
+// testClass.staticMethod();
+// testClass.prototype.method();
+// testClass.bind(this);
+// new testClass();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations3.ts ===
+
+// class /*FIND ALL REFS*/[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+// // --- (line: 5) skipped ---
+
+
+// --- (line: 8) skipped ---
+// }
+// }
+//
+// var c1:[| testClass|];
+// var c2: testClass.Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);
+// new[| testClass|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations4.baseline.jsonc
new file mode 100644
index 0000000000..fc6ea58a92
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations4.baseline.jsonc
@@ -0,0 +1,240 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class /*FIND ALL REFS*/[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module /*FIND ALL REFS*/[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1: /*FIND ALL REFS*/[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2: /*FIND ALL REFS*/[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// /*FIND ALL REFS*/testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// /*FIND ALL REFS*/testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// /*FIND ALL REFS*/testClass|].bind(this);[|
+// testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// /*FIND ALL REFS*/testClass|].s;
+// new[| testClass|]();
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations4.ts ===
+
+// class[| testClass|] {
+// static staticMethod() { }
+// method() { }
+// }
+//
+// module[| testClass|] {
+// export interface Bar {
+//
+// }
+// export var s = 0;
+// }
+//
+// var c1:[| testClass|];
+// var c2:[| testClass|].Bar;[|
+// testClass|].staticMethod();[|
+// testClass|].prototype.method();[|
+// testClass|].bind(this);[|
+// testClass|].s;
+// new /*FIND ALL REFS*/[| testClass|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations5.baseline.jsonc
new file mode 100644
index 0000000000..00daaadada
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations5.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /referencesForMergedDeclarations5.ts ===
+
+// interface /*FIND ALL REFS*/[| Foo|] { }
+// module Foo { export interface Bar { } }
+// function Foo() { }
+//
+// export = Foo;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations5.ts ===
+
+// interface Foo { }
+// module /*FIND ALL REFS*/[| Foo|] { export interface Bar { } }
+// function Foo() { }
+//
+// export = Foo;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations5.ts ===
+
+// interface Foo { }
+// module Foo { export interface Bar { } }
+// function /*FIND ALL REFS*/[| Foo|]() { }
+//
+// export =[| Foo|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations5.ts ===
+
+// interface Foo { }
+// module Foo { export interface Bar { } }
+// function[| Foo|]() { }
+//
+// export = /*FIND ALL REFS*/[| Foo|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations6.baseline.jsonc
new file mode 100644
index 0000000000..99919e9393
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations6.baseline.jsonc
@@ -0,0 +1,33 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations6.ts ===
+
+// interface Foo { }
+// module /*FIND ALL REFS*/[| Foo|] {
+// export interface Bar { }
+// export module Bar { export interface Baz { } }
+// export function Bar() { }
+// }
+//
+// // module
+// import a1 =[| Foo|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations6.ts ===
+
+// interface Foo { }
+// module[| Foo|] {
+// export interface Bar { }
+// export module Bar { export interface Baz { } }
+// export function Bar() { }
+// }
+//
+// // module
+// import a1 = /*FIND ALL REFS*/[| Foo|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations7.baseline.jsonc
new file mode 100644
index 0000000000..2e180271ca
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations7.baseline.jsonc
@@ -0,0 +1,58 @@
+// === findAllReferences ===
+// === /referencesForMergedDeclarations7.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface /*FIND ALL REFS*/[| Bar|] { }
+// export module Bar { export interface Baz { } }
+// export function Bar() { }
+// }
+// // --- (line: 7) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations7.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface Bar { }
+// export module /*FIND ALL REFS*/[| Bar|] { export interface Baz { } }
+// export function Bar() { }
+// }
+//
+// // module, value and type
+// import a2 = Foo.[|Bar|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations7.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface Bar { }
+// export module Bar { export interface Baz { } }
+// export function /*FIND ALL REFS*/[| Bar|]() { }
+// }
+//
+// // module, value and type
+// import a2 = Foo.Bar;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations7.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface Bar { }
+// export module[| Bar|] { export interface Baz { } }
+// export function Bar() { }
+// }
+//
+// // module, value and type
+// import a2 = Foo./*FIND ALL REFS*/[|Bar|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations8.baseline.jsonc
new file mode 100644
index 0000000000..d0264584d1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForMergedDeclarations8.baseline.jsonc
@@ -0,0 +1,33 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations8.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface Bar { }
+// export module /*FIND ALL REFS*/[| Bar|] { export interface Baz { } }
+// export function Bar() { }
+// }
+//
+// // module
+// import a3 = Foo.[|Bar|].Baz;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForMergedDeclarations8.ts ===
+
+// interface Foo { }
+// module Foo {
+// export interface[| Bar|] { }
+// export module[| Bar|] { export interface Baz { } }
+// export function[| Bar|]() { }
+// }
+//
+// // module
+// import a3 = Foo./*FIND ALL REFS*/[|Bar|].Baz;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForModifiers.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForModifiers.baseline.jsonc
new file mode 100644
index 0000000000..dc724c350b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForModifiers.baseline.jsonc
@@ -0,0 +1,51 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNoContext.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNoContext.baseline.jsonc
new file mode 100644
index 0000000000..4b3b49b5b3
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNoContext.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNumericLiteralPropertyNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNumericLiteralPropertyNames.baseline.jsonc
new file mode 100644
index 0000000000..13e9ba9401
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForNumericLiteralPropertyNames.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+// === /referencesForNumericLiteralPropertyNames.ts ===
+
+// class Foo {
+// public /*FIND ALL REFS*/[| 12|]: any;
+// }
+//
+// var x: Foo;
+// x[[|12|]];
+// x = { "12": 0 };
+// x = { 12: 0 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForObjectLiteralProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForObjectLiteralProperties.baseline.jsonc
new file mode 100644
index 0000000000..1b722e46a8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForObjectLiteralProperties.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /referencesForObjectLiteralProperties.ts ===
+
+// var x = { /*FIND ALL REFS*/[| add|]: 0, b: "string" };
+// x[[|"add"|]];
+// x.[|add|];
+// var y = x;
+// y.[|add|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForObjectLiteralProperties.ts ===
+
+// var x = {[| add|]: 0, b: "string" };
+// x["/*FIND ALL REFS*/[|"add"|]];
+// x.[|add|];
+// var y = x;
+// y.[|add|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForObjectLiteralProperties.ts ===
+
+// var x = {[| add|]: 0, b: "string" };
+// x[[|"add"|]];
+// x./*FIND ALL REFS*/[|add|];
+// var y = x;
+// y.[|add|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForObjectLiteralProperties.ts ===
+
+// var x = {[| add|]: 0, b: "string" };
+// x[[|"add"|]];
+// x.[|add|];
+// var y = x;
+// y./*FIND ALL REFS*/[|add|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForOverrides.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForOverrides.baseline.jsonc
new file mode 100644
index 0000000000..69c860e2e4
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForOverrides.baseline.jsonc
@@ -0,0 +1,180 @@
+// === findAllReferences ===
+// === /referencesForOverrides.ts ===
+
+// module FindRef3 {
+// module SimpleClassTest {
+// export class Foo {
+// public /*FIND ALL REFS*/[| foo|](): void {
+// }
+// }
+// export class Bar extends Foo {
+// public[| foo|](): void {
+// }
+// }
+// }
+// // --- (line: 12) skipped ---
+
+
+// --- (line: 58) skipped ---
+//
+// function test() {
+// var x = new SimpleClassTest.Bar();
+// x.[|foo|]();
+//
+// var y: SimpleInterfaceTest.IBar = null;
+// y.ifoo();
+// // --- (line: 66) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForOverrides.ts ===
+
+// --- (line: 10) skipped ---
+// }
+//
+// module SimpleInterfaceTest {
+// export interface IFoo {[|
+// /*FIND ALL REFS*/ifoo|](): void;
+// }
+// export interface IBar extends IFoo {[|
+// ifoo|](): void;
+// }
+// }
+//
+// // --- (line: 22) skipped ---
+
+
+// --- (line: 61) skipped ---
+// x.foo();
+//
+// var y: SimpleInterfaceTest.IBar = null;
+// y.[|ifoo|]();
+//
+// var w: SimpleClassInterfaceTest.Bar = null;
+// w.icfoo();
+// // --- (line: 69) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForOverrides.ts ===
+
+// --- (line: 19) skipped ---
+// }
+//
+// module SimpleClassInterfaceTest {
+// export interface IFoo {[|
+// /*FIND ALL REFS*/icfoo|](): void;
+// }
+// export class Bar implements IFoo {
+// public[| icfoo|](): void {
+// }
+// }
+// }
+// // --- (line: 31) skipped ---
+
+
+// --- (line: 64) skipped ---
+// y.ifoo();
+//
+// var w: SimpleClassInterfaceTest.Bar = null;
+// w.[|icfoo|]();
+//
+// var z = new Test.BarBlah();
+// z.field = "";
+// // --- (line: 72) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForOverrides.ts ===
+
+// --- (line: 29) skipped ---
+// }
+//
+// module Test {
+// export interface IBase {[|
+// /*FIND ALL REFS*/field|]: string;
+// method(): void;
+// }
+//
+// export interface IBlah extends IBase {[|
+// field|]: string;
+// }
+//
+// export interface IBlah2 extends IBlah {[|
+// field|]: string;
+// }
+//
+// export interface IDerived extends IBlah2 {
+// method(): void;
+// }
+//
+// export class Bar implements IDerived {
+// public[| field|]: string;
+// public method(): void { }
+// }
+//
+// export class BarBlah extends Bar {
+// public[| field|]: string;
+// }
+// }
+//
+// // --- (line: 60) skipped ---
+
+
+// --- (line: 67) skipped ---
+// w.icfoo();
+//
+// var z = new Test.BarBlah();
+// z.[|field|] = "";
+// z.method();
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForOverrides.ts ===
+
+// --- (line: 30) skipped ---
+//
+// module Test {
+// export interface IBase {
+// field: string;[|
+// /*FIND ALL REFS*/method|](): void;
+// }
+//
+// export interface IBlah extends IBase {
+// // --- (line: 39) skipped ---
+
+
+// --- (line: 42) skipped ---
+// field: string;
+// }
+//
+// export interface IDerived extends IBlah2 {[|
+// method|](): void;
+// }
+//
+// export class Bar implements IDerived {
+// public field: string;
+// public[| method|](): void { }
+// }
+//
+// export class BarBlah extends Bar {
+// // --- (line: 56) skipped ---
+
+
+// --- (line: 68) skipped ---
+//
+// var z = new Test.BarBlah();
+// z.field = "";
+// z.[|method|]();
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForPropertiesOfGenericType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForPropertiesOfGenericType.baseline.jsonc
new file mode 100644
index 0000000000..52afb5b4fb
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForPropertiesOfGenericType.baseline.jsonc
@@ -0,0 +1,44 @@
+// === findAllReferences ===
+// === /referencesForPropertiesOfGenericType.ts ===
+
+// interface IFoo {[|
+// /*FIND ALL REFS*/doSomething|](v: T): T;
+// }
+//
+// var x: IFoo;
+// x.[|doSomething|]("ss");
+//
+// var y: IFoo;
+// y.[|doSomething|](12);
+
+
+
+
+// === findAllReferences ===
+// === /referencesForPropertiesOfGenericType.ts ===
+
+// interface IFoo {[|
+// doSomething|](v: T): T;
+// }
+//
+// var x: IFoo;
+// x./*FIND ALL REFS*/[|doSomething|]("ss");
+//
+// var y: IFoo;
+// y.[|doSomething|](12);
+
+
+
+
+// === findAllReferences ===
+// === /referencesForPropertiesOfGenericType.ts ===
+
+// interface IFoo {[|
+// doSomething|](v: T): T;
+// }
+//
+// var x: IFoo;
+// x.[|doSomething|]("ss");
+//
+// var y: IFoo;
+// y./*FIND ALL REFS*/[|doSomething|](12);
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStatic.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStatic.baseline.jsonc
new file mode 100644
index 0000000000..94d16cef9d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStatic.baseline.jsonc
@@ -0,0 +1,246 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static /*FIND ALL REFS*/[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo./*FIND ALL REFS*/[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo./*FIND ALL REFS*/[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo./*FIND ALL REFS*/[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo./*FIND ALL REFS*/[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo./*FIND ALL REFS*/[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo./*FIND ALL REFS*/[|n|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesOnStatic_1.ts ===
+
+// var n = 43;
+//
+// class foo {
+// static[| n|] = '';
+//
+// public bar() {
+// foo.[|n|] = "'";
+// if(foo.[|n|]) {
+// var x = foo.[|n|];
+// }
+// }
+// }
+//
+// class foo2 {
+// private x = foo.[|n|];
+// constructor() {
+// foo.[|n|] = x;
+// }
+//
+// function b(n) {
+// n = foo.[|n|];
+// }
+// }
+
+
+// === /referencesOnStatic_2.ts ===
+
+// var q = foo./*FIND ALL REFS*/[|n|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStaticsAndMembersWithSameNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStaticsAndMembersWithSameNames.baseline.jsonc
new file mode 100644
index 0000000000..914c40aba7
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStaticsAndMembersWithSameNames.baseline.jsonc
@@ -0,0 +1,217 @@
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// module FindRef4 {
+// module MixedStaticsClassTest {
+// export class Foo {[|
+// /*FIND ALL REFS*/bar|]: Foo;
+// static bar: Foo;
+//
+// public foo(): void {
+// // --- (line: 8) skipped ---
+
+
+// --- (line: 14) skipped ---
+// // instance function
+// var x = new MixedStaticsClassTest.Foo();
+// x.foo();
+// x.[|bar|];
+//
+// // static function
+// MixedStaticsClassTest.Foo.foo();
+// // --- (line: 22) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// module FindRef4 {
+// module MixedStaticsClassTest {
+// export class Foo {
+// bar: Foo;
+// static /*FIND ALL REFS*/[| bar|]: Foo;
+//
+// public foo(): void {
+// }
+// // --- (line: 9) skipped ---
+
+
+// --- (line: 18) skipped ---
+//
+// // static function
+// MixedStaticsClassTest.Foo.foo();
+// MixedStaticsClassTest.Foo.[|bar|];
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// --- (line: 3) skipped ---
+// bar: Foo;
+// static bar: Foo;
+//
+// public /*FIND ALL REFS*/[| foo|](): void {
+// }
+// public static foo(): void {
+// }
+// }
+// }
+//
+// function test() {
+// // instance function
+// var x = new MixedStaticsClassTest.Foo();
+// x.[|foo|]();
+// x.bar;
+//
+// // static function
+// // --- (line: 21) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// --- (line: 5) skipped ---
+//
+// public foo(): void {
+// }
+// public static /*FIND ALL REFS*/[| foo|](): void {
+// }
+// }
+// }
+// // --- (line: 13) skipped ---
+
+
+// --- (line: 17) skipped ---
+// x.bar;
+//
+// // static function
+// MixedStaticsClassTest.Foo.[|foo|]();
+// MixedStaticsClassTest.Foo.bar;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// --- (line: 3) skipped ---
+// bar: Foo;
+// static bar: Foo;
+//
+// public[| foo|](): void {
+// }
+// public static foo(): void {
+// }
+// }
+// }
+//
+// function test() {
+// // instance function
+// var x = new MixedStaticsClassTest.Foo();
+// x./*FIND ALL REFS*/[|foo|]();
+// x.bar;
+//
+// // static function
+// // --- (line: 21) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// module FindRef4 {
+// module MixedStaticsClassTest {
+// export class Foo {[|
+// bar|]: Foo;
+// static bar: Foo;
+//
+// public foo(): void {
+// // --- (line: 8) skipped ---
+
+
+// --- (line: 14) skipped ---
+// // instance function
+// var x = new MixedStaticsClassTest.Foo();
+// x.foo();
+// x./*FIND ALL REFS*/[|bar|];
+//
+// // static function
+// MixedStaticsClassTest.Foo.foo();
+// // --- (line: 22) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// --- (line: 5) skipped ---
+//
+// public foo(): void {
+// }
+// public static[| foo|](): void {
+// }
+// }
+// }
+// // --- (line: 13) skipped ---
+
+
+// --- (line: 17) skipped ---
+// x.bar;
+//
+// // static function
+// MixedStaticsClassTest.Foo./*FIND ALL REFS*/[|foo|]();
+// MixedStaticsClassTest.Foo.bar;
+// }
+// }
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStaticsAndMembersWithSameNames.ts ===
+
+// module FindRef4 {
+// module MixedStaticsClassTest {
+// export class Foo {
+// bar: Foo;
+// static[| bar|]: Foo;
+//
+// public foo(): void {
+// }
+// // --- (line: 9) skipped ---
+
+
+// --- (line: 18) skipped ---
+//
+// // static function
+// MixedStaticsClassTest.Foo.foo();
+// MixedStaticsClassTest.Foo./*FIND ALL REFS*/[|bar|];
+// }
+// }
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames.baseline.jsonc
new file mode 100644
index 0000000000..2ad311474a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames.ts ===
+
+// class Foo {
+// public "/*FIND ALL REFS*/[| "ss"|]: any;
+// }
+//
+// var x: Foo;
+// x.[|ss|];
+// x[[|"ss"|]];
+// x = { "ss": 0 };
+// x = { ss: 0 };
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames2.baseline.jsonc
new file mode 100644
index 0000000000..033f8de8ee
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames2.baseline.jsonc
@@ -0,0 +1,35 @@
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames2.ts ===
+
+// class Foo {[|
+// /*FIND ALL REFS*/"blah"|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|blah|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames2.ts ===
+
+// class Foo {[|
+// "/*FIND ALL REFS*/blah"|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x.[|blah|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames2.ts ===
+
+// class Foo {[|
+// "blah"|]() { return 0; }
+// }
+//
+// var x: Foo;
+// x./*FIND ALL REFS*/[|blah|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames3.baseline.jsonc
new file mode 100644
index 0000000000..5e70ce6c41
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames3.baseline.jsonc
@@ -0,0 +1,48 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames3.ts ===
+
+// class Foo2 {
+// get "/*FIND ALL REFS*/[| "42"|]() { return 0; }
+// set[| 42|](n) { }
+// }
+//
+// var y: Foo2;
+// y[[|42|]];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames3.ts ===
+
+// class Foo2 {
+// get[| "42"|]() { return 0; }
+// set /*FIND ALL REFS*/[| 42|](n) { }
+// }
+//
+// var y: Foo2;
+// y[[|42|]];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames3.ts ===
+
+// class Foo2 {
+// get[| "42"|]() { return 0; }
+// set[| 42|](n) { }
+// }
+//
+// var y: Foo2;
+// y[/*FIND ALL REFS*/[|42|]];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames4.baseline.jsonc
new file mode 100644
index 0000000000..554d2a2b83
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames4.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames4.ts ===
+
+// var x = { "/*FIND ALL REFS*/[| "someProperty"|]: 0 }
+// x[[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames4.ts ===
+
+// var x = {[| "someProperty"|]: 0 }
+// x[/*FIND ALL REFS*/[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames5.baseline.jsonc
new file mode 100644
index 0000000000..6000d5ccb5
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames5.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames5.ts ===
+
+// var x = { "/*FIND ALL REFS*/[| "someProperty"|]: 0 }
+// x[[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames5.ts ===
+
+// var x = {[| "someProperty"|]: 0 }
+// x["/*FIND ALL REFS*/[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames6.baseline.jsonc
new file mode 100644
index 0000000000..2e81a9530a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames6.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames6.ts ===
+
+// const x = function () { return 111111; }
+// x./*FIND ALL REFS*/[|someProperty|] = 5;
+// x[[|"someProperty"|]] = 3;
+
+
+
+
+// === findAllReferences ===
+// === /referencesForStringLiteralPropertyNames6.ts ===
+
+// const x = function () { return 111111; }
+// x.[|someProperty|] = 5;
+// x["/*FIND ALL REFS*/[|"someProperty"|]] = 3;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames7.baseline.jsonc
new file mode 100644
index 0000000000..d86ba2a43d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForStringLiteralPropertyNames7.baseline.jsonc
@@ -0,0 +1,16 @@
+// === findAllReferences ===
+// === /foo.js ===
+
+// var x = { "/*FIND ALL REFS*/[| "someProperty"|]: 0 }
+// x[[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
+
+
+
+
+// === findAllReferences ===
+// === /foo.js ===
+
+// var x = {[| "someProperty"|]: 0 }
+// x["/*FIND ALL REFS*/[|"someProperty"|]] = 3;
+// x.[|someProperty|] = 5;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForTypeKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForTypeKeywords.baseline.jsonc
new file mode 100644
index 0000000000..460a47eacf
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForTypeKeywords.baseline.jsonc
@@ -0,0 +1,51 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForTypeKeywords.ts ===
+
+// interface I {}
+// function f() {}
+// type A1 = T extends U ? 1 : 0;
+// type A2 = T extends /*FIND ALL REFS*/[| infer|] U ? 1 : 0;
+// type A3 = { [P in keyof T]: 1 };
+// type A4 = keyof T;
+// type A5 = readonly T[];
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /referencesForTypeKeywords.ts ===
+
+// interface I {}
+// function f() {}
+// type A1 = T extends U ? 1 : 0;
+// type A2 = T extends infer U ? 1 : 0;
+// type A3 = { [P in[| keyof|] T]: 1 };
+// type A4 = /*FIND ALL REFS*/[| keyof|] T;
+// type A5 = readonly T[];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForTypeKeywords.ts ===
+
+// --- (line: 3) skipped ---
+// type A2 = T extends infer U ? 1 : 0;
+// type A3 = { [P in keyof T]: 1 };
+// type A4 = keyof T;
+// type A5 = /*FIND ALL REFS*/[| readonly|] T[];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesForUnionProperties.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForUnionProperties.baseline.jsonc
new file mode 100644
index 0000000000..3cc682251e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesForUnionProperties.baseline.jsonc
@@ -0,0 +1,72 @@
+// === findAllReferences ===
+// === /referencesForUnionProperties.ts ===
+
+// interface One {
+// common: { /*FIND ALL REFS*/[| a|]: number; };
+// }
+//
+// interface Base {
+// // --- (line: 6) skipped ---
+
+
+// --- (line: 17) skipped ---
+//
+// var x : One | Two;
+//
+// x.common.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForUnionProperties.ts ===
+
+// interface One {
+// common: { a: number; };
+// }
+//
+// interface Base {[|
+// /*FIND ALL REFS*/a|]: string;
+// b: string;
+// }
+//
+// interface HasAOrB extends Base {[|
+// a|]: string;
+// b: string;
+// }
+//
+// interface Two {
+// common: HasAOrB;
+// }
+//
+// var x : One | Two;
+//
+// x.common.[|a|];
+
+
+
+
+// === findAllReferences ===
+// === /referencesForUnionProperties.ts ===
+
+// interface One {
+// common: {[| a|]: number; };
+// }
+//
+// interface Base {[|
+// a|]: string;
+// b: string;
+// }
+//
+// interface HasAOrB extends Base {[|
+// a|]: string;
+// b: string;
+// }
+//
+// interface Two {
+// common: HasAOrB;
+// }
+//
+// var x : One | Two;
+//
+// x.common./*FIND ALL REFS*/[|a|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesInConfiguredProject.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInConfiguredProject.baseline.jsonc
new file mode 100644
index 0000000000..11cf10cc16
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInConfiguredProject.baseline.jsonc
@@ -0,0 +1,11 @@
+// === findAllReferences ===
+// === /home/src/workspaces/project/referencesForGlobals_1.ts ===
+
+// class[| globalClass|] {
+// public f() { }
+// }
+
+
+// === /home/src/workspaces/project/referencesForGlobals_2.ts ===
+
+// var c = /*FIND ALL REFS*/[| globalClass|]();
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesInEmptyFileWithMultipleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInEmptyFileWithMultipleProjects.baseline.jsonc
new file mode 100644
index 0000000000..7130888416
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInEmptyFileWithMultipleProjects.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesInStringLiteralValueWithMultipleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInStringLiteralValueWithMultipleProjects.baseline.jsonc
new file mode 100644
index 0000000000..7130888416
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesInStringLiteralValueWithMultipleProjects.baseline.jsonc
@@ -0,0 +1,6 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesToNonPropertyNameStringLiteral.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesToNonPropertyNameStringLiteral.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesToNonPropertyNameStringLiteral.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/ReferencesToStringLiteralValue.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/ReferencesToStringLiteralValue.baseline.jsonc
new file mode 100644
index 0000000000..a2f83f7bb8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/ReferencesToStringLiteralValue.baseline.jsonc
@@ -0,0 +1 @@
+// === findAllReferences ===
diff --git a/testdata/baselines/reference/fourslash/findAllRef/RemoteGetReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/RemoteGetReferences.baseline.jsonc
new file mode 100644
index 0000000000..2ed1aa2e32
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/RemoteGetReferences.baseline.jsonc
@@ -0,0 +1,1251 @@
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest: /*FIND ALL REFS*/[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new remotefooCls(remoteglobalVar);
+// // --- (line: 90) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 85) skipped ---
+// var remoteclsTest: remotefooCls;
+//
+// //Arguments
+// remoteclsTest = new remotefooCls([|remoteglobalVar|]);
+// remotefoo([|remoteglobalVar|]);
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;
+// remotemodTest.remotemodVar++;[|
+// remoteglobalVar|] =[| remoteglobalVar|] +[| remoteglobalVar|];[|
+//
+// //ETC - Other cases
+// remoteglobalVar|] = 3;
+//
+// //Find References misses method param
+// var
+// // --- (line: 102) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var /*FIND ALL REFS*/[| remoteglobalVar|]: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {[|
+// //Increments
+// remoteglobalVar|]++;
+// this.remoteclsVar++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;[|
+// remoteglobalVar|]++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+//
+// //Return
+// return remotex++;
+// }
+//
+// module remotemodTest {
+// //Declare
+// export var remotemodVar: number;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// static remoteboo = remotefoo;
+// }
+//
+// function remotetestFn(){
+// static remoteboo = remotefoo;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+// }
+// // --- (line: 53) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest:[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new[| remotefooCls|](remoteglobalVar);
+// remotefoo(remoteglobalVar);[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class /*FIND ALL REFS*/[| remotefooCls|] {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// }
+//
+// function remotefoo(remotex: number) {
+// //Declare
+// var remotefnVar = 1;[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 33) skipped ---
+// export var remotemodVar: number;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 45) skipped ---
+// static remoteboo = remotefoo;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {[|
+// //Declare
+// /*FIND ALL REFS*/remoteclsVar|] = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.[|remoteclsVar|]++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 89) skipped ---
+// remotefoo(remoteglobalVar);
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static /*FIND ALL REFS*/[| remoteclsSVar|] = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// // --- (line: 16) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 34) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 46) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 85) skipped ---
+// var remoteclsTest: remotefooCls;
+//
+// //Arguments
+// remoteclsTest = new remotefooCls([|remoteglobalVar|]);
+// remotefoo([|remoteglobalVar|]);
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;
+// remotemodTest.remotemodVar++;[|
+// remoteglobalVar|] =[| remoteglobalVar|] +[| remoteglobalVar|];[|
+//
+// //ETC - Other cases
+// remoteglobalVar|] = 3;
+//
+// //Find References misses method param
+// var
+// // --- (line: 102) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var[| remoteglobalVar|]: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {[|
+// //Increments
+// /*FIND ALL REFS*/remoteglobalVar|]++;
+// this.remoteclsVar++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;[|
+// remoteglobalVar|]++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+//
+// //Return
+// return remotex++;
+// }
+//
+// module remotemodTest {
+// //Declare
+// export var remotemodVar: number;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// static remoteboo = remotefoo;
+// }
+//
+// function remotetestFn(){
+// static remoteboo = remotefoo;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+// }
+// // --- (line: 53) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {[|
+// //Declare
+// remoteclsVar|] = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this./*FIND ALL REFS*/[|remoteclsVar|]++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// // --- (line: 15) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest:[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new[| remotefooCls|](remoteglobalVar);
+// remotefoo(remoteglobalVar);[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class[| remotefooCls|] {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;[|
+// /*FIND ALL REFS*/remotefooCls|].remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// }
+//
+// function remotefoo(remotex: number) {
+// //Declare
+// var remotefnVar = 1;[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 33) skipped ---
+// export var remotemodVar: number;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 45) skipped ---
+// static remoteboo = remotefoo;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 89) skipped ---
+// remotefoo(remoteglobalVar);
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static[| remoteclsSVar|] = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;
+// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// // --- (line: 16) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 34) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 46) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest:[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new[| remotefooCls|](remoteglobalVar);
+// remotefoo(remoteglobalVar);[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class[| remotefooCls|] {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// }
+//
+// function remotefoo(remotex: number) {
+// //Declare
+// var remotefnVar = 1;[|
+//
+// //Increments
+// /*FIND ALL REFS*/remotefooCls|].remoteclsSVar++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 33) skipped ---
+// export var remotemodVar: number;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 45) skipped ---
+// static remoteboo = remotefoo;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 89) skipped ---
+// remotefoo(remoteglobalVar);
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static[| remoteclsSVar|] = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// // --- (line: 16) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 34) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 46) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 85) skipped ---
+// var remoteclsTest: remotefooCls;
+//
+// //Arguments
+// remoteclsTest = new remotefooCls([|remoteglobalVar|]);
+// remotefoo([|remoteglobalVar|]);
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;
+// remotemodTest.remotemodVar++;[|
+// remoteglobalVar|] =[| remoteglobalVar|] +[| remoteglobalVar|];[|
+//
+// //ETC - Other cases
+// remoteglobalVar|] = 3;
+//
+// //Find References misses method param
+// var
+// // --- (line: 102) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var[| remoteglobalVar|]: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {[|
+// //Increments
+// remoteglobalVar|]++;
+// this.remoteclsVar++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;[|
+// /*FIND ALL REFS*/remoteglobalVar|]++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+//
+// //Return
+// return remotex++;
+// }
+//
+// module remotemodTest {
+// //Declare
+// export var remotemodVar: number;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// static remoteboo = remotefoo;
+// }
+//
+// function remotetestFn(){
+// static remoteboo = remotefoo;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+// }
+// // --- (line: 53) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 85) skipped ---
+// var remoteclsTest: remotefooCls;
+//
+// //Arguments
+// remoteclsTest = new remotefooCls([|remoteglobalVar|]);
+// remotefoo([|remoteglobalVar|]);
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;
+// remotemodTest.remotemodVar++;[|
+// remoteglobalVar|] =[| remoteglobalVar|] +[| remoteglobalVar|];[|
+//
+// //ETC - Other cases
+// remoteglobalVar|] = 3;
+//
+// //Find References misses method param
+// var
+// // --- (line: 102) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var[| remoteglobalVar|]: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {[|
+// //Increments
+// remoteglobalVar|]++;
+// this.remoteclsVar++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;[|
+// remoteglobalVar|]++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+//
+// //Return
+// return remotex++;
+// }
+//
+// module remotemodTest {
+// //Declare
+// export var remotemodVar: number;[|
+//
+// //Increments
+// /*FIND ALL REFS*/remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// static remoteboo = remotefoo;
+// }
+//
+// function remotetestFn(){
+// static remoteboo = remotefoo;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+// }
+// // --- (line: 53) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest:[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new[| remotefooCls|](remoteglobalVar);
+// remotefoo(remoteglobalVar);[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class[| remotefooCls|] {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// }
+//
+// function remotefoo(remotex: number) {
+// //Declare
+// var remotefnVar = 1;[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 33) skipped ---
+// export var remotemodVar: number;
+//
+// //Increments
+// remoteglobalVar++;[|
+// /*FIND ALL REFS*/remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 45) skipped ---
+// static remoteboo = remotefoo;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 89) skipped ---
+// remotefoo(remoteglobalVar);
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static[| remoteclsSVar|] = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// // --- (line: 16) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 34) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 46) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 85) skipped ---
+// var remoteclsTest: remotefooCls;
+//
+// //Arguments
+// remoteclsTest = new remotefooCls([|remoteglobalVar|]);
+// remotefoo([|remoteglobalVar|]);
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;
+// remotemodTest.remotemodVar++;[|
+// remoteglobalVar|] =[| remoteglobalVar|] +[| remoteglobalVar|];[|
+//
+// //ETC - Other cases
+// remoteglobalVar|] = 3;
+//
+// //Find References misses method param
+// var
+// // --- (line: 102) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var[| remoteglobalVar|]: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {[|
+// //Increments
+// remoteglobalVar|]++;
+// this.remoteclsVar++;
+// remotefooCls.remoteclsSVar++;
+// this.remoteclsParam++;
+// // --- (line: 14) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.remoteclsSVar++;[|
+// remoteglobalVar|]++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+//
+// //Return
+// return remotex++;
+// }
+//
+// module remotemodTest {
+// //Declare
+// export var remotemodVar: number;[|
+//
+// //Increments
+// remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// static remoteboo = remotefoo;
+// }
+//
+// function remotetestFn(){
+// static remoteboo = remotefoo;[|
+//
+// //Increments
+// /*FIND ALL REFS*/remoteglobalVar|]++;
+// remotefooCls.remoteclsSVar++;
+// remotemodVar++;
+// }
+// // --- (line: 53) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 82) skipped ---
+//
+// //Remotes
+// //Type test
+// var remoteclsTest:[| remotefooCls|];
+//
+// //Arguments
+// remoteclsTest = new[| remotefooCls|](remoteglobalVar);
+// remotefoo(remoteglobalVar);[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class[| remotefooCls|] {
+// //Declare
+// remoteclsVar = 1;
+// static remoteclsSVar = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// }
+//
+// function remotefoo(remotex: number) {
+// //Declare
+// var remotefnVar = 1;[|
+//
+// //Increments
+// remotefooCls|].remoteclsSVar++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 33) skipped ---
+// export var remotemodVar: number;
+//
+// //Increments
+// remoteglobalVar++;[|
+// remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 45) skipped ---
+// static remoteboo = remotefoo;
+//
+// //Increments
+// remoteglobalVar++;[|
+// /*FIND ALL REFS*/remotefooCls|].remoteclsSVar++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
+
+
+
+
+// === findAllReferences ===
+// === /remoteGetReferences_1.ts ===
+
+// --- (line: 89) skipped ---
+// remotefoo(remoteglobalVar);
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodTest.remotemodVar++;
+// remoteglobalVar = remoteglobalVar + remoteglobalVar;
+//
+// // --- (line: 97) skipped ---
+
+
+// === /remoteGetReferences_2.ts ===
+
+// var remoteglobalVar: number = 2;
+//
+// class remotefooCls {
+// //Declare
+// remoteclsVar = 1;
+// static[| remoteclsSVar|] = 1;
+//
+// constructor(public remoteclsParam: number) {
+// //Increments
+// remoteglobalVar++;
+// this.remoteclsVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// this.remoteclsParam++;
+// remotemodTest.remotemodVar++;
+// }
+// // --- (line: 16) skipped ---
+
+
+// --- (line: 19) skipped ---
+// var remotefnVar = 1;
+//
+// //Increments
+// remotefooCls.[|remoteclsSVar|]++;
+// remoteglobalVar++;
+// remotemodTest.remotemodVar++;
+// remotefnVar++;
+// // --- (line: 27) skipped ---
+
+
+// --- (line: 34) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls.[|remoteclsSVar|]++;
+// remotemodVar++;
+//
+// class remotetestCls {
+// // --- (line: 42) skipped ---
+
+
+// --- (line: 46) skipped ---
+//
+// //Increments
+// remoteglobalVar++;
+// remotefooCls./*FIND ALL REFS*/[|remoteclsSVar|]++;
+// remotemodVar++;
+// }
+//
+// // --- (line: 54) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports02.baseline.jsonc
new file mode 100644
index 0000000000..2a0dbd0bf6
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports02.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// module.exports = class /*FIND ALL REFS*/[| A|] {}
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// const /*FIND ALL REFS*/[| A|] = require("./a");
diff --git a/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports03.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports03.baseline.jsonc
new file mode 100644
index 0000000000..3c9886a36a
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/RenameJsExports03.baseline.jsonc
@@ -0,0 +1,36 @@
+// === findAllReferences ===
+// === /a.js ===
+
+// class /*FIND ALL REFS*/[| A|] {
+// constructor() { }
+// }
+// module.exports =[| A|];
+
+
+
+
+// === findAllReferences ===
+// === /a.js ===
+
+// class[| A|] {
+// /*FIND ALL REFS*/constructor() { }
+// }
+// module.exports =[| A|];
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// const /*FIND ALL REFS*/[| A|] = require("./a");
+// new[| A|];
+
+
+
+
+// === findAllReferences ===
+// === /b.js ===
+
+// const[| A|] = require("./a");
+// new /*FIND ALL REFS*/[| A|];
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences1.baseline.jsonc
new file mode 100644
index 0000000000..f3309371d8
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences1.baseline.jsonc
@@ -0,0 +1,37 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// declare module JSX {
+// interface Element { }
+// interface IntrinsicElements {[|
+// /*FIND ALL REFS*/div|]: {
+// name?: string;
+// isOpen?: boolean;
+// };
+// span: { n: string; };
+// }
+// }
+// var x = <[|div|] />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// declare module JSX {
+// interface Element { }
+// interface IntrinsicElements {[|
+// div|]: {
+// name?: string;
+// isOpen?: boolean;
+// };
+// span: { n: string; };
+// }
+// }
+// var x = *FIND ALL REFS*/[|div|] />;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences10.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences10.baseline.jsonc
new file mode 100644
index 0000000000..6f419cb815
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences10.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 7) skipped ---
+// children?: string;
+// className?: string;
+// }
+// interface ButtonProps extends ClickableProps {[|
+// /*FIND ALL REFS*/onClick|](event?: React.MouseEvent): void;
+// }
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// // --- (line: 16) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences11.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences11.baseline.jsonc
new file mode 100644
index 0000000000..297eaf314e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences11.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 16) skipped ---
+// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+// declare function MainButton(linkProps: LinkProps): JSX.Element;
+// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+// let opt = ;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences2.baseline.jsonc
new file mode 100644
index 0000000000..490a011b54
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences2.baseline.jsonc
@@ -0,0 +1,12 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// declare module JSX {
+// interface Element { }
+// interface IntrinsicElements {
+// div: {[|
+// /*FIND ALL REFS*/name|]?: string;
+// isOpen?: boolean;
+// };
+// span: { n: string; };
+// // --- (line: 9) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences3.baseline.jsonc
new file mode 100644
index 0000000000..50126b88ec
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences3.baseline.jsonc
@@ -0,0 +1,14 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 4) skipped ---
+// interface ElementAttributesProperty { props }
+// }
+// class MyClass {
+// props: {[|
+// /*FIND ALL REFS*/name|]?: string;
+// size?: number;
+// }
+//
+//
+// var x = ;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences4.baseline.jsonc
new file mode 100644
index 0000000000..4b39e5b74d
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences4.baseline.jsonc
@@ -0,0 +1,63 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 3) skipped ---
+// }
+// interface ElementAttributesProperty { props }
+// }
+// class /*FIND ALL REFS*/[| MyClass|] {
+// props: {
+// name?: string;
+// size?: number;
+// }
+//
+//
+// var x = <[|MyClass|] name='hello'>[|MyClass|]>;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 3) skipped ---
+// }
+// interface ElementAttributesProperty { props }
+// }
+// class[| MyClass|] {
+// props: {
+// name?: string;
+// size?: number;
+// }
+//
+//
+// var x = *FIND ALL REFS*/[|MyClass|] name='hello'>[|MyClass|]>;
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 3) skipped ---
+// }
+// interface ElementAttributesProperty { props }
+// }
+// class[| MyClass|] {
+// props: {
+// name?: string;
+// size?: number;
+// }
+//
+//
+// var x = /*FIND ALL REFS*/[|MyClass|] name='hello'>[|MyClass|]>;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences5.baseline.jsonc
new file mode 100644
index 0000000000..d31a7aef93
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences5.baseline.jsonc
@@ -0,0 +1,128 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function /*FIND ALL REFS*/[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = <[|Opt|] />;
+// let opt1 = <[|Opt|] propx={100} propString />;
+// let opt2 = <[|Opt|] propx={100} optional/>;
+// let opt3 = <[|Opt|] wrong />;
+// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = *FIND ALL REFS*/[|Opt|] />;
+// let opt1 = <[|Opt|] propx={100} propString />;
+// let opt2 = <[|Opt|] propx={100} optional/>;
+// let opt3 = <[|Opt|] wrong />;
+// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = <[|Opt|] />;
+// let opt1 = *FIND ALL REFS*/[|Opt|] propx={100} propString />;
+// let opt2 = <[|Opt|] propx={100} optional/>;
+// let opt3 = <[|Opt|] wrong />;
+// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = <[|Opt|] />;
+// let opt1 = <[|Opt|] propx={100} propString />;
+// let opt2 = *FIND ALL REFS*/[|Opt|] propx={100} optional/>;
+// let opt3 = <[|Opt|] wrong />;
+// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = <[|Opt|] />;
+// let opt1 = <[|Opt|] propx={100} propString />;
+// let opt2 = <[|Opt|] propx={100} optional/>;
+// let opt3 = *FIND ALL REFS*/[|Opt|] wrong />;
+// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// propString: string
+// optional?: boolean
+// }
+// declare function[| Opt|](attributes: OptionPropBag): JSX.Element;
+// let opt = <[|Opt|] />;
+// let opt1 = <[|Opt|] propx={100} propString />;
+// let opt2 = <[|Opt|] propx={100} optional/>;
+// let opt3 = <[|Opt|] wrong />;
+// let opt4 = *FIND ALL REFS*/[|Opt|] propx={100} propString="hi" />;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences6.baseline.jsonc
new file mode 100644
index 0000000000..49d089d753
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences6.baseline.jsonc
@@ -0,0 +1,8 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 9) skipped ---
+// optional?: boolean
+// }
+// declare function Opt(attributes: OptionPropBag): JSX.Element;
+// let opt = ;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences7.baseline.jsonc
new file mode 100644
index 0000000000..5441bef6b1
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences7.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 3) skipped ---
+// }
+// interface ElementAttributesProperty { props; }
+// }
+// interface OptionPropBag {[|
+// /*FIND ALL REFS*/propx|]: number
+// propString: string
+// optional?: boolean
+// }
+// // --- (line: 12) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences8.baseline.jsonc
new file mode 100644
index 0000000000..66f674e81e
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences8.baseline.jsonc
@@ -0,0 +1,221 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function /*FIND ALL REFS*/[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function /*FIND ALL REFS*/[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function /*FIND ALL REFS*/[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = *FIND ALL REFS*/[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = *FIND ALL REFS*/[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = *FIND ALL REFS*/[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = *FIND ALL REFS*/[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = *FIND ALL REFS*/[|MainButton|] goTo="goTo" />;
+// let opt = <[|MainButton|] wrong />;
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 13) skipped ---
+// interface LinkProps extends ClickableProps {
+// goTo: string;
+// }
+// declare function[| MainButton|](buttonProps: ButtonProps): JSX.Element;
+// declare function[| MainButton|](linkProps: LinkProps): JSX.Element;
+// declare function[| MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+// let opt = <[|MainButton|] />;
+// let opt = <[|MainButton|] children="chidlren" />;
+// let opt = <[|MainButton|] onClick={()=>{}} />;
+// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+// let opt = <[|MainButton|] goTo="goTo" />;
+// let opt = *FIND ALL REFS*/[|MainButton|] wrong />;
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences9.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences9.baseline.jsonc
new file mode 100644
index 0000000000..c77bf08c09
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferences9.baseline.jsonc
@@ -0,0 +1,13 @@
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 10) skipped ---
+// interface ButtonProps extends ClickableProps {
+// onClick(event?: React.MouseEvent): void;
+// }
+// interface LinkProps extends ClickableProps {[|
+// /*FIND ALL REFS*/goTo|]: string;
+// }
+// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+// declare function MainButton(linkProps: LinkProps): JSX.Element;
+// // --- (line: 19) skipped ---
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType1.baseline.jsonc
new file mode 100644
index 0000000000..22a475f103
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType1.baseline.jsonc
@@ -0,0 +1,32 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 9) skipped ---
+// function SFC2(prop: { x: boolean }) {
+// return World
;
+// }
+// var /*FIND ALL REFS*/[| SFCComp|] = SFC1 || SFC2;
+// <[|SFCComp|] x={ "hi" } />
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 9) skipped ---
+// function SFC2(prop: { x: boolean }) {
+// return World
;
+// }
+// var[| SFCComp|] = SFC1 || SFC2;
+// *FIND ALL REFS*/[|SFCComp|] x={ "hi" } />
diff --git a/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType2.baseline.jsonc
new file mode 100644
index 0000000000..4015993a1b
--- /dev/null
+++ b/testdata/baselines/reference/fourslash/findAllRef/TsxFindAllReferencesUnionElementType2.baseline.jsonc
@@ -0,0 +1,32 @@
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// }
+// private method() { }
+// }
+// var /*FIND ALL REFS*/[| RCComp|] = RC1 || RC2;
+// <[|RCComp|] />
+
+
+
+
+// === findAllReferences ===
+
+
+
+
+// === findAllReferences ===
+// === /file.tsx ===
+
+// --- (line: 8) skipped ---
+// }
+// private method() { }
+// }
+// var[| RCComp|] = RC1 || RC2;
+// *FIND ALL REFS*/[|RCComp|] />