diff --git a/_extension/package.json b/_extension/package.json index 1a1f2864a5..5d844f3d54 100644 --- a/_extension/package.json +++ b/_extension/package.json @@ -40,17 +40,23 @@ ], "default": "verbose", "description": "Trace TypeScript Go server communication.", - "tags": ["experimental"] + "tags": [ + "experimental" + ] }, "typescript.native-preview.pprofDir": { "type": "string", "description": "Directory to write pprof profiles to.", - "tags": ["experimental"] + "tags": [ + "experimental" + ] }, "typescript.native-preview.tsdk": { "type": "string", "description": "Path to the @typescript/native-preview package or tsgo binary directory. If not specified, the extension will look for it in the default location.", - "tags": ["experimental"] + "tags": [ + "experimental" + ] } } } @@ -91,6 +97,11 @@ "title": "Report Issue", "enablement": "typescript.native-preview.serverRunning", "category": "TypeScript Native Preview" + }, + { + "title": "Show References of CodeLens", + "command": "typescript.native-preview.codeLens.showLocations", + "enablement": "false" } ] }, diff --git a/_extension/src/client.ts b/_extension/src/client.ts index b759501e97..6b382fe896 100644 --- a/_extension/src/client.ts +++ b/_extension/src/client.ts @@ -1,8 +1,11 @@ import * as vscode from "vscode"; import { + DocumentUri, LanguageClient, LanguageClientOptions, + Location, NotebookDocumentFilter, + Position, ServerOptions, TextDocumentFilter, TransportKind, @@ -14,6 +17,8 @@ import { } from "./util"; import { getLanguageForUri } from "./util"; +const codeLensShowLocationsCommandName = "typescript.native-preview.codeLens.showLocations"; + export class Client { private outputChannel: vscode.OutputChannel; private traceOutputChannel: vscode.OutputChannel; @@ -32,6 +37,9 @@ export class Client { ], outputChannel: this.outputChannel, traceOutputChannel: this.traceOutputChannel, + initializationOptions: { + codeLensShowLocationsCommandName, + }, diagnosticPullOptions: { onChange: true, onSave: true, @@ -119,10 +127,34 @@ export class Client { await this.client.start(); vscode.commands.executeCommand("setContext", "typescript.native-preview.serverRunning", true); this.onStartedCallbacks.forEach(callback => callback()); - return new vscode.Disposable(() => { - if (this.client) { - this.client.stop(); + + const codeLensLocationsCommand = vscode.commands.registerCommand(codeLensShowLocationsCommandName, (...args: unknown[]) => { + if (args.length !== 3) { + throw new Error("Unexpected number of arguments."); } + + const lspUri = args[0] as DocumentUri; + const lspPosition = args[1] as Position; + const lspLocations = args[2] as Location[]; + + const editorUri = vscode.Uri.parse(lspUri); + const editorPosition = new vscode.Position(lspPosition.line, lspPosition.character); + const editorLocations = lspLocations.map(loc => + new vscode.Location( + vscode.Uri.parse(loc.uri), + new vscode.Range( + new vscode.Position(loc.range.start.line, loc.range.start.character), + new vscode.Position(loc.range.end.line, loc.range.end.character), + ), + ) + ); + + vscode.commands.executeCommand("editor.action.showReferences", editorUri, editorPosition, editorLocations); + }); + + return new vscode.Disposable(() => { + this.client?.stop(); + codeLensLocationsCommand.dispose(); vscode.commands.executeCommand("setContext", "typescript.native-preview.serverRunning", false); }); } diff --git a/internal/ast/ast.go b/internal/ast/ast.go index 0b69261644..d1d6d62a0a 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -2214,11 +2214,11 @@ func IsWriteAccess(node *Node) bool { } func IsWriteAccessForReference(node *Node) bool { - decl := getDeclarationFromName(node) + decl := GetDeclarationFromName(node) return (decl != nil && declarationIsWriteAccess(decl)) || node.Kind == KindDefaultKeyword || IsWriteAccess(node) } -func getDeclarationFromName(name *Node) *Declaration { +func GetDeclarationFromName(name *Node) *Declaration { if name == nil || name.Parent == nil { return nil } diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index d59fa2ec20..7710a0f875 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -4262,6 +4262,14 @@ var Set_the_number_of_checkers_per_project = &Message{code: 100003, category: Ca var X_4_unless_singleThreaded_is_passed = &Message{code: 100004, category: CategoryMessage, key: "4_unless_singleThreaded_is_passed_100004", text: "4, unless --singleThreaded is passed."} +var X_0_references = &Message{code: 100005, category: CategoryMessage, key: "_0_references_100005", text: "{0} references"} + +var X_1_reference = &Message{code: 100006, category: CategoryMessage, key: "1_reference_100006", text: "1 reference"} + +var X_0_implementations = &Message{code: 100007, category: CategoryMessage, key: "_0_implementations_100007", text: "{0} implementations"} + +var X_1_implementation = &Message{code: 100008, category: CategoryMessage, key: "1_implementation_100008", text: "1 implementation"} + func keyToMessage(key Key) *Message { switch key { case "Unterminated_string_literal_1002": @@ -8524,6 +8532,14 @@ func keyToMessage(key Key) *Message { return Set_the_number_of_checkers_per_project case "4_unless_singleThreaded_is_passed_100004": return X_4_unless_singleThreaded_is_passed + case "_0_references_100005": + return X_0_references + case "1_reference_100006": + return X_1_reference + case "_0_implementations_100007": + return X_0_implementations + case "1_implementation_100008": + return X_1_implementation default: return nil } diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json index 47d3e93a11..e0f096b169 100644 --- a/internal/diagnostics/extraDiagnosticMessages.json +++ b/internal/diagnostics/extraDiagnosticMessages.json @@ -19,6 +19,22 @@ "category": "Message", "code": 100004 }, + "{0} references": { + "category": "Message", + "code": 100005 + }, + "1 reference": { + "category": "Message", + "code": 100006 + }, + "{0} implementations": { + "category": "Message", + "code": 100007 + }, + "1 implementation": { + "category": "Message", + "code": 100008 + }, "Non-relative paths are not allowed. Did you forget a leading './'?": { "category": "Error", "code": 5090 diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 7f2fdf27a0..f013bb4752 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -34,6 +34,7 @@ const ( renameCmd baselineCommand = "findRenameLocations" signatureHelpCmd baselineCommand = "SignatureHelp" smartSelectionCmd baselineCommand = "Smart Selection" + codeLensesCmd baselineCommand = "Code Lenses" ) type baselineCommand string diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index d3e20df39c..0f4afc05f7 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -115,8 +115,8 @@ func (w *lspWriter) Write(msg *lsproto.Message) error { return nil } -func (r *lspWriter) Close() { - close(r.c) +func (w *lspWriter) Close() { + close(w.c) } var ( @@ -294,13 +294,16 @@ func (f *FourslashTest) nextID() int32 { return id } +const showCodeLensLocationsCommandName = "typescript.showCodeLensLocations" + func (f *FourslashTest) initialize(t *testing.T, capabilities *lsproto.ClientCapabilities) { params := &lsproto.InitializeParams{ Locale: ptrTo("en-US"), InitializationOptions: &lsproto.InitializationOptions{ // Hack: disable push diagnostics entirely, since the fourslash runner does not // yet gracefully handle non-request messages. - DisablePushDiagnostics: ptrTo(true), + DisablePushDiagnostics: ptrTo(true), + CodeLensShowLocationsCommandName: ptrTo(showCodeLensLocationsCommandName), }, } params.Capabilities = getCapabilitiesWithDefaults(capabilities) @@ -1319,7 +1322,9 @@ func (f *FourslashTest) VerifyBaselineFindAllReferences( Uri: lsconv.FileNameToDocumentURI(f.activeFilename), }, Position: f.currentCaretPosition, - Context: &lsproto.ReferenceContext{}, + Context: &lsproto.ReferenceContext{ + IncludeDeclaration: true, + }, } result := sendRequest(t, f, lsproto.TextDocumentReferencesInfo, params) f.addResultToBaseline(t, findAllReferencesCmd, f.getBaselineForLocationsWithFileContents(*result.Locations, baselineFourslashLocationsOptions{ @@ -1330,6 +1335,61 @@ func (f *FourslashTest) VerifyBaselineFindAllReferences( } } +func (f *FourslashTest) VerifyBaselineCodeLens(t *testing.T, preferences *lsutil.UserPreferences) { + if preferences != nil { + reset := f.ConfigureWithReset(t, preferences) + defer reset() + } + + foundAtLeastOneCodeLens := false + for _, openFile := range slices.Sorted(maps.Keys(f.openFiles)) { + params := &lsproto.CodeLensParams{ + TextDocument: lsproto.TextDocumentIdentifier{ + Uri: lsconv.FileNameToDocumentURI(openFile), + }, + } + + unresolvedCodeLensList := sendRequest(t, f, lsproto.TextDocumentCodeLensInfo, params) + if unresolvedCodeLensList.CodeLenses == nil || len(*unresolvedCodeLensList.CodeLenses) == 0 { + continue + } + foundAtLeastOneCodeLens = true + + for _, unresolvedCodeLens := range *unresolvedCodeLensList.CodeLenses { + assert.Assert(t, unresolvedCodeLens != nil) + resolvedCodeLens := sendRequest(t, f, lsproto.CodeLensResolveInfo, unresolvedCodeLens) + assert.Assert(t, resolvedCodeLens != nil) + assert.Assert(t, resolvedCodeLens.Command != nil, "Expected resolved code lens to have a command.") + if len(resolvedCodeLens.Command.Command) > 0 { + assert.Equal(t, resolvedCodeLens.Command.Command, showCodeLensLocationsCommandName) + } + + var locations []lsproto.Location + // commandArgs: (DocumentUri, Position, Location[]) + if commandArgs := resolvedCodeLens.Command.Arguments; commandArgs != nil { + locs, err := roundtripThroughJson[[]lsproto.Location]((*commandArgs)[2]) + if err != nil { + t.Fatalf("failed to re-encode code lens locations: %v", err) + } + locations = locs + } + + f.addResultToBaseline(t, codeLensesCmd, f.getBaselineForLocationsWithFileContents(locations, baselineFourslashLocationsOptions{ + marker: &RangeMarker{ + fileName: openFile, + LSRange: resolvedCodeLens.Range, + Range: f.converters.FromLSPRange(f.getScriptInfo(openFile), resolvedCodeLens.Range), + }, + markerName: "/*CODELENS: " + resolvedCodeLens.Command.Title + "*/", + })) + } + } + + if !foundAtLeastOneCodeLens { + t.Fatalf("Expected at least one code lens in any open file, but got none.") + } +} + func (f *FourslashTest) MarkTestAsStradaServer() { f.isStradaServer = true } @@ -2155,6 +2215,25 @@ func ptrTo[T any](v T) *T { return &v } +// This function is intended for spots where a complex +// value needs to be reinterpreted following some prior JSON deserialization. +// The default deserializer for `any` properties will give us a map at runtime, +// but we want to validate against, and use, the types as returned from the the language service. +// +// Use this function sparingly. You can treat it as a "map-to-struct" converter, +// but updating the original types is probably better in most cases. +func roundtripThroughJson[T any](value any) (T, error) { + var result T + bytes, err := json.Marshal(value) + if err != nil { + return result, fmt.Errorf("failed to marshal value to JSON: %w", err) + } + if err := json.Unmarshal(bytes, &result); err != nil { + return result, fmt.Errorf("failed to unmarshal value from JSON: %w", err) + } + return result, nil +} + // Insert text at the current caret position. func (f *FourslashTest) Insert(t *testing.T, text string) { f.typeText(t, text) diff --git a/internal/fourslash/tests/codeLensFunctionExpressions01_test.go b/internal/fourslash/tests/codeLensFunctionExpressions01_test.go new file mode 100644 index 0000000000..92768014ad --- /dev/null +++ b/internal/fourslash/tests/codeLensFunctionExpressions01_test.go @@ -0,0 +1,53 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensFunctionExpressions01(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +// @filename: anonymousFunctionExpressions.ts +export let anonFn1 = function () {}; +export const anonFn2 = function () {}; + +let anonFn3 = function () {}; +const anonFn4 = function () {}; + +// @filename: arrowFunctions.ts +export let arrowFn1 = () => {}; +export const arrowFn2 = () => {}; + +let arrowFn3 = () => {}; +const arrowFn4 = () => {}; + +// @filename: namedFunctions.ts +export let namedFn1 = function namedFn1() { + namedFn1(); +} +namedFn1(); + +export const namedFn2 = function namedFn2() { + namedFn2(); +} +namedFn2(); + +let namedFn3 = function namedFn3() {}; +const namedFn4 = function namedFn4() {}; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ReferencesCodeLensEnabled: true, + ReferencesCodeLensShowOnAllFunctions: true, + + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnInterfaceMethods: true, + ImplementationsCodeLensShowOnAllClassMethods: true, + }) +} diff --git a/internal/fourslash/tests/codeLensFunctionsAndConstants01_test.go b/internal/fourslash/tests/codeLensFunctionsAndConstants01_test.go new file mode 100644 index 0000000000..bad700760e --- /dev/null +++ b/internal/fourslash/tests/codeLensFunctionsAndConstants01_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensFunctionsAndConstants01(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +// @module: preserve + +// @filename: ./exports.ts + +let callCount = 0; +export function foo(n: number): void { + callCount++; + if (n > 0) { + foo(n - 1); + } + else { + console.log("function was called " + callCount + " times"); + } +} + +foo(5); + +export const bar = 123; + +// @filename: ./importer.ts +import { foo, bar } from "./exports"; + +foo(5); +console.log(bar); +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ReferencesCodeLensEnabled: true, + ReferencesCodeLensShowOnAllFunctions: true, + + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnInterfaceMethods: true, + ImplementationsCodeLensShowOnAllClassMethods: true, + }) +} diff --git a/internal/fourslash/tests/codeLensInterface01_test.go b/internal/fourslash/tests/codeLensInterface01_test.go new file mode 100644 index 0000000000..a1e9a42368 --- /dev/null +++ b/internal/fourslash/tests/codeLensInterface01_test.go @@ -0,0 +1,59 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensInterface01(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +// @module: preserve + +// @filename: ./pointable.ts +export interface Pointable { + getX(): number; + getY(): number; +} + +// @filename: ./classPointable.ts +import { Pointable } from "./pointable"; + +class Point implements Pointable { + getX(): number { + return 0; + } + getY(): number { + return 0; + } +} + +// @filename: ./objectPointable.ts +import { Pointable } from "./pointable"; + +let x = 0; +let y = 0; +const p: Pointable = { + getX(): number { + return x; + }, + getY(): number { + return y; + }, +}; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ReferencesCodeLensEnabled: true, + ReferencesCodeLensShowOnAllFunctions: true, + + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnInterfaceMethods: true, + ImplementationsCodeLensShowOnAllClassMethods: true, + }) +} diff --git a/internal/fourslash/tests/codeLensOverloads01_test.go b/internal/fourslash/tests/codeLensOverloads01_test.go new file mode 100644 index 0000000000..02e863c30e --- /dev/null +++ b/internal/fourslash/tests/codeLensOverloads01_test.go @@ -0,0 +1,39 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensOverloads01(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +export function foo(x: number): number; +export function foo(x: string): string; +export function foo(x: string | number): string | number { + return x; +} + +foo(1); + +foo("hello"); + +// This one isn't expected to match any overload, +// but is really just here to test how it affects how code lens. +foo(Math.random() ? 1 : "hello"); +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ReferencesCodeLensEnabled: true, + ReferencesCodeLensShowOnAllFunctions: true, + + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnInterfaceMethods: true, + ImplementationsCodeLensShowOnAllClassMethods: true, + }) +} diff --git a/internal/fourslash/tests/codeLensShowOnAllClassMethods_test.go b/internal/fourslash/tests/codeLensShowOnAllClassMethods_test.go new file mode 100644 index 0000000000..9683168764 --- /dev/null +++ b/internal/fourslash/tests/codeLensShowOnAllClassMethods_test.go @@ -0,0 +1,43 @@ +package fourslash_test + +import ( + "fmt" + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensReferencesShowOnAllClassMethods(t *testing.T) { + t.Parallel() + containingTestName := t.Name() + for _, value := range []bool{true, false} { + t.Run(fmt.Sprintf("%s=%v", containingTestName, value), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +export abstract class ABC { + abstract methodA(): void; + methodB(): void {} + #methodC(): void {} + protected methodD(): void {} + private methodE(): void {} + protected abstract methodG(): void; + public methodH(): void {} + + static methodStaticA(): void {} + protected static methodStaticB(): void {} + private static methodStaticC(): void {} + static #methodStaticD(): void {} +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnAllClassMethods: value, + }) + }) + } +} diff --git a/internal/fourslash/tests/codeLensShowOnAllFunctions_test.go b/internal/fourslash/tests/codeLensShowOnAllFunctions_test.go new file mode 100644 index 0000000000..a394b59ad9 --- /dev/null +++ b/internal/fourslash/tests/codeLensShowOnAllFunctions_test.go @@ -0,0 +1,38 @@ +package fourslash_test + +import ( + "fmt" + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensReferencesShowOnAllFunctions(t *testing.T) { + t.Parallel() + containingTestName := t.Name() + for _, value := range []bool{true, false} { + t.Run(fmt.Sprintf("%s=%v", containingTestName, value), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +export function f1(): void {} + +function f2(): void {} + +export const f3 = () => {}; + +const f4 = () => {}; + +const f5 = function() {}; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ReferencesCodeLensEnabled: true, + ReferencesCodeLensShowOnAllFunctions: value, + }) + }) + } +} diff --git a/internal/fourslash/tests/codeLensShowOnInterfaceMethods_test.go b/internal/fourslash/tests/codeLensShowOnInterfaceMethods_test.go new file mode 100644 index 0000000000..289456a6e4 --- /dev/null +++ b/internal/fourslash/tests/codeLensShowOnInterfaceMethods_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "fmt" + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCodeLensReferencesShowOnInterfaceMethods(t *testing.T) { + t.Parallel() + containingTestName := t.Name() + for _, value := range []bool{true, false} { + t.Run(fmt.Sprintf("%s=%v", containingTestName, value), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + + const content = ` +export interface I { + methodA(): void; +} +export interface I { + methodB(): void; +} + +interface J extends I { + methodB(): void; + methodC(): void; +} + +class C implements J { + methodA(): void {} + methodB(): void {} + methodC(): void {} +} + +class AbstractC implements J { + abstract methodA(): void; + methodB(): void {} + abstract methodC(): void; +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{ + ImplementationsCodeLensEnabled: true, + ImplementationsCodeLensShowOnInterfaceMethods: value, + }) + }) + } +} diff --git a/internal/ls/codelens.go b/internal/ls/codelens.go new file mode 100644 index 0000000000..83d81d8da1 --- /dev/null +++ b/internal/ls/codelens.go @@ -0,0 +1,230 @@ +package ls + +import ( + "context" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/locale" + "github.com/microsoft/typescript-go/internal/ls/lsutil" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/scanner" +) + +func (l *LanguageService) ProvideCodeLenses(ctx context.Context, documentURI lsproto.DocumentUri) (lsproto.CodeLensResponse, error) { + _, file := l.getProgramAndFile(documentURI) + + userPrefs := l.UserPreferences() + if !userPrefs.ReferencesCodeLensEnabled && !userPrefs.ImplementationsCodeLensEnabled { + return lsproto.CodeLensResponse{}, nil + } + + // Keeps track of the last symbol to avoid duplicating code lenses across overloads. + var lastSymbol *ast.Symbol + var result []*lsproto.CodeLens + var visit func(node *ast.Node) bool + visit = func(node *ast.Node) bool { + if ctx.Err() != nil { + return true + } + + if currentSymbol := node.Symbol(); lastSymbol != currentSymbol { + lastSymbol = currentSymbol + + if userPrefs.ReferencesCodeLensEnabled && isValidReferenceLensNode(node, userPrefs) { + result = append(result, l.newCodeLensForNode(documentURI, file, node, lsproto.CodeLensKindReferences)) + } + + if userPrefs.ImplementationsCodeLensEnabled && isValidImplementationsCodeLensNode(node, userPrefs) { + result = append(result, l.newCodeLensForNode(documentURI, file, node, lsproto.CodeLensKindImplementations)) + } + } + + savedLastSymbol := lastSymbol + node.ForEachChild(visit) + lastSymbol = savedLastSymbol + return false + } + + visit(file.AsNode()) + + return lsproto.CodeLensResponse{ + CodeLenses: &result, + }, nil +} + +func (l *LanguageService) ResolveCodeLens(ctx context.Context, codeLens *lsproto.CodeLens, showLocationsCommandName *string) (*lsproto.CodeLens, error) { + uri := codeLens.Data.Uri + _, sourceFile := l.tryGetProgramAndFile(uri.FileName()) + if sourceFile == nil || + l.converters.PositionToLineAndCharacter(sourceFile, core.TextPos(sourceFile.End())).Line < codeLens.Range.Start.Line { + // This can happen if a codeLens/resolve request comes in after a program change. + // While it's true that handlers should latch onto a specific snapshot + // while processing requests, we just set `Data.Uri` based on + // some older snapshot's contents. The content could have been modified, + // or the file itself could have been removed from the session entirely. + // Note this won't bail out on every change, but will prevent crashing + // based on non-existent files and line maps from shortened files. + return codeLens, lsproto.ErrorCodeContentModified + } + + textDoc := lsproto.TextDocumentIdentifier{ + Uri: uri, + } + locale := locale.FromContext(ctx) + var locs []lsproto.Location + var lensTitle string + switch codeLens.Data.Kind { + case lsproto.CodeLensKindReferences: + origNode, symbolsAndEntries, ok := l.ProvideSymbolsAndEntries(ctx, uri, codeLens.Range.Start, false /*isRename*/) + if ok { + references, err := l.ProvideReferencesFromSymbolAndEntries( + ctx, + &lsproto.ReferenceParams{ + TextDocument: textDoc, + Position: codeLens.Range.Start, + Context: &lsproto.ReferenceContext{ + // Don't include the declaration in the references count. + IncludeDeclaration: false, + }, + }, + origNode, + symbolsAndEntries, + ) + if err != nil { + return nil, err + } + + if references.Locations != nil { + locs = *references.Locations + } + } + + if len(locs) == 1 { + lensTitle = diagnostics.X_1_reference.Localize(locale) + } else { + lensTitle = diagnostics.X_0_references.Localize(locale, len(locs)) + } + case lsproto.CodeLensKindImplementations: + // "Force" link support to be false so that we only get `Locations` back, + // and don't include the "current" node in the results. + findImplsOptions := provideImplementationsOpts{ + requireLocationsResult: true, + dropOriginNodes: true, + } + implementations, err := l.provideImplementationsEx( + ctx, + &lsproto.ImplementationParams{ + TextDocument: textDoc, + Position: codeLens.Range.Start, + }, + findImplsOptions, + ) + if err != nil { + return nil, err + } + + if implementations.Locations != nil { + locs = *implementations.Locations + } + + if len(locs) == 1 { + lensTitle = diagnostics.X_1_implementation.Localize(locale) + } else { + lensTitle = diagnostics.X_0_implementations.Localize(locale, len(locs)) + } + } + + cmd := &lsproto.Command{ + Title: lensTitle, + } + if len(locs) > 0 && showLocationsCommandName != nil { + cmd.Command = *showLocationsCommandName + cmd.Arguments = &[]any{ + uri, + codeLens.Range.Start, + locs, + } + } + + codeLens.Command = cmd + return codeLens, nil +} + +func (l *LanguageService) newCodeLensForNode(fileUri lsproto.DocumentUri, file *ast.SourceFile, node *ast.Node, kind lsproto.CodeLensKind) *lsproto.CodeLens { + nodeForRange := node + nodeName := node.Name() + if nodeName != nil { + nodeForRange = nodeName + } + pos := scanner.SkipTrivia(file.Text(), nodeForRange.Pos()) + + return &lsproto.CodeLens{ + Range: lsproto.Range{ + Start: l.converters.PositionToLineAndCharacter(file, core.TextPos(pos)), + End: l.converters.PositionToLineAndCharacter(file, core.TextPos(node.End())), + }, + Data: &lsproto.CodeLensData{ + Kind: kind, + Uri: fileUri, + }, + } +} + +func isValidImplementationsCodeLensNode(node *ast.Node, userPrefs *lsutil.UserPreferences) bool { + switch node.Kind { + // Always show on interfaces + case ast.KindInterfaceDeclaration: + // TODO: ast.KindTypeAliasDeclaration? + return true + + // If configured, show on interface methods + case ast.KindMethodSignature: + return userPrefs.ImplementationsCodeLensShowOnInterfaceMethods && node.Parent.Kind == ast.KindInterfaceDeclaration + + // If configured, show on all class methods - but not private ones. + case ast.KindMethodDeclaration: + if userPrefs.ImplementationsCodeLensShowOnAllClassMethods && node.Parent.Kind == ast.KindClassDeclaration { + return !ast.HasModifier(node, ast.ModifierFlagsPrivate) && node.Name().Kind != ast.KindPrivateIdentifier + } + fallthrough + + // Always show on abstract classes/properties/methods + case ast.KindClassDeclaration, ast.KindConstructor, + ast.KindGetAccessor, ast.KindSetAccessor, ast.KindPropertyDeclaration: + return ast.HasModifier(node, ast.ModifierFlagsAbstract) + } + + return false +} + +func isValidReferenceLensNode(node *ast.Node, userPrefs *lsutil.UserPreferences) bool { + switch node.Kind { + case ast.KindFunctionDeclaration: + if userPrefs.ReferencesCodeLensShowOnAllFunctions { + return true + } + fallthrough + + case ast.KindVariableDeclaration: + return ast.GetCombinedModifierFlags(node)&ast.ModifierFlagsExport != 0 + + case ast.KindClassDeclaration, ast.KindInterfaceDeclaration, ast.KindTypeAliasDeclaration, ast.KindEnumDeclaration, ast.KindEnumMember: + return true + + case ast.KindMethodDeclaration, ast.KindMethodSignature, ast.KindConstructor, + ast.KindGetAccessor, ast.KindSetAccessor, + ast.KindPropertyDeclaration, ast.KindPropertySignature: + // Don't show if child and parent have same start + // For https://github.com/microsoft/vscode/issues/90396 + // !!! + + switch node.Parent.Kind { + case ast.KindClassDeclaration, ast.KindInterfaceDeclaration, ast.KindTypeLiteral: + return true + } + } + + return false +} diff --git a/internal/ls/completions.go b/internal/ls/completions.go index b74f0000e3..3459b3fb8f 100644 --- a/internal/ls/completions.go +++ b/internal/ls/completions.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "maps" "slices" "strings" "sync" @@ -1989,7 +1988,7 @@ func (l *LanguageService) getCompletionEntriesFromSymbols( } uniqueSet := collections.NewSetWithSizeHint[string](len(uniques)) - for name := range maps.Keys(uniques) { + for name := range uniques { uniqueSet.Add(name) } return *uniqueSet, sortedEntries diff --git a/internal/ls/findallreferences.go b/internal/ls/findallreferences.go index afe9099743..66a9e494c1 100644 --- a/internal/ls/findallreferences.go +++ b/internal/ls/findallreferences.go @@ -599,11 +599,24 @@ func (l *LanguageService) ProvideSymbolsAndEntries(ctx context.Context, uri lspr func (l *LanguageService) ProvideReferencesFromSymbolAndEntries(ctx context.Context, params *lsproto.ReferenceParams, originalNode *ast.Node, symbolsAndEntries []*SymbolAndEntries) (lsproto.ReferencesResponse, error) { // `findReferencedSymbols` except only computes the information needed to return reference locations - locations := core.FlatMap(symbolsAndEntries, l.convertSymbolAndEntriesToLocations) + locations := core.FlatMap(symbolsAndEntries, func(s *SymbolAndEntries) []lsproto.Location { + return l.convertSymbolAndEntriesToLocations(s, params.Context.IncludeDeclaration) + }) return lsproto.LocationsOrNull{Locations: &locations}, nil } func (l *LanguageService) ProvideImplementations(ctx context.Context, params *lsproto.ImplementationParams) (lsproto.ImplementationResponse, error) { + return l.provideImplementationsEx(ctx, params, provideImplementationsOpts{}) +} + +type provideImplementationsOpts struct { + // Force the result to be Location objects. + requireLocationsResult bool + // Omit node(s) containing the original position. + dropOriginNodes bool +} + +func (l *LanguageService) provideImplementationsEx(ctx context.Context, params *lsproto.ImplementationParams, opts provideImplementationsOpts) (lsproto.ImplementationResponse, error) { program, sourceFile := l.getProgramAndFile(params.TextDocument.Uri) position := int(l.converters.LineAndCharacterToPosition(sourceFile, params.Position)) node := astnav.GetTouchingPropertyName(sourceFile, position) @@ -620,12 +633,14 @@ func (l *LanguageService) ProvideImplementations(ctx context.Context, params *ls queue = queue[1:] if !seenNodes.Has(entry.node) { seenNodes.Add(entry.node) - entries = append(entries, entry) + if !(opts.dropOriginNodes && entry.node.Loc.ContainsInclusive(position)) { + entries = append(entries, entry) + } queue = append(queue, l.getImplementationReferenceEntries(ctx, program, entry.node, entry.node.Pos())...) } } - if lsproto.GetClientCapabilities(ctx).TextDocument.Implementation.LinkSupport { + if !opts.requireLocationsResult && lsproto.GetClientCapabilities(ctx).TextDocument.Implementation.LinkSupport { links := l.convertEntriesToLocationLinks(entries) return lsproto.LocationOrLocationsOrDefinitionLinksOrNull{DefinitionLinks: &links}, nil } @@ -713,8 +728,41 @@ func (l *LanguageService) getTextForRename(originalNode *ast.Node, entry *Refere } // == functions for conversions == -func (l *LanguageService) convertSymbolAndEntriesToLocations(s *SymbolAndEntries) []lsproto.Location { - return l.convertEntriesToLocations(s.references) +func (l *LanguageService) convertSymbolAndEntriesToLocations(s *SymbolAndEntries, includeDeclarations bool) []lsproto.Location { + references := s.references + + // !!! includeDeclarations + if !includeDeclarations && s.definition != nil { + references = core.Filter(references, func(entry *ReferenceEntry) bool { + return !isDeclarationOfSymbol(entry.node, s.definition.symbol) + }) + } + + return l.convertEntriesToLocations(references) +} + +func isDeclarationOfSymbol(node *ast.Node, target *ast.Symbol) bool { + if target == nil { + return false + } + + var source *ast.Node + if decl := ast.GetDeclarationFromName(node); decl != nil { + source = decl + } else if node.Kind == ast.KindDefaultKeyword { + source = node.Parent + } else if ast.IsLiteralComputedPropertyDeclarationName(node) { + source = node.Parent.Parent + } else if node.Kind == ast.KindConstructorKeyword && ast.IsConstructorDeclaration(node.Parent) { + source = node.Parent.Parent + } + + // !!! + // const commonjsSource = source && isBinaryExpression(source) ? source.left as unknown as Declaration : undefined; + + return source != nil && core.Some(target.Declarations, func(decl *ast.Node) bool { + return decl == source + }) } func (l *LanguageService) convertEntriesToLocations(entries []*ReferenceEntry) []lsproto.Location { @@ -1715,7 +1763,8 @@ func (state *refState) getReferencesInContainerOrFiles(symbol *ast.Symbol, searc // Try to get the smallest valid scope that we can limit our search to; // otherwise we'll need to search globally (i.e. include each file). if scope := getSymbolScope(symbol); scope != nil { - state.getReferencesInContainer(scope, ast.GetSourceFileOfNode(scope), search /*addReferencesHere*/, !(scope.Kind == ast.KindSourceFile && !slices.Contains(state.sourceFiles, scope.AsSourceFile()))) + addReferencesHere := scope.Kind != ast.KindSourceFile || slices.Contains(state.sourceFiles, scope.AsSourceFile()) + state.getReferencesInContainer(scope, ast.GetSourceFileOfNode(scope), search, addReferencesHere) } else { // Global search for _, sourceFile := range state.sourceFiles { diff --git a/internal/ls/lsutil/userpreferences.go b/internal/ls/lsutil/userpreferences.go index 43573d4f8f..9b9a7eb4a1 100644 --- a/internal/ls/lsutil/userpreferences.go +++ b/internal/ls/lsutil/userpreferences.go @@ -145,6 +145,14 @@ type UserPreferences struct { IncludeInlayFunctionLikeReturnTypeHints bool IncludeInlayEnumMemberValueHints bool + // ------- CodeLens ------- + + ReferencesCodeLensEnabled bool + ImplementationsCodeLensEnabled bool + ReferencesCodeLensShowOnAllFunctions bool + ImplementationsCodeLensShowOnInterfaceMethods bool + ImplementationsCodeLensShowOnAllClassMethods bool + // ------- Symbols ------- ExcludeLibrarySymbolsInNavTo bool @@ -381,6 +389,10 @@ func (p *UserPreferences) parseWorker(config map[string]any) { continue case "inlayHints": p.parseInlayHints(values) + case "referencesCodeLens": + p.parseReferencesCodeLens(values) + case "implementationsCodeLens": + p.parseImplementationsCodeLens(values) case "suggest": p.parseSuggest(values) case "preferences": @@ -444,6 +456,38 @@ func (p *UserPreferences) parseInlayHints(prefs any) { } } +func (p *UserPreferences) parseReferencesCodeLens(prefs any) { + referencesCodeLens, ok := prefs.(map[string]any) + if !ok { + return + } + for name, value := range referencesCodeLens { + switch name { + case "enabled": + p.set("referencesCodeLensEnabled", value) + case "showOnAllFunctions": + p.set("referencesCodeLensShowOnAllFunctions", value) + } + } +} + +func (p *UserPreferences) parseImplementationsCodeLens(prefs any) { + implementationsCodeLens, ok := prefs.(map[string]any) + if !ok { + return + } + for name, value := range implementationsCodeLens { + switch name { + case "enabled": + p.set("implementationsCodeLensEnabled", value) + case "showOnInterfaceMethods": + p.set("implementationsCodeLensShowOnInterfaceMethods", value) + case "showOnAllClassMethods": + p.set("implementationsCodeLensShowOnAllClassMethods", value) + } + } +} + func (p *UserPreferences) parseSuggest(prefs any) { completionsPreferences, ok := prefs.(map[string]any) if !ok { @@ -655,5 +699,15 @@ func (p *UserPreferences) set(name string, value any) { p.DisplayPartsForJSDoc = parseBoolWithDefault(value, true) case "reportstylechecksaswarnings": p.ReportStyleChecksAsWarnings = parseBoolWithDefault(value, true) + case "referencescodelensenabled": + p.ReferencesCodeLensEnabled = parseBoolWithDefault(value, false) + case "implementationscodelensenabled": + p.ImplementationsCodeLensEnabled = parseBoolWithDefault(value, false) + case "referencescodelensshowonallfunctions": + p.ReferencesCodeLensShowOnAllFunctions = parseBoolWithDefault(value, false) + case "implementationscodelensshowoninterfacemethods": + p.ImplementationsCodeLensShowOnInterfaceMethods = parseBoolWithDefault(value, false) + case "implementationscodelensshowonallclassmethods": + p.ImplementationsCodeLensShowOnAllClassMethods = parseBoolWithDefault(value, false) } } diff --git a/internal/lsp/lsproto/_generate/generate.mts b/internal/lsp/lsproto/_generate/generate.mts index 71e4eb4d28..546af57593 100644 --- a/internal/lsp/lsproto/_generate/generate.mts +++ b/internal/lsp/lsproto/_generate/generate.mts @@ -6,6 +6,7 @@ import path from "node:path"; import url from "node:url"; import which from "which"; import type { + Enumeration, MetaModel, Notification, OrType, @@ -40,6 +41,12 @@ const customStructures: Structure[] = [ optional: true, documentation: "DisablePushDiagnostics disables automatic pushing of diagnostics to the client.", }, + { + name: "codeLensShowLocationsCommandName", + type: { kind: "base", name: "string" }, + optional: true, + documentation: "The client-side command name that resolved references/implementations `CodeLens` should trigger. Arguments passed will be `(DocumentUri, Position, Location[])`.", + }, ], documentation: "InitializationOptions contains user-provided initialization options.", }, @@ -151,6 +158,41 @@ const customStructures: Structure[] = [ ], documentation: "CompletionItemData is preserved on a CompletionItem between CompletionRequest and CompletionResolveRequest.", }, + { + name: "CodeLensData", + properties: [ + { + name: "kind", + type: { kind: "reference", name: "CodeLensKind" }, + documentation: `The kind of the code lens ("references" or "implementations").`, + }, + { + name: "uri", + type: { kind: "base", name: "DocumentUri" }, + documentation: `The document in which the code lens and its range are located.`, + }, + ], + }, +]; + +const customEnumerations: Enumeration[] = [ + { + name: "CodeLensKind", + type: { + kind: "base", + name: "string", + }, + values: [ + { + name: "References", + value: "references", + }, + { + name: "Implementations", + value: "implementations", + }, + ], + }, ]; // Track which custom Data structures were declared explicitly @@ -251,7 +293,8 @@ function patchAndPreprocessModel() { }); } - // Add custom structures and synthetic structures to the model + // Add custom enumerations, custom structures, and synthetic structures to the model + model.enumerations.push(...customEnumerations); model.structures.push(...customStructures, ...syntheticStructures); // Build structure map for preprocessing diff --git a/internal/lsp/lsproto/lsp_generated.go b/internal/lsp/lsproto/lsp_generated.go index be24b90f27..5845274323 100644 --- a/internal/lsp/lsproto/lsp_generated.go +++ b/internal/lsp/lsproto/lsp_generated.go @@ -21595,6 +21595,9 @@ type ClientSemanticTokensRequestFullDelta struct { type InitializationOptions struct { // DisablePushDiagnostics disables automatic pushing of diagnostics to the client. DisablePushDiagnostics *bool `json:"disablePushDiagnostics,omitzero"` + + // The client-side command name that resolved references/implementations `CodeLens` should trigger. Arguments passed will be `(DocumentUri, Position, Location[])`. + CodeLensShowLocationsCommandName *string `json:"codeLensShowLocationsCommandName,omitzero"` } // ExportInfoMapKey uniquely identifies an export for auto-import purposes. @@ -21651,6 +21654,70 @@ type CompletionItemData struct { AutoImport *AutoImportData `json:"autoImport,omitzero"` } +type CodeLensData struct { + // The kind of the code lens ("references" or "implementations"). + Kind CodeLensKind `json:"kind"` + + // The document in which the code lens and its range are located. + Uri DocumentUri `json:"uri"` +} + +var _ json.UnmarshalerFrom = (*CodeLensData)(nil) + +func (s *CodeLensData) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + const ( + missingKind uint = 1 << iota + missingUri + _missingLast + ) + missing := _missingLast - 1 + + if k := dec.PeekKind(); k != '{' { + return fmt.Errorf("expected object start, but encountered %v", k) + } + if _, err := dec.ReadToken(); err != nil { + return err + } + + for dec.PeekKind() != '}' { + name, err := dec.ReadValue() + if err != nil { + return err + } + switch string(name) { + case `"kind"`: + missing &^= missingKind + if err := json.UnmarshalDecode(dec, &s.Kind); err != nil { + return err + } + case `"uri"`: + missing &^= missingUri + if err := json.UnmarshalDecode(dec, &s.Uri); err != nil { + return err + } + default: + // Ignore unknown properties. + } + } + + if _, err := dec.ReadToken(); err != nil { + return err + } + + if missing != 0 { + var missingProps []string + if missing&missingKind != 0 { + missingProps = append(missingProps, "kind") + } + if missing&missingUri != 0 { + missingProps = append(missingProps, "uri") + } + return fmt.Errorf("missing required properties: %s", strings.Join(missingProps, ", ")) + } + + return nil +} + // CallHierarchyItemData is a placeholder for custom data preserved on a CallHierarchyItem. type CallHierarchyItemData struct{} @@ -21666,9 +21733,6 @@ type CodeActionData struct{} // WorkspaceSymbolData is a placeholder for custom data preserved on a WorkspaceSymbol. type WorkspaceSymbolData struct{} -// CodeLensData is a placeholder for custom data preserved on a CodeLens. -type CodeLensData struct{} - // DocumentLinkData is a placeholder for custom data preserved on a DocumentLink. type DocumentLinkData struct{} @@ -22817,6 +22881,13 @@ const ( TokenFormatRelative TokenFormat = "relative" ) +type CodeLensKind string + +const ( + CodeLensKindReferences CodeLensKind = "references" + CodeLensKindImplementations CodeLensKind = "implementations" +) + func unmarshalParams(method Method, data []byte) (any, error) { switch method { case MethodTextDocumentImplementation: diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 8969e96ad3..e9e33669ad 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -516,6 +516,7 @@ var handlers = sync.OnceValue(func() handlerMap { registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentDocumentHighlightInfo, (*Server).handleDocumentHighlight) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentSelectionRangeInfo, (*Server).handleSelectionRange) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentInlayHintInfo, (*Server).handleInlayHint) + registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentCodeLensInfo, (*Server).handleCodeLens) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentCodeActionInfo, (*Server).handleCodeAction) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentPrepareCallHierarchyInfo, (*Server).handlePrepareCallHierarchy) @@ -527,6 +528,7 @@ var handlers = sync.OnceValue(func() handlerMap { registerRequestHandler(handlers, lsproto.WorkspaceSymbolInfo, (*Server).handleWorkspaceSymbol) registerRequestHandler(handlers, lsproto.CompletionItemResolveInfo, (*Server).handleCompletionItemResolve) + registerRequestHandler(handlers, lsproto.CodeLensResolveInfo, (*Server).handleCodeLensResolve) return handlers }) @@ -949,6 +951,9 @@ func (s *Server) handleInitialize(ctx context.Context, params *lsproto.Initializ InlayHintProvider: &lsproto.BooleanOrInlayHintOptionsOrInlayHintRegistrationOptions{ Boolean: ptrTo(true), }, + CodeLensProvider: &lsproto.CodeLensOptions{ + ResolveProvider: ptrTo(true), + }, CodeActionProvider: &lsproto.BooleanOrCodeActionOptions{ CodeActionOptions: &lsproto.CodeActionOptions{ CodeActionKinds: &[]lsproto.CodeActionKind{ @@ -1292,6 +1297,20 @@ func (s *Server) handleInlayHint( return languageService.ProvideInlayHint(ctx, params) } +func (s *Server) handleCodeLens(ctx context.Context, ls *ls.LanguageService, params *lsproto.CodeLensParams) (lsproto.CodeLensResponse, error) { + return ls.ProvideCodeLenses(ctx, params.TextDocument.Uri) +} + +func (s *Server) handleCodeLensResolve(ctx context.Context, codeLens *lsproto.CodeLens, reqMsg *lsproto.RequestMessage) (*lsproto.CodeLens, error) { + ls, err := s.session.GetLanguageService(ctx, codeLens.Data.Uri) + if err != nil { + return nil, err + } + defer s.recover(reqMsg) + + return ls.ResolveCodeLens(ctx, codeLens, s.initializeParams.InitializationOptions.CodeLensShowLocationsCommandName) +} + func (s *Server) handlePrepareCallHierarchy( ctx context.Context, languageService *ls.LanguageService, diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionExpressions01.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionExpressions01.baseline.jsonc new file mode 100644 index 0000000000..5b8911c10b --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionExpressions01.baseline.jsonc @@ -0,0 +1,72 @@ +// === Code Lenses === +// === /anonymousFunctionExpressions.ts === +// export let /*CODELENS: 0 references*/anonFn1 = function () {}; +// export const anonFn2 = function () {}; +// +// let anonFn3 = function () {}; +// const anonFn4 = function () {}; +// + + + +// === Code Lenses === +// === /anonymousFunctionExpressions.ts === +// export let anonFn1 = function () {}; +// export const /*CODELENS: 0 references*/anonFn2 = function () {}; +// +// let anonFn3 = function () {}; +// const anonFn4 = function () {}; +// + + + +// === Code Lenses === +// === /arrowFunctions.ts === +// export let /*CODELENS: 0 references*/arrowFn1 = () => {}; +// export const arrowFn2 = () => {}; +// +// let arrowFn3 = () => {}; +// const arrowFn4 = () => {}; +// + + + +// === Code Lenses === +// === /arrowFunctions.ts === +// export let arrowFn1 = () => {}; +// export const /*CODELENS: 0 references*/arrowFn2 = () => {}; +// +// let arrowFn3 = () => {}; +// const arrowFn4 = () => {}; +// + + + +// === Code Lenses === +// === /namedFunctions.ts === +// export let /*CODELENS: 1 reference*/namedFn1 = function namedFn1() { +// namedFn1(); +// } +// [|namedFn1|](); +// +// export const namedFn2 = function namedFn2() { +// namedFn2(); +// --- (line: 8) skipped --- + + + +// === Code Lenses === +// === /namedFunctions.ts === +// export let namedFn1 = function namedFn1() { +// namedFn1(); +// } +// namedFn1(); +// +// export const /*CODELENS: 1 reference*/namedFn2 = function namedFn2() { +// namedFn2(); +// } +// [|namedFn2|](); +// +// let namedFn3 = function namedFn3() {}; +// const namedFn4 = function namedFn4() {}; +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionsAndConstants01.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionsAndConstants01.baseline.jsonc new file mode 100644 index 0000000000..5c306865e3 --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensFunctionsAndConstants01.baseline.jsonc @@ -0,0 +1,42 @@ +// === Code Lenses === +// === /exports.ts === +// let callCount = 0; +// export function /*CODELENS: 3 references*/foo(n: number): void { +// callCount++; +// if (n > 0) { +// [|foo|](n - 1); +// } +// else { +// console.log("function was called " + callCount + " times"); +// } +// } +// +// [|foo|](5); +// +// export const bar = 123; +// + +// === /importer.ts === +// import { foo, bar } from "./exports"; +// +// [|foo|](5); +// console.log(bar); +// + + + +// === Code Lenses === +// === /importer.ts === +// import { foo, bar } from "./exports"; +// +// foo(5); +// console.log([|bar|]); +// + +// === /exports.ts === +// --- (line: 10) skipped --- +// +// foo(5); +// +// export const /*CODELENS: 1 reference*/bar = 123; +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc new file mode 100644 index 0000000000..dc284d737a --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensInterface01.baseline.jsonc @@ -0,0 +1,242 @@ +// === Code Lenses === +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class /*CODELENS: 0 references*/Point implements Pointable { +// getX(): number { +// return 0; +// } +// --- (line: 7) skipped --- + + + +// === Code Lenses === +// === /objectPointable.ts === +// import { Pointable } from "./pointable"; +// +// let x = 0; +// let y = 0; +// const p: Pointable = { +// [|getX|](): number { +// return x; +// }, +// getY(): number { +// --- (line: 10) skipped --- + +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class Point implements Pointable { +// /*CODELENS: 1 reference*/getX(): number { +// return 0; +// } +// getY(): number { +// --- (line: 8) skipped --- + + + +// === Code Lenses === +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class Point implements Pointable { +// /*CODELENS: 0 implementations*/getX(): number { +// return 0; +// } +// getY(): number { +// --- (line: 8) skipped --- + + + +// === Code Lenses === +// === /objectPointable.ts === +// --- (line: 5) skipped --- +// getX(): number { +// return x; +// }, +// [|getY|](): number { +// return y; +// }, +// }; +// + +// === /classPointable.ts === +// --- (line: 3) skipped --- +// getX(): number { +// return 0; +// } +// /*CODELENS: 1 reference*/getY(): number { +// return 0; +// } +// } +// + + + +// === Code Lenses === +// === /classPointable.ts === +// --- (line: 3) skipped --- +// getX(): number { +// return 0; +// } +// /*CODELENS: 0 implementations*/getY(): number { +// return 0; +// } +// } +// + + + +// === Code Lenses === +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class Point implements [|Pointable|] { +// getX(): number { +// return 0; +// } +// --- (line: 7) skipped --- + +// === /objectPointable.ts === +// import { Pointable } from "./pointable"; +// +// let x = 0; +// let y = 0; +// const p: [|Pointable|] = { +// getX(): number { +// return x; +// }, +// --- (line: 9) skipped --- + +// === /pointable.ts === +// export interface /*CODELENS: 2 references*/Pointable { +// getX(): number; +// getY(): number; +// } +// + + + +// === Code Lenses === +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class [|Point|] implements Pointable { +// getX(): number { +// return 0; +// } +// --- (line: 7) skipped --- + +// === /pointable.ts === +// export interface /*CODELENS: 1 implementation*/Pointable { +// getX(): number; +// getY(): number; +// } +// + + + +// === Code Lenses === +// === /objectPointable.ts === +// import { Pointable } from "./pointable"; +// +// let x = 0; +// let y = 0; +// const p: Pointable = { +// [|getX|](): number { +// return x; +// }, +// getY(): number { +// --- (line: 10) skipped --- + +// === /pointable.ts === +// export interface Pointable { +// /*CODELENS: 1 reference*/getX(): number; +// getY(): number; +// } +// + + + +// === Code Lenses === +// === /classPointable.ts === +// import { Pointable } from "./pointable"; +// +// class Point implements Pointable { +// [|getX|](): number { +// return 0; +// } +// getY(): number { +// --- (line: 8) skipped --- + +// === /objectPointable.ts === +// import { Pointable } from "./pointable"; +// +// let x = 0; +// let y = 0; +// const p: Pointable = { +// [|getX|](): number { +// return x; +// }, +// getY(): number { +// --- (line: 10) skipped --- + +// === /pointable.ts === +// export interface Pointable { +// /*CODELENS: 2 implementations*/getX(): number; +// getY(): number; +// } +// + + + +// === Code Lenses === +// === /objectPointable.ts === +// --- (line: 5) skipped --- +// getX(): number { +// return x; +// }, +// [|getY|](): number { +// return y; +// }, +// }; +// + +// === /pointable.ts === +// export interface Pointable { +// getX(): number; +// /*CODELENS: 1 reference*/getY(): number; +// } +// + + + +// === Code Lenses === +// === /classPointable.ts === +// --- (line: 3) skipped --- +// getX(): number { +// return 0; +// } +// [|getY|](): number { +// return 0; +// } +// } +// + +// === /objectPointable.ts === +// --- (line: 5) skipped --- +// getX(): number { +// return x; +// }, +// [|getY|](): number { +// return y; +// }, +// }; +// + +// === /pointable.ts === +// export interface Pointable { +// getX(): number; +// /*CODELENS: 2 implementations*/getY(): number; +// } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensOverloads01.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensOverloads01.baseline.jsonc new file mode 100644 index 0000000000..f8163d73a4 --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensOverloads01.baseline.jsonc @@ -0,0 +1,16 @@ +// === Code Lenses === +// === /codeLensOverloads01.ts === +// export function /*CODELENS: 3 references*/foo(x: number): number; +// export function foo(x: string): string; +// export function foo(x: string | number): string | number { +// return x; +// } +// +// [|foo|](1); +// +// [|foo|]("hello"); +// +// // This one isn't expected to match any overload, +// // but is really just here to test how it affects how code lens. +// [|foo|](Math.random() ? 1 : "hello"); +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=false.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=false.baseline.jsonc new file mode 100644 index 0000000000..09d45e997c --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=false.baseline.jsonc @@ -0,0 +1,32 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=false.ts === +// export abstract class /*CODELENS: 0 implementations*/ABC { +// abstract methodA(): void; +// methodB(): void {} +// #methodC(): void {} +// --- (line: 5) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=false.ts === +// export abstract class ABC { +// abstract /*CODELENS: 0 implementations*/methodA(): void; +// methodB(): void {} +// #methodC(): void {} +// protected methodD(): void {} +// --- (line: 6) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=false.ts === +// --- (line: 3) skipped --- +// #methodC(): void {} +// protected methodD(): void {} +// private methodE(): void {} +// protected abstract /*CODELENS: 0 implementations*/methodG(): void; +// public methodH(): void {} +// +// static methodStaticA(): void {} +// --- (line: 11) skipped --- \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=true.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=true.baseline.jsonc new file mode 100644 index 0000000000..7da1d95f5d --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllClassMethods=true.baseline.jsonc @@ -0,0 +1,101 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// export abstract class /*CODELENS: 0 implementations*/ABC { +// abstract methodA(): void; +// methodB(): void {} +// #methodC(): void {} +// --- (line: 5) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// export abstract class ABC { +// abstract /*CODELENS: 0 implementations*/methodA(): void; +// methodB(): void {} +// #methodC(): void {} +// protected methodD(): void {} +// --- (line: 6) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// export abstract class ABC { +// abstract methodA(): void; +// /*CODELENS: 0 implementations*/methodB(): void {} +// #methodC(): void {} +// protected methodD(): void {} +// private methodE(): void {} +// --- (line: 7) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// export abstract class ABC { +// abstract methodA(): void; +// methodB(): void {} +// #methodC(): void {} +// protected /*CODELENS: 0 implementations*/methodD(): void {} +// private methodE(): void {} +// protected abstract methodG(): void; +// public methodH(): void {} +// --- (line: 9) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// --- (line: 3) skipped --- +// #methodC(): void {} +// protected methodD(): void {} +// private methodE(): void {} +// protected abstract /*CODELENS: 0 implementations*/methodG(): void; +// public methodH(): void {} +// +// static methodStaticA(): void {} +// --- (line: 11) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// --- (line: 4) skipped --- +// protected methodD(): void {} +// private methodE(): void {} +// protected abstract methodG(): void; +// public /*CODELENS: 0 implementations*/methodH(): void {} +// +// static methodStaticA(): void {} +// protected static methodStaticB(): void {} +// --- (line: 12) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// --- (line: 6) skipped --- +// protected abstract methodG(): void; +// public methodH(): void {} +// +// static /*CODELENS: 0 implementations*/methodStaticA(): void {} +// protected static methodStaticB(): void {} +// private static methodStaticC(): void {} +// static #methodStaticD(): void {} +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllClassMethods=true.ts === +// --- (line: 7) skipped --- +// public methodH(): void {} +// +// static methodStaticA(): void {} +// protected static /*CODELENS: 0 implementations*/methodStaticB(): void {} +// private static methodStaticC(): void {} +// static #methodStaticD(): void {} +// } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=false.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=false.baseline.jsonc new file mode 100644 index 0000000000..7bb4a5657d --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=false.baseline.jsonc @@ -0,0 +1,22 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnAllFunctions=false.ts === +// export function /*CODELENS: 0 references*/f1(): void {} +// +// function f2(): void {} +// +// --- (line: 5) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllFunctions=false.ts === +// export function f1(): void {} +// +// function f2(): void {} +// +// export const /*CODELENS: 0 references*/f3 = () => {}; +// +// const f4 = () => {}; +// +// const f5 = function() {}; +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=true.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=true.baseline.jsonc new file mode 100644 index 0000000000..b890c7f5c1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnAllFunctions=true.baseline.jsonc @@ -0,0 +1,34 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnAllFunctions=true.ts === +// export function /*CODELENS: 0 references*/f1(): void {} +// +// function f2(): void {} +// +// --- (line: 5) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllFunctions=true.ts === +// export function f1(): void {} +// +// function /*CODELENS: 0 references*/f2(): void {} +// +// export const f3 = () => {}; +// +// --- (line: 7) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnAllFunctions=true.ts === +// export function f1(): void {} +// +// function f2(): void {} +// +// export const /*CODELENS: 0 references*/f3 = () => {}; +// +// const f4 = () => {}; +// +// const f5 = function() {}; +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=false.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=false.baseline.jsonc new file mode 100644 index 0000000000..5f9918a03c --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=false.baseline.jsonc @@ -0,0 +1,78 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=false.ts === +// export interface /*CODELENS: 3 implementations*/I { +// methodA(): void; +// } +// export interface I { +// methodB(): void; +// } +// +// interface [|J|] extends I { +// methodB(): void; +// methodC(): void; +// } +// +// class [|C|] implements J { +// methodA(): void {} +// methodB(): void {} +// methodC(): void {} +// } +// +// class [|AbstractC|] implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=false.ts === +// --- (line: 4) skipped --- +// methodB(): void; +// } +// +// interface /*CODELENS: 2 implementations*/J extends I { +// methodB(): void; +// methodC(): void; +// } +// +// class [|C|] implements J { +// methodA(): void {} +// methodB(): void {} +// methodC(): void {} +// } +// +// class [|AbstractC|] implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=false.ts === +// --- (line: 16) skipped --- +// } +// +// class AbstractC implements J { +// abstract /*CODELENS: 0 implementations*/methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=false.ts === +// --- (line: 18) skipped --- +// class AbstractC implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract /*CODELENS: 0 implementations*/methodC(): void; +// } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=true.baseline.jsonc b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=true.baseline.jsonc new file mode 100644 index 0000000000..cf498182d5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/codeLenses/codeLensReferencesShowOnInterfaceMethods=true.baseline.jsonc @@ -0,0 +1,173 @@ +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// export interface /*CODELENS: 3 implementations*/I { +// methodA(): void; +// } +// export interface I { +// methodB(): void; +// } +// +// interface [|J|] extends I { +// methodB(): void; +// methodC(): void; +// } +// +// class [|C|] implements J { +// methodA(): void {} +// methodB(): void {} +// methodC(): void {} +// } +// +// class [|AbstractC|] implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// export interface I { +// /*CODELENS: 1 implementation*/methodA(): void; +// } +// export interface I { +// methodB(): void; +// --- (line: 6) skipped --- + +// --- (line: 10) skipped --- +// } +// +// class C implements J { +// [|methodA|](): void {} +// methodB(): void {} +// methodC(): void {} +// } +// --- (line: 18) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// export interface I { +// methodA(): void; +// } +// export interface I { +// /*CODELENS: 2 implementations*/methodB(): void; +// } +// +// interface J extends I { +// methodB(): void; +// methodC(): void; +// } +// +// class C implements J { +// methodA(): void {} +// [|methodB|](): void {} +// methodC(): void {} +// } +// +// class AbstractC implements J { +// abstract methodA(): void; +// [|methodB|](): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// --- (line: 4) skipped --- +// methodB(): void; +// } +// +// interface /*CODELENS: 2 implementations*/J extends I { +// methodB(): void; +// methodC(): void; +// } +// +// class [|C|] implements J { +// methodA(): void {} +// methodB(): void {} +// methodC(): void {} +// } +// +// class [|AbstractC|] implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// --- (line: 5) skipped --- +// } +// +// interface J extends I { +// /*CODELENS: 2 implementations*/methodB(): void; +// methodC(): void; +// } +// +// class C implements J { +// methodA(): void {} +// [|methodB|](): void {} +// methodC(): void {} +// } +// +// class AbstractC implements J { +// abstract methodA(): void; +// [|methodB|](): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// --- (line: 6) skipped --- +// +// interface J extends I { +// methodB(): void; +// /*CODELENS: 1 implementation*/methodC(): void; +// } +// +// class C implements J { +// methodA(): void {} +// methodB(): void {} +// [|methodC|](): void {} +// } +// +// class AbstractC implements J { +// --- (line: 20) skipped --- + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// --- (line: 16) skipped --- +// } +// +// class AbstractC implements J { +// abstract /*CODELENS: 0 implementations*/methodA(): void; +// methodB(): void {} +// abstract methodC(): void; +// } +// + + + +// === Code Lenses === +// === /codeLensReferencesShowOnInterfaceMethods=true.ts === +// --- (line: 18) skipped --- +// class AbstractC implements J { +// abstract methodA(): void; +// methodB(): void {} +// abstract /*CODELENS: 0 implementations*/methodC(): void; +// } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline index 3403e09e0b..1b14590dcc 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline @@ -91,7 +91,7 @@ Config File Names:: "character": 29 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline index 86588d5549..46a15f07a1 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline @@ -75,7 +75,7 @@ Config File Names:: "character": 0 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline index e11f907aeb..146f249b7f 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline @@ -129,7 +129,7 @@ Config File Names:: "character": 16 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline index c07f940327..07171af38b 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline @@ -91,7 +91,7 @@ Config File Names:: "character": 38 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline index 19bddaea89..dab19dd2d9 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline @@ -73,7 +73,7 @@ Config File Names:: "character": 4 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline index fa57e3f9aa..7bea29dfe6 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline @@ -73,7 +73,7 @@ Config File Names:: "character": 4 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline index ec8c01300b..495562c581 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline @@ -91,7 +91,7 @@ Config File Names:: "character": 25 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -118,7 +118,7 @@ Config File Names:: "character": 2 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline index e544f1b7eb..fe379c37dc 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline @@ -87,7 +87,7 @@ Config File Names:: "character": 25 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -114,7 +114,7 @@ Config File Names:: "character": 2 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline index d650756384..f8e6887b3f 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -110,7 +110,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline index 26e0d60718..deff2e52f3 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -119,7 +119,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline index 26e216f15e..0792eae63f 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -110,7 +110,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline index 34ead087ea..92d0083b8e 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -119,7 +119,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline index 744a08f01c..b7c5655862 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -110,7 +110,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline index a84a5fd038..486127f0d9 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -119,7 +119,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline index b9b50f45dc..91f7b2f7dd 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -110,7 +110,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline index 8f986664fd..1e0455ffa4 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -119,7 +119,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline index 23659d8d85..fbf99a5940 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -68,7 +68,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline index 46b5b8d577..c88b86be0c 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -77,7 +77,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline index bf66bd9fe5..04c077884c 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -68,7 +68,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline index b7fcab8376..387d2817ab 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -77,7 +77,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline index e75c517c0a..10f5deff34 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -68,7 +68,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline index d98007bb4b..b20b88cacd 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -77,7 +77,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline index fd2ef7802c..634f5d5ab0 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -68,7 +68,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline index 455c0744bc..be1499ba2e 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -77,7 +77,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline index 109e42807c..1cf21205b1 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline @@ -412,7 +412,7 @@ Config File Names:: "character": 1 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline index 176a89c9d9..e051740ac2 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline @@ -108,7 +108,7 @@ Config File Names:: "character": 16 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline index 4707f0a907..658e491242 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline @@ -114,7 +114,7 @@ Config File Names:: "character": 26 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -205,7 +205,7 @@ Config:: "character": 26 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline index aaf116174f..22558923b8 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline @@ -387,7 +387,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -465,7 +465,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline index d98432e861..e09956e1dc 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline @@ -137,7 +137,7 @@ Config File Names:: "character": 16 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline index 1c5b3a7160..8d8dd028ab 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline @@ -342,7 +342,7 @@ Config File Names:: "character": 16 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline index 9c58b15719..ba44b28478 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline @@ -331,7 +331,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -405,7 +405,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline index 5eaa2c7552..43a1190dc9 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline @@ -504,7 +504,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -580,7 +580,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline index 5a6e45d798..3b8eae0e67 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline @@ -490,7 +490,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -565,7 +565,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline index 2f2df123c2..19287e15a1 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline @@ -505,7 +505,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -581,7 +581,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline index 42f55d9673..4900d5c940 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline @@ -318,7 +318,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } @@ -391,7 +391,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline index 91a1f25a3a..323d02cd99 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline @@ -94,7 +94,7 @@ Config File Names:: "character": 11 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline index 950d470291..8060e5b002 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline @@ -93,7 +93,7 @@ Config File Names:: "character": 11 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline index 79d114c2db..5b71886470 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline @@ -93,7 +93,7 @@ Config File Names:: "character": 7 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline index ea029f1196..93e19e4982 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline @@ -95,7 +95,7 @@ Config File Names:: "character": 9 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline index 00d57bb417..2b1d25aaa1 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline @@ -93,7 +93,7 @@ Config File Names:: "character": 11 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } } diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline index d1dde71935..78d043b553 100644 --- a/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline +++ b/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline @@ -280,7 +280,7 @@ Config File Names:: "character": 13 }, "context": { - "includeDeclaration": false + "includeDeclaration": true } } }