From 73bf2684ac0dfe9cf89fb0fa3a161202c7fba336 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 13 Jun 2019 12:25:02 -0700 Subject: [PATCH] Rename to use contextSpan --- src/harness/client.ts | 6 +- src/harness/fourslash.ts | 12 ++-- src/server/protocol.ts | 24 +++---- src/server/session.ts | 68 +++++++++---------- src/services/findAllReferences.ts | 54 +++++++-------- src/services/goToDefinition.ts | 4 +- src/services/services.ts | 4 +- src/services/types.ts | 6 +- .../unittests/tsserver/declarationFileMaps.ts | 54 +++++++-------- src/testRunner/unittests/tsserver/helpers.ts | 38 +++++------ .../unittests/tsserver/projectReferences.ts | 22 +++--- src/testRunner/unittests/tsserver/rename.ts | 22 +++--- src/testRunner/unittests/tsserver/symLinks.ts | 4 +- .../reference/api/tsserverlibrary.d.ts | 32 ++++----- tests/baselines/reference/api/typescript.d.ts | 6 +- .../fourslash/ambientShorthandFindAllRefs.ts | 4 +- ...cellationWhenfindingAllRefsOnDefinition.ts | 2 +- .../fourslash/doubleUnderscoreRenames.ts | 4 +- .../fourslash/duplicatePackageServices.ts | 8 +-- .../esModuleInteropFindAllReferences.ts | 2 +- .../esModuleInteropFindAllReferences2.ts | 2 +- ...rPropertyAccessExpressionHeritageClause.ts | 2 +- .../findAllReferencesDynamicImport1.ts | 4 +- .../findAllReferencesDynamicImport2.ts | 2 +- .../findAllReferencesDynamicImport3.ts | 4 +- .../findAllReferencesJSDocFunctionNew.ts | 2 +- .../findAllReferencesOfConstructor.ts | 6 +- ...dAllReferencesOfConstructor_badOverload.ts | 4 +- .../findAllReferencesOfJsonModule.ts | 2 +- ...findAllReferencesUmdModuleAsGlobalConst.ts | 6 +- tests/cases/fourslash/findAllRefsBadImport.ts | 2 +- .../fourslash/findAllRefsClassExpression0.ts | 4 +- .../fourslash/findAllRefsClassExpression1.ts | 4 +- .../fourslash/findAllRefsClassExpression2.ts | 4 +- .../findAllRefsClassWithStaticThisAccess.ts | 2 +- .../findAllRefsConstructorFunctions.ts | 4 +- .../fourslash/findAllRefsDeclareClass.ts | 2 +- .../fourslash/findAllRefsDefaultImport.ts | 4 +- ...indAllRefsDefaultImportThroughNamespace.ts | 4 +- .../cases/fourslash/findAllRefsDefinition.ts | 2 +- .../findAllRefsDestructureGeneric.ts | 4 +- .../fourslash/findAllRefsDestructureGetter.ts | 6 +- .../findAllRefsDestructureGetter2.ts | 6 +- .../fourslash/findAllRefsEnumAsNamespace.ts | 2 +- .../fourslash/findAllRefsExportAsNamespace.ts | 4 +- .../findAllRefsExportConstEqualToClass.ts | 6 +- ...indAllRefsExportDefaultClassConstructor.ts | 2 +- .../fourslash/findAllRefsExportEquals.ts | 6 +- .../findAllRefsExportNotAtTopLevel.ts | 2 +- .../findAllRefsForComputedProperties.ts | 6 +- .../findAllRefsForComputedProperties2.ts | 6 +- .../fourslash/findAllRefsForDefaultExport.ts | 4 +- .../findAllRefsForDefaultExport01.ts | 2 +- .../findAllRefsForDefaultExport02.ts | 4 +- .../findAllRefsForDefaultExport03.ts | 6 +- .../findAllRefsForDefaultExport04.ts | 6 +- .../findAllRefsForDefaultExport08.ts | 2 +- .../findAllRefsForDefaultExportAnonymous.ts | 4 +- .../findAllRefsForDefaultExport_anonymous.ts | 4 +- .../findAllRefsForDefaultExport_reExport.ts | 8 +-- ...t_reExport_allowSyntheticDefaultImports.ts | 8 +-- .../findAllRefsForFunctionExpression01.ts | 2 +- .../fourslash/findAllRefsForMappedType.ts | 6 +- tests/cases/fourslash/findAllRefsForModule.ts | 4 +- .../fourslash/findAllRefsForModuleGlobal.ts | 4 +- .../findAllRefsForObjectLiteralProperties.ts | 4 +- .../fourslash/findAllRefsForObjectSpread.ts | 4 +- tests/cases/fourslash/findAllRefsForRest.ts | 2 +- .../findAllRefsForUMDModuleAlias1.ts | 2 +- ...findAllRefsForVariableInExtendsClause01.ts | 2 +- ...findAllRefsForVariableInExtendsClause02.ts | 2 +- .../findAllRefsGlobalModuleAugmentation.ts | 2 +- .../fourslash/findAllRefsImportDefault.ts | 6 +- .../fourslash/findAllRefsImportEquals.ts | 2 +- .../findAllRefsImportEqualsJsonFile.ts | 4 +- .../cases/fourslash/findAllRefsImportNamed.ts | 4 +- .../findAllRefsImportStarOfExportEquals.ts | 10 +-- .../cases/fourslash/findAllRefsImportType.ts | 2 +- .../fourslash/findAllRefsInClassExpression.ts | 4 +- .../findAllRefsIndexedAccessTypes.ts | 4 +- .../findAllRefsInheritedProperties1.ts | 4 +- .../findAllRefsInheritedProperties2.ts | 4 +- .../findAllRefsInheritedProperties3.ts | 12 ++-- .../findAllRefsInheritedProperties4.ts | 6 +- .../findAllRefsInheritedProperties5.ts | 6 +- .../fourslash/findAllRefsInsideTemplates1.ts | 2 +- .../fourslash/findAllRefsInsideTemplates2.ts | 2 +- .../fourslash/findAllRefsInsideWithBlock.ts | 2 +- .../fourslash/findAllRefsJsDocTypeDef_js.ts | 2 +- .../cases/fourslash/findAllRefsMappedType.ts | 2 +- .../findAllRefsModuleAugmentation.ts | 2 +- .../fourslash/findAllRefsModuleDotExports.ts | 4 +- .../fourslash/findAllRefsNoImportClause.ts | 2 +- ...lRefsObjectBindingElementPropertyName01.ts | 4 +- ...lRefsObjectBindingElementPropertyName02.ts | 4 +- ...lRefsObjectBindingElementPropertyName03.ts | 4 +- ...lRefsObjectBindingElementPropertyName04.ts | 6 +- ...lRefsObjectBindingElementPropertyName06.ts | 10 +-- ...lRefsObjectBindingElementPropertyName07.ts | 2 +- ...lRefsObjectBindingElementPropertyName10.ts | 4 +- .../fourslash/findAllRefsOfConstructor.ts | 4 +- .../fourslash/findAllRefsOfConstructor2.ts | 6 +- .../findAllRefsOfConstructor_multipleFiles.ts | 10 +-- .../findAllRefsOfConstructor_withModifier.ts | 2 +- .../fourslash/findAllRefsOnDecorators.ts | 2 +- .../fourslash/findAllRefsOnDefinition.ts | 2 +- .../fourslash/findAllRefsOnDefinition2.ts | 2 +- .../fourslash/findAllRefsOnImportAliases.ts | 6 +- .../fourslash/findAllRefsOnImportAliases2.ts | 6 +- .../findAllRefsOnPrivateParameterProperty1.ts | 2 +- ...indAllRefsParameterPropertyDeclaration1.ts | 2 +- ...indAllRefsParameterPropertyDeclaration2.ts | 2 +- ...indAllRefsParameterPropertyDeclaration3.ts | 2 +- ...arameterPropertyDeclaration_inheritance.ts | 4 +- .../findAllRefsPrefixSuffixPreference.ts | 10 +-- ...sPropertyContextuallyTypedByTypeParam01.ts | 6 +- .../fourslash/findAllRefsReExportLocal.ts | 8 +-- ...findAllRefsReExportRightNameWrongSymbol.ts | 10 +-- .../fourslash/findAllRefsReExportStar.ts | 4 +- .../fourslash/findAllRefsReExport_broken.ts | 2 +- .../fourslash/findAllRefsReExport_broken2.ts | 2 +- tests/cases/fourslash/findAllRefsReExports.ts | 16 ++--- .../cases/fourslash/findAllRefsReExports2.ts | 4 +- ...efsRedeclaredPropertyInDerivedInterface.ts | 8 +-- .../findAllRefsRenameImportWithSameName.ts | 4 +- .../cases/fourslash/findAllRefsRootSymbols.ts | 6 +- .../cases/fourslash/findAllRefsThisKeyword.ts | 2 +- tests/cases/fourslash/findAllRefsTypedef.ts | 2 +- .../findAllRefsTypedef_importType.ts | 2 +- .../fourslash/findAllRefsTypeofImport.ts | 2 +- .../fourslash/findAllRefsUnionProperty.ts | 8 +-- .../findAllRefsWithLeadingUnderscoreNames1.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames2.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames3.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames4.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames5.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames6.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames7.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames8.ts | 2 +- .../findAllRefsWithLeadingUnderscoreNames9.ts | 2 +- ...dAllRefsWithShorthandPropertyAssignment.ts | 4 +- ...AllRefsWithShorthandPropertyAssignment2.ts | 4 +- .../findAllRefs_importType_exportEquals.ts | 10 +-- .../fourslash/findAllRefs_importType_js.ts | 8 +-- ...indAllRefs_importType_meaningAtLocation.ts | 4 +- .../fourslash/findAllRefs_importType_named.ts | 4 +- .../findAllRefs_importType_typeofImport.ts | 4 +- tests/cases/fourslash/findAllRefs_jsEnum.ts | 2 +- .../findReferencesAcrossMultipleProjects.ts | 2 +- .../fourslash/findReferencesAfterEdit.ts | 2 +- .../fourslash/findReferencesJSXTagName.ts | 6 +- .../fourslash/findReferencesJSXTagName2.ts | 2 +- .../fourslash/findReferencesJSXTagName3.ts | 14 ++-- ...tOccurrencesIsDefinitionOfArrowFunction.ts | 2 +- ...OccurrencesIsDefinitionOfBindingPattern.ts | 2 +- .../getOccurrencesIsDefinitionOfClass.ts | 2 +- ...currencesIsDefinitionOfComputedProperty.ts | 2 +- .../getOccurrencesIsDefinitionOfEnum.ts | 2 +- .../getOccurrencesIsDefinitionOfExport.ts | 4 +- .../getOccurrencesIsDefinitionOfFunction.ts | 2 +- .../getOccurrencesIsDefinitionOfInterface.ts | 2 +- ...rencesIsDefinitionOfInterfaceClassMerge.ts | 6 +- .../getOccurrencesIsDefinitionOfNamespace.ts | 2 +- ...rencesIsDefinitionOfNumberNamedProperty.ts | 2 +- .../getOccurrencesIsDefinitionOfParameter.ts | 2 +- ...rencesIsDefinitionOfStringNamedProperty.ts | 2 +- .../getOccurrencesIsDefinitionOfTypeAlias.ts | 2 +- .../getOccurrencesIsDefinitionOfVariable.ts | 2 +- tests/cases/fourslash/javaScriptClass2.ts | 4 +- tests/cases/fourslash/jsDocServices.ts | 2 +- .../jsdocTypedefTagSemanticMeaning0.ts | 4 +- .../jsdocTypedefTagSemanticMeaning1.ts | 2 +- .../fourslash/jsdocTypedefTagServices.ts | 2 +- tests/cases/fourslash/jsxSpreadReference.ts | 2 +- tests/cases/fourslash/localGetReferences.ts | 14 ++-- ...referenceInParameterPropertyDeclaration.ts | 6 +- tests/cases/fourslash/referenceToClass.ts | 2 +- .../cases/fourslash/referencesBloomFilters.ts | 4 +- .../fourslash/referencesBloomFilters2.ts | 4 +- .../fourslash/referencesBloomFilters3.ts | 2 +- .../cases/fourslash/referencesForAmbients.ts | 10 +-- .../cases/fourslash/referencesForAmbients2.ts | 2 +- .../fourslash/referencesForClassLocal.ts | 2 +- .../fourslash/referencesForClassMembers.ts | 8 +-- ...esForClassMembersExtendingAbstractClass.ts | 8 +-- ...cesForClassMembersExtendingGenericClass.ts | 8 +-- .../fourslash/referencesForClassParameter.ts | 2 +- ...ontextuallyTypedObjectLiteralProperties.ts | 16 ++--- ...ncesForContextuallyTypedUnionProperties.ts | 18 ++--- ...cesForContextuallyTypedUnionProperties2.ts | 14 ++-- tests/cases/fourslash/referencesForEnums.ts | 6 +- .../fourslash/referencesForExportedValues.ts | 2 +- .../referencesForExternalModuleNames.ts | 4 +- .../referencesForFunctionOverloads.ts | 4 +- .../referencesForFunctionParameter.ts | 2 +- tests/cases/fourslash/referencesForGlobals.ts | 2 +- .../cases/fourslash/referencesForGlobals2.ts | 2 +- .../cases/fourslash/referencesForGlobals3.ts | 2 +- .../cases/fourslash/referencesForGlobals4.ts | 2 +- .../cases/fourslash/referencesForGlobals5.ts | 2 +- .../referencesForGlobalsInExternalModule.ts | 8 +-- .../referencesForIllegalAssignment.ts | 2 +- tests/cases/fourslash/referencesForImports.ts | 4 +- .../fourslash/referencesForIndexProperty.ts | 4 +- .../fourslash/referencesForIndexProperty3.ts | 2 +- .../referencesForInheritedProperties.ts | 6 +- .../referencesForInheritedProperties2.ts | 6 +- .../referencesForInheritedProperties3.ts | 4 +- .../referencesForInheritedProperties4.ts | 4 +- .../referencesForInheritedProperties5.ts | 8 +-- .../referencesForInheritedProperties6.ts | 4 +- .../referencesForInheritedProperties7.ts | 12 ++-- .../referencesForInheritedProperties8.ts | 6 +- .../referencesForInheritedProperties9.ts | 4 +- tests/cases/fourslash/referencesForLabel.ts | 8 +-- tests/cases/fourslash/referencesForLabel3.ts | 2 +- tests/cases/fourslash/referencesForLabel4.ts | 4 +- tests/cases/fourslash/referencesForLabel5.ts | 10 +-- tests/cases/fourslash/referencesForLabel6.ts | 4 +- .../referencesForMergedDeclarations.ts | 6 +- .../referencesForMergedDeclarations2.ts | 2 +- .../referencesForMergedDeclarations3.ts | 4 +- .../referencesForMergedDeclarations4.ts | 4 +- .../referencesForMergedDeclarations5.ts | 8 +-- .../referencesForMergedDeclarations6.ts | 2 +- .../referencesForMergedDeclarations7.ts | 6 +- .../referencesForMergedDeclarations8.ts | 2 +- ...eferencesForNumericLiteralPropertyNames.ts | 6 +- .../referencesForObjectLiteralProperties.ts | 2 +- .../cases/fourslash/referencesForOverrides.ts | 28 ++++---- .../referencesForPropertiesOfGenericType.ts | 2 +- tests/cases/fourslash/referencesForStatic.ts | 2 +- ...rencesForStaticsAndMembersWithSameNames.ts | 8 +-- ...referencesForStringLiteralPropertyNames.ts | 6 +- ...eferencesForStringLiteralPropertyNames2.ts | 2 +- ...eferencesForStringLiteralPropertyNames3.ts | 4 +- ...eferencesForStringLiteralPropertyNames4.ts | 2 +- ...eferencesForStringLiteralPropertyNames5.ts | 2 +- ...eferencesForStringLiteralPropertyNames7.ts | 4 +- .../fourslash/referencesForUnionProperties.ts | 6 +- tests/cases/fourslash/remoteGetReferences.ts | 8 +-- .../fourslash/renameAcrossMultipleProjects.ts | 2 +- tests/cases/fourslash/renameAlias.ts | 2 +- tests/cases/fourslash/renameAlias2.ts | 2 +- tests/cases/fourslash/renameAlias3.ts | 2 +- .../fourslash/renameAliasExternalModule.ts | 2 +- .../fourslash/renameAliasExternalModule2.ts | 6 +- .../fourslash/renameAliasExternalModule3.ts | 2 +- .../fourslash/renameCommentsAndStrings1.ts | 2 +- .../fourslash/renameCommentsAndStrings2.ts | 2 +- .../fourslash/renameCommentsAndStrings3.ts | 2 +- .../fourslash/renameCommentsAndStrings4.ts | 2 +- .../renameContextuallyTypedProperties.ts | 22 +++--- .../renameContextuallyTypedProperties2.ts | 22 +++--- tests/cases/fourslash/renameCrossJsTs01.ts | 4 +- tests/cases/fourslash/renameDefaultImport.ts | 4 +- .../renameDefaultImportDifferentName.ts | 4 +- .../fourslash/renameDefaultLibDontWork.ts | 2 +- .../renameDestructuringAssignment.ts | 4 +- .../renameDestructuringAssignmentInFor.ts | 8 +-- .../renameDestructuringAssignmentInForOf.ts | 8 +-- ...ructuringAssignmentNestedInArrayLiteral.ts | 8 +-- ...enameDestructuringAssignmentNestedInFor.ts | 8 +-- ...nameDestructuringAssignmentNestedInFor2.ts | 8 +-- ...ameDestructuringAssignmentNestedInForOf.ts | 8 +-- ...meDestructuringAssignmentNestedInForOf2.ts | 8 +-- .../renameDestructuringClassProperty.ts | 8 +-- .../renameDestructuringDeclarationInFor.ts | 6 +- .../renameDestructuringDeclarationInForOf.ts | 6 +- .../renameDestructuringFunctionParameter.ts | 2 +- ...renameDestructuringNestedBindingElement.ts | 6 +- .../fourslash/renameForDefaultExport01.ts | 2 +- .../fourslash/renameForDefaultExport02.ts | 2 +- .../fourslash/renameForDefaultExport03.ts | 6 +- .../cases/fourslash/renameImportAndExport.ts | 4 +- .../renameImportAndExportInDiffFiles.ts | 6 +- .../fourslash/renameImportAndShorthand.ts | 2 +- .../renameImportNamespaceAndShorthand.ts | 2 +- .../fourslash/renameImportOfExportEquals.ts | 12 ++-- .../fourslash/renameImportOfExportEquals2.ts | 10 +-- .../cases/fourslash/renameImportOfReExport.ts | 6 +- .../fourslash/renameImportOfReExport2.ts | 6 +- tests/cases/fourslash/renameImportRequire.ts | 8 +-- .../fourslash/renameInheritedProperties1.ts | 2 +- .../fourslash/renameInheritedProperties2.ts | 2 +- .../fourslash/renameInheritedProperties3.ts | 2 +- .../fourslash/renameInheritedProperties4.ts | 2 +- .../fourslash/renameInheritedProperties5.ts | 2 +- .../fourslash/renameInheritedProperties6.ts | 2 +- .../fourslash/renameInheritedProperties7.ts | 2 +- .../fourslash/renameInheritedProperties8.ts | 4 +- tests/cases/fourslash/renameJsExports01.ts | 2 +- tests/cases/fourslash/renameJsExports02.ts | 4 +- tests/cases/fourslash/renameJsExports03.ts | 8 +-- .../fourslash/renameJsPropertyAssignment.ts | 2 +- .../fourslash/renameJsPropertyAssignment2.ts | 2 +- .../fourslash/renameJsPropertyAssignment3.ts | 2 +- .../fourslash/renameJsPrototypeProperty01.ts | 4 +- .../fourslash/renameJsPrototypeProperty02.ts | 4 +- .../cases/fourslash/renameJsThisProperty01.ts | 4 +- .../cases/fourslash/renameJsThisProperty03.ts | 4 +- .../cases/fourslash/renameJsThisProperty05.ts | 4 +- .../cases/fourslash/renameJsThisProperty06.ts | 4 +- .../renameLocationsForClassExpression01.ts | 2 +- .../renameLocationsForFunctionExpression01.ts | 2 +- .../renameLocationsForFunctionExpression02.ts | 2 +- ...enameObjectBindingElementPropertyName01.ts | 4 +- tests/cases/fourslash/renameObjectSpread.ts | 4 +- .../fourslash/renameObjectSpreadAssignment.ts | 4 +- .../renameParameterPropertyDeclaration1.ts | 2 +- .../renameParameterPropertyDeclaration2.ts | 2 +- .../renameParameterPropertyDeclaration3.ts | 2 +- .../renameParameterPropertyDeclaration4.ts | 2 +- .../renameParameterPropertyDeclaration5.ts | 2 +- ...ePropertyAccessExpressionHeritageClause.ts | 2 +- .../cases/fourslash/renameReExportDefault.ts | 10 +-- tests/cases/fourslash/renameRest.ts | 2 +- .../fourslash/renameStringPropertyNames.ts | 4 +- tests/cases/fourslash/renameThis.ts | 2 +- .../cases/fourslash/renameUMDModuleAlias1.ts | 2 +- .../server/jsdocCallbackTagRename01.ts | 2 +- .../server/jsdocTypedefTagRename01.ts | 2 +- .../server/jsdocTypedefTagRename02.ts | 2 +- .../server/jsdocTypedefTagRename03.ts | 2 +- tests/cases/fourslash/server/rename01.ts | 2 +- .../server/renameInConfiguredProject.ts | 2 +- .../shims-pp/getReferencesAtPosition.ts | 2 +- .../cases/fourslash/shims-pp/getRenameInfo.ts | 2 +- .../shims/getReferencesAtPosition.ts | 2 +- tests/cases/fourslash/shims/getRenameInfo.ts | 2 +- .../fourslash/transitiveExportImports.ts | 8 +-- .../fourslash/transitiveExportImports2.ts | 6 +- .../fourslash/transitiveExportImports3.ts | 8 +-- .../cases/fourslash/tsxFindAllReferences1.ts | 4 +- .../cases/fourslash/tsxFindAllReferences10.ts | 6 +- .../cases/fourslash/tsxFindAllReferences2.ts | 4 +- .../cases/fourslash/tsxFindAllReferences3.ts | 4 +- .../cases/fourslash/tsxFindAllReferences4.ts | 4 +- .../cases/fourslash/tsxFindAllReferences5.ts | 12 ++-- .../cases/fourslash/tsxFindAllReferences7.ts | 6 +- .../cases/fourslash/tsxFindAllReferences8.ts | 18 ++--- .../cases/fourslash/tsxFindAllReferences9.ts | 4 +- .../tsxFindAllReferencesUnionElementType1.ts | 4 +- .../tsxFindAllReferencesUnionElementType2.ts | 4 +- tests/cases/fourslash/tsxRename1.ts | 4 +- tests/cases/fourslash/tsxRename2.ts | 4 +- tests/cases/fourslash/tsxRename3.ts | 4 +- tests/cases/fourslash/tsxRename4.ts | 8 +-- tests/cases/fourslash/tsxRename5.ts | 2 +- tests/cases/fourslash/tsxRename6.ts | 12 ++-- tests/cases/fourslash/tsxRename7.ts | 6 +- tests/cases/fourslash/tsxRename9.ts | 22 +++--- tests/cases/fourslash/untypedModuleImport.ts | 2 +- 353 files changed, 935 insertions(+), 935 deletions(-) diff --git a/src/harness/client.ts b/src/harness/client.ts index 777c69f9a6c..4f8e84dcdaf 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -395,12 +395,12 @@ namespace ts.server { const locations: RenameLocation[] = []; for (const entry of body.locs) { const fileName = entry.file; - for (const { start, end, declarationStart, declarationEnd, ...prefixSuffixText } of entry.locs) { + for (const { start, end, contextStart, contextEnd, ...prefixSuffixText } of entry.locs) { locations.push({ textSpan: this.decodeSpan({ start, end }, fileName), fileName, - ...(declarationStart !== undefined ? - { declarationSpan: this.decodeSpan({ start: declarationStart, end: declarationEnd! }, fileName) } : + ...(contextStart !== undefined ? + { contextSpan: this.decodeSpan({ start: contextStart, end: contextEnd! }, fileName) } : undefined), ...prefixSuffixText }); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index fd6ada47e3c..2363335519c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -956,14 +956,14 @@ namespace FourSlash { const fullExpected = ts.map(parts, ({ definition, ranges }) => ({ definition: typeof definition === "string" ? definition : { ...definition, range: ts.createTextSpanFromRange(definition.range) }, references: ranges.map(r => { - const { isWriteAccess = false, isDefinition = false, isInString, declarationRangeIndex } = (r.marker && r.marker.data || {}) as { isWriteAccess?: boolean, isDefinition?: boolean, isInString?: true, declarationRangeIndex?: number }; + const { isWriteAccess = false, isDefinition = false, isInString, contextRangeIndex } = (r.marker && r.marker.data || {}) as { isWriteAccess?: boolean, isDefinition?: boolean, isInString?: true, contextRangeIndex?: number }; return { fileName: r.fileName, textSpan: ts.createTextSpanFromRange(r), isWriteAccess, isDefinition, - ...(declarationRangeIndex !== undefined ? - { declarationSpan: ts.createTextSpanFromRange(this.getRanges()[declarationRangeIndex]) } : + ...(contextRangeIndex !== undefined ? + { contextSpan: ts.createTextSpanFromRange(this.getRanges()[contextRangeIndex]) } : undefined), ...(isInString ? { isInString: true } : undefined), }; @@ -1193,12 +1193,12 @@ Actual: ${stringify(fullActual)}`); locations && ts.sort(locations, (r1, r2) => ts.compareStringsCaseSensitive(r1.fileName, r2.fileName) || r1.textSpan.start - r2.textSpan.start); assert.deepEqual(sort(references), sort(ranges.map((rangeOrOptions): ts.RenameLocation => { const { range, ...prefixSuffixText } = "range" in rangeOrOptions ? rangeOrOptions : { range: rangeOrOptions }; - const { declarationRangeIndex } = (range.marker && range.marker.data || {}) as { declarationRangeIndex?: number; }; + const { contextRangeIndex } = (range.marker && range.marker.data || {}) as { contextRangeIndex?: number; }; return { fileName: range.fileName, textSpan: ts.createTextSpanFromRange(range), - ...(declarationRangeIndex !== undefined ? - { declarationSpan: ts.createTextSpanFromRange(this.getRanges()[declarationRangeIndex]) } : + ...(contextRangeIndex !== undefined ? + { contextSpan: ts.createTextSpanFromRange(this.getRanges()[contextRangeIndex]) } : undefined), ...prefixSuffixText }; diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 37bb8d0c045..2650cd5d765 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -872,16 +872,16 @@ namespace ts.server.protocol { file: string; } - export interface DeclarationTextSpan extends TextSpan { - declarationStart?: Location; - declarationEnd?: Location; + export interface TextSpanWithContext extends TextSpan { + contextStart?: Location; + contextEnd?: Location; } - export interface DeclarationFileSpan extends FileSpan, DeclarationTextSpan { + export interface FileSpanWithContext extends FileSpan, TextSpanWithContext { } export interface DefinitionInfoAndBoundSpan { - definitions: ReadonlyArray; + definitions: ReadonlyArray; textSpan: TextSpan; } @@ -889,7 +889,7 @@ namespace ts.server.protocol { * Definition response message. Gives text range for definition. */ export interface DefinitionResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } export interface DefinitionInfoAndBoundSpanReponse extends Response { @@ -900,14 +900,14 @@ namespace ts.server.protocol { * Definition response message. Gives text range for definition. */ export interface TypeDefinitionResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } /** * Implementation response message. Gives text range for implementations. */ export interface ImplementationResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } /** @@ -950,7 +950,7 @@ namespace ts.server.protocol { } /** @deprecated */ - export interface OccurrencesResponseItem extends DeclarationFileSpan { + export interface OccurrencesResponseItem extends FileSpanWithContext { /** * True if the occurrence is a write location, false otherwise. */ @@ -980,7 +980,7 @@ namespace ts.server.protocol { /** * Span augmented with extra information that denotes the kind of the highlighting to be used for span. */ - export interface HighlightSpan extends DeclarationTextSpan { + export interface HighlightSpan extends TextSpanWithContext { kind: HighlightSpanKind; } @@ -1015,7 +1015,7 @@ namespace ts.server.protocol { command: CommandTypes.References; } - export interface ReferencesResponseItem extends DeclarationFileSpan { + export interface ReferencesResponseItem extends FileSpanWithContext { /** Text of line containing the reference. Including this * with the response avoids latency of editor loading files * to show text of reference line (the server already has @@ -1158,7 +1158,7 @@ namespace ts.server.protocol { locs: RenameTextSpan[]; } - export interface RenameTextSpan extends DeclarationTextSpan { + export interface RenameTextSpan extends TextSpanWithContext { readonly prefixText?: string; readonly suffixText?: string; } diff --git a/src/server/session.ts b/src/server/session.ts index 7ecc569b6a8..5064b529560 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -362,7 +362,7 @@ namespace ts.server { ...outputReferencedSymbol.definition, textSpan: createTextSpan(mappedDefinitionFile.pos, outputReferencedSymbol.definition.textSpan.length), fileName: mappedDefinitionFile.fileName, - declarationSpan: getMappedDeclarationSpan(outputReferencedSymbol.definition, project) + contextSpan: getMappedContextSpan(outputReferencedSymbol.definition, project) }; let symbolToAddTo = find(outputs, o => documentSpansEqual(o.definition, definition)); @@ -501,22 +501,22 @@ namespace ts.server { }, originalFileName: documentSpan.fileName, originalTextSpan: documentSpan.textSpan, - declarationSpan: getMappedDeclarationSpan(documentSpan, project), - originalDeclarationSpan: documentSpan.declarationSpan + contextSpan: getMappedContextSpan(documentSpan, project), + originalContextSpan: documentSpan.contextSpan }; } - function getMappedDeclarationSpan(documentSpan: DocumentSpan, project: Project): TextSpan | undefined { - const declarationSpanStart = documentSpan.declarationSpan && getMappedLocation( - { fileName: documentSpan.fileName, pos: documentSpan.declarationSpan.start }, + function getMappedContextSpan(documentSpan: DocumentSpan, project: Project): TextSpan | undefined { + const contextSpanStart = documentSpan.contextSpan && getMappedLocation( + { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start }, project ); - const declarationSpanEnd = documentSpan.declarationSpan && getMappedLocation( - { fileName: documentSpan.fileName, pos: documentSpan.declarationSpan.start + documentSpan.declarationSpan.length }, + const contextSpanEnd = documentSpan.contextSpan && getMappedLocation( + { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start + documentSpan.contextSpan.length }, project ); - return declarationSpanStart && declarationSpanEnd ? - { start: declarationSpanStart.pos, length: declarationSpanEnd.pos - declarationSpanStart.pos } : + return contextSpanStart && contextSpanEnd ? + { start: contextSpanStart.pos, length: contextSpanEnd.pos - contextSpanStart.pos } : undefined; } @@ -971,7 +971,7 @@ namespace ts.server { : diagnostics.map(d => formatDiag(file, project, d)); } - private getDefinition(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { + private getDefinition(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const position = this.getPositionInFile(args, file); const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getDefinitionAtPosition(file, position) || emptyArray, project); @@ -1026,8 +1026,8 @@ namespace ts.server { return project.getLanguageService().getEmitOutput(file); } - private mapDefinitionInfo(definitions: ReadonlyArray, project: Project): ReadonlyArray { - return definitions.map(def => this.toDeclarationFileSpan(def.fileName, def.textSpan, def.declarationSpan, project)); + private mapDefinitionInfo(definitions: ReadonlyArray, project: Project): ReadonlyArray { + return definitions.map(def => this.toFileSpanWithContext(def.fileName, def.textSpan, def.contextSpan, project)); } /* @@ -1046,8 +1046,8 @@ namespace ts.server { textSpan: def.originalTextSpan, targetFileName: def.fileName, targetTextSpan: def.textSpan, - declarationSpan: def.originalDeclarationSpan, - targetDeclarationSpan: def.declarationSpan + contextSpan: def.originalContextSpan, + targetContextSpan: def.contextSpan }; } return def; @@ -1065,15 +1065,15 @@ namespace ts.server { }; } - private toDeclarationFileSpan(fileName: string, textSpan: TextSpan, declarationSpan: TextSpan | undefined, project: Project): protocol.DeclarationFileSpan { + private toFileSpanWithContext(fileName: string, textSpan: TextSpan, contextSpan: TextSpan | undefined, project: Project): protocol.FileSpanWithContext { const fileSpan = this.toFileSpan(fileName, textSpan, project); - const declaration = declarationSpan && this.toFileSpan(fileName, declarationSpan, project); - return declaration ? - { ...fileSpan, declarationStart: declaration.start, declarationEnd: declaration.end } : + const context = contextSpan && this.toFileSpan(fileName, contextSpan, project); + return context ? + { ...fileSpan, contextStart: context.start, contextEnd: context.end } : fileSpan; } - private getTypeDefinition(args: protocol.FileLocationRequestArgs): ReadonlyArray { + private getTypeDefinition(args: protocol.FileLocationRequestArgs): ReadonlyArray { const { file, project } = this.getFileAndProject(args); const position = this.getPositionInFile(args, file); @@ -1092,12 +1092,12 @@ namespace ts.server { }); } - private getImplementation(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { + private getImplementation(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const position = this.getPositionInFile(args, file); const implementations = this.mapImplementationLocations(project.getLanguageService().getImplementationAtPosition(file, position) || emptyArray, project); return simplifiedResult ? - implementations.map(({ fileName, textSpan, declarationSpan }) => this.toDeclarationFileSpan(fileName, textSpan, declarationSpan, project)) : + implementations.map(({ fileName, textSpan, contextSpan }) => this.toFileSpanWithContext(fileName, textSpan, contextSpan, project)) : implementations.map(Session.mapToOriginalLocation); } @@ -1107,10 +1107,10 @@ namespace ts.server { const occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); return occurrences ? occurrences.map(occurrence => { - const { fileName, isWriteAccess, textSpan, isInString, declarationSpan } = occurrence; + const { fileName, isWriteAccess, textSpan, isInString, contextSpan } = occurrence; const scriptInfo = project.getScriptInfo(fileName)!; return { - ...toProtocolDeclarationTextSpan(textSpan, declarationSpan, scriptInfo), + ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), file: fileName, isWriteAccess, ...(isInString ? { isInString } : undefined) @@ -1166,8 +1166,8 @@ namespace ts.server { const scriptInfo = project.getScriptInfo(fileName)!; return { file: fileName, - highlightSpans: highlightSpans.map(({ textSpan, kind, declarationSpan }) => ({ - ...toProtocolDeclarationTextSpan(textSpan, declarationSpan, scriptInfo), + highlightSpans: highlightSpans.map(({ textSpan, kind, contextSpan }) => ({ + ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), kind })) }; @@ -1273,11 +1273,11 @@ namespace ts.server { private toSpanGroups(locations: ReadonlyArray): ReadonlyArray { const map = createMap(); - for (const { fileName, textSpan, declarationSpan, originalDeclarationSpan: _2, originalTextSpan: _, originalFileName: _1, ...prefixSuffixText } of locations) { + for (const { fileName, textSpan, contextSpan, originalContextSpan: _2, originalTextSpan: _, originalFileName: _1, ...prefixSuffixText } of locations) { let group = map.get(fileName); if (!group) map.set(fileName, group = { file: fileName, locs: [] }); const scriptInfo = Debug.assertDefined(this.projectService.getScriptInfo(fileName)); - group.locs.push({ ...toProtocolDeclarationTextSpan(textSpan, declarationSpan, scriptInfo), ...prefixSuffixText }); + group.locs.push({ ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), ...prefixSuffixText }); } return arrayFrom(map.values()); } @@ -1302,9 +1302,9 @@ namespace ts.server { const symbolStartOffset = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0; const symbolName = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, textSpanEnd(nameSpan)) : ""; const refs: ReadonlyArray = flatMap(references, referencedSymbol => - referencedSymbol.references.map(({ fileName, textSpan, declarationSpan, isWriteAccess, isDefinition }): protocol.ReferencesResponseItem => { + referencedSymbol.references.map(({ fileName, textSpan, contextSpan, isWriteAccess, isDefinition }): protocol.ReferencesResponseItem => { const scriptInfo = Debug.assertDefined(this.projectService.getScriptInfo(fileName)); - const span = toProtocolDeclarationTextSpan(textSpan, declarationSpan, scriptInfo); + const span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); const lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); const lineText = scriptInfo.getSnapshot().getText(lineSpan.start, textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); return { @@ -2565,11 +2565,11 @@ namespace ts.server { }; } - function toProtocolDeclarationTextSpan(span: TextSpan, declarationSpan: TextSpan | undefined, scriptInfo: ScriptInfo): protocol.DeclarationTextSpan { + function toProtocolTextSpanWithContext(span: TextSpan, contextSpan: TextSpan | undefined, scriptInfo: ScriptInfo): protocol.TextSpanWithContext { const textSpan = toProcolTextSpan(span, scriptInfo); - const declarationTextSpan = declarationSpan && toProcolTextSpan(declarationSpan, scriptInfo); - return declarationTextSpan ? - { ...textSpan, declarationStart: declarationTextSpan.start, declarationEnd: declarationTextSpan.end } : + const contextTextSpan = contextSpan && toProcolTextSpan(contextSpan, scriptInfo); + return contextTextSpan ? + { ...textSpan, contextStart: contextTextSpan.start, contextEnd: contextTextSpan.end } : textSpan; } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 6eb6819e433..fbe33df92a5 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -16,15 +16,15 @@ namespace ts.FindAllReferences { export const enum EntryKind { Span, Node, StringLiteral, SearchedLocalFoundProperty, SearchedPropertyFoundLocal } export type NodeEntryKind = EntryKind.Node | EntryKind.StringLiteral | EntryKind.SearchedLocalFoundProperty | EntryKind.SearchedPropertyFoundLocal; export type Entry = NodeEntry | SpanEntry; - export interface DeclarationNodeWithStartAndEnd { + export interface ContextWithStartAndEndNode { start: Node; end: Node; } - export type DeclarationNode = Node | DeclarationNodeWithStartAndEnd; + export type ContextNode = Node | ContextWithStartAndEndNode; export interface NodeEntry { readonly kind: NodeEntryKind; readonly node: Node; - readonly declaration?: DeclarationNode; + readonly context?: ContextNode; } export interface SpanEntry { readonly kind: EntryKind.Span; @@ -35,17 +35,17 @@ namespace ts.FindAllReferences { return { kind, node: (node as NamedDeclaration).name || node, - declaration: getDeclarationForDeclarationSpanForNode(node) + context: getContextNodeForNodeEntry(node) }; } - export function isDeclarationNodeWithStartAndEnd(node: DeclarationNode): node is DeclarationNodeWithStartAndEnd { + export function isContextWithStartAndEndNode(node: ContextNode): node is ContextWithStartAndEndNode { return node && (node as Node).kind === undefined; } - function getDeclarationForDeclarationSpanForNode(node: Node): DeclarationNode | undefined { + function getContextNodeForNodeEntry(node: Node): ContextNode | undefined { if (isDeclaration(node)) { - return getDeclarationForDeclarationSpan(node); + return getContextNode(node); } if (!node.parent) return undefined; @@ -61,7 +61,7 @@ namespace ts.FindAllReferences { node.parent.parent : undefined; if (binaryExpression && getAssignmentDeclarationKind(binaryExpression) !== AssignmentDeclarationKind.None) { - return getDeclarationForDeclarationSpan(binaryExpression); + return getContextNode(binaryExpression); } } @@ -83,7 +83,7 @@ namespace ts.FindAllReferences { isJSDocTag(node) )! as NamedDeclaration | Statement | JSDocTag; return isDeclaration(declOrStatement) ? - getDeclarationForDeclarationSpan(declOrStatement) : + getContextNode(declOrStatement) : declOrStatement; } } @@ -91,7 +91,7 @@ namespace ts.FindAllReferences { // Handle computed property name const propertyName = findAncestor(node, isComputedPropertyName); return propertyName ? - getDeclarationForDeclarationSpan(propertyName.parent) : + getContextNode(propertyName.parent) : undefined; } @@ -103,13 +103,13 @@ namespace ts.FindAllReferences { && node.parent.propertyName === node) || // Is default export (node.kind === SyntaxKind.DefaultKeyword && hasModifier(node.parent, ModifierFlags.ExportDefault))) { - return getDeclarationForDeclarationSpan(node.parent); + return getContextNode(node.parent); } return undefined; } - export function getDeclarationForDeclarationSpan(node: NamedDeclaration | BinaryExpression | ForInOrOfStatement | undefined): DeclarationNode | undefined { + export function getContextNode(node: NamedDeclaration | BinaryExpression | ForInOrOfStatement | undefined): ContextNode | undefined { if (!node) return undefined; switch (node.kind) { case SyntaxKind.VariableDeclaration: @@ -118,11 +118,11 @@ namespace ts.FindAllReferences { isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? - getDeclarationForDeclarationSpan(node.parent.parent) : + getContextNode(node.parent.parent) : node.parent; case SyntaxKind.BindingElement: - return getDeclarationForDeclarationSpan(node.parent.parent as NamedDeclaration); + return getContextNode(node.parent.parent as NamedDeclaration); case SyntaxKind.ImportSpecifier: return node.parent.parent.parent; @@ -149,7 +149,7 @@ namespace ts.FindAllReferences { case SyntaxKind.PropertyAssignment: case SyntaxKind.ShorthandPropertyAssignment: return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? - getDeclarationForDeclarationSpan( + getContextNode( findAncestor(node.parent, node => isBinaryExpression(node) || isForInOrOfStatement(node) ) as BinaryExpression | ForInOrOfStatement @@ -161,13 +161,13 @@ namespace ts.FindAllReferences { } } - export function toDeclarationSpan(textSpan: TextSpan, sourceFile: SourceFile, declaration?: DeclarationNode): { declarationSpan: TextSpan } | undefined { - if (!declaration) return undefined; - const declarationSpan = isDeclarationNodeWithStartAndEnd(declaration) ? - getTextSpan(declaration.start, sourceFile, declaration.end) : - getTextSpan(declaration, sourceFile); - return declarationSpan.start !== textSpan.start || declarationSpan.length !== textSpan.length ? - { declarationSpan } : + export function toContextSpan(textSpan: TextSpan, sourceFile: SourceFile, context?: ContextNode): { contextSpan: TextSpan } | undefined { + if (!context) return undefined; + const contextSpan = isContextWithStartAndEndNode(context) ? + getTextSpan(context.start, sourceFile, context.end) : + getTextSpan(context, sourceFile); + return contextSpan.start !== textSpan.start || contextSpan.length !== textSpan.length ? + { contextSpan } : undefined; } @@ -273,7 +273,7 @@ namespace ts.FindAllReferences { name, kind, displayParts, - declaration: getDeclarationForDeclarationSpan(declaration) + context: getContextNode(declaration) }; } case DefinitionKind.Label: { @@ -301,7 +301,7 @@ namespace ts.FindAllReferences { } })(); - const { node, name, kind, displayParts, declaration } = info; + const { node, name, kind, displayParts, context } = info; const sourceFile = node.getSourceFile(); const textSpan = getTextSpan(isComputedPropertyName(node) ? node.expression : node, sourceFile); return { @@ -312,7 +312,7 @@ namespace ts.FindAllReferences { name, textSpan, displayParts, - ...toDeclarationSpan(textSpan, sourceFile, declaration) + ...toContextSpan(textSpan, sourceFile, context) }; } @@ -354,7 +354,7 @@ namespace ts.FindAllReferences { return { textSpan, fileName: sourceFile.fileName, - ...toDeclarationSpan(textSpan, sourceFile, entry.declaration) + ...toContextSpan(textSpan, sourceFile, entry.context) }; } } @@ -440,7 +440,7 @@ namespace ts.FindAllReferences { textSpan: documentSpan.textSpan, kind: writeAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference, isInString: entry.kind === EntryKind.StringLiteral ? true : undefined, - ...documentSpan.declarationSpan && { declarationSpan: documentSpan.declarationSpan } + ...documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan } }; return { fileName: documentSpan.fileName, span }; } diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index efa220faf9a..fbd0be91022 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -281,10 +281,10 @@ namespace ts.GoToDefinition { name: symbolName, containerKind: undefined!, // TODO: GH#18217 containerName, - ...FindAllReferences.toDeclarationSpan( + ...FindAllReferences.toContextSpan( textSpan, sourceFile, - FindAllReferences.getDeclarationForDeclarationSpan(declaration) + FindAllReferences.getContextNode(declaration) ) }; } diff --git a/src/services/services.ts b/src/services/services.ts index 931f9cce79d..fab6f88b779 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1552,7 +1552,7 @@ namespace ts { isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference, isDefinition: false, ...highlightSpan.isInString && { isInString: true }, - ...highlightSpan.declarationSpan && { declarationSpan: highlightSpan.declarationSpan } + ...highlightSpan.contextSpan && { contextSpan: highlightSpan.contextSpan } })) ); } @@ -1577,7 +1577,7 @@ namespace ts { return { fileName: sourceFile.fileName, textSpan, - ...FindAllReferences.toDeclarationSpan(textSpan, sourceFile, node.parent) + ...FindAllReferences.toContextSpan(textSpan, sourceFile, node.parent) }; }); } diff --git a/src/services/types.ts b/src/services/types.ts index 8a185cddced..b97125734f7 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -618,8 +618,8 @@ namespace ts { * If DocumentSpan.textSpan is the span for name of the declaration, * then this is the span for relevant declaration */ - declarationSpan?: TextSpan; - originalDeclarationSpan?: TextSpan; + contextSpan?: TextSpan; + originalContextSpan?: TextSpan; } export interface RenameLocation extends DocumentSpan { @@ -654,7 +654,7 @@ namespace ts { fileName?: string; isInString?: true; textSpan: TextSpan; - declarationSpan?: TextSpan; + contextSpan?: TextSpan; kind: HighlightSpanKind; } diff --git a/src/testRunner/unittests/tsserver/declarationFileMaps.ts b/src/testRunner/unittests/tsserver/declarationFileMaps.ts index f87192f527d..0f8af3c414e 100644 --- a/src/testRunner/unittests/tsserver/declarationFileMaps.ts +++ b/src/testRunner/unittests/tsserver/declarationFileMaps.ts @@ -3,15 +3,15 @@ namespace ts.projectSystem { file: File; text: string; options?: SpanFromSubstringOptions; - declarationText?: string; - declarationOptions?: SpanFromSubstringOptions; + contextText?: string; + contextOptions?: SpanFromSubstringOptions; } - function documentSpanFromSubstring({ file, text, declarationText, options, declarationOptions }: DocumentSpanFromSubstring): DocumentSpan { - const declarationSpan = declarationText !== undefined ? documentSpanFromSubstring({ file, text: declarationText, options: declarationOptions }) : undefined; + function documentSpanFromSubstring({ file, text, contextText, options, contextOptions }: DocumentSpanFromSubstring): DocumentSpan { + const contextSpan = contextText !== undefined ? documentSpanFromSubstring({ file, text: contextText, options: contextOptions }) : undefined; return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, text, options), - ...declarationSpan && { declarationSpan: declarationSpan.textSpan } + ...contextSpan && { contextSpan: contextSpan.textSpan } }; } @@ -25,7 +25,7 @@ namespace ts.projectSystem { } function makeReferenceItem({ isDefinition, lineText, ...rest }: MakeReferenceItem): protocol.ReferencesResponseItem { return { - ...protocolDeclarationFileSpanFromSubstring(rest), + ...protocolFileSpanWithContextFromSubstring(rest), isDefinition, isWriteAccess: isDefinition, lineText, @@ -206,10 +206,10 @@ namespace ts.projectSystem { const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Definition, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: aTs, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" }) ]); verifySingleInferredProject(session); @@ -221,10 +221,10 @@ namespace ts.projectSystem { assert.deepEqual(response, { textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), definitions: [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: aTs, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" }) ], }); @@ -237,10 +237,10 @@ namespace ts.projectSystem { assert.deepEqual(response, { textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), definitions: [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: aTs, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" }) ], }); @@ -264,10 +264,10 @@ namespace ts.projectSystem { const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.TypeDefinition, protocolFileLocationFromSubstring(userTs, "instanceA")); assert.deepEqual(response, [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: aTs, text: "IfaceA", - declarationText: "export interface IfaceA {}" + contextText: "export interface IfaceA {}" }) ]); verifySingleInferredProject(session); @@ -277,10 +277,10 @@ namespace ts.projectSystem { const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Implementation, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: aTs, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" })]); verifySingleInferredProject(session); }); @@ -290,10 +290,10 @@ namespace ts.projectSystem { const response = executeSessionRequest(session, CommandNames.Definition, protocolFileLocationFromSubstring(userTs, "fnB()")); // bTs does not exist, so stick with bDts assert.deepEqual(response, [ - protocolDeclarationFileSpanFromSubstring({ + protocolFileSpanWithContextFromSubstring({ file: bDts, text: "fnB", - declarationText: "export declare function fnB(): void;" + contextText: "export declare function fnB(): void;" }) ]); verifySingleInferredProject(session); @@ -345,7 +345,7 @@ namespace ts.projectSystem { file: aTs, isDefinition: true, text: "fnA", - declarationText: "export function fnA() {}", + contextText: "export function fnA() {}", lineText: "export function fnA() {}" }); const referencesUserTs = (userTs: File): ReadonlyArray => [ @@ -398,7 +398,7 @@ namespace ts.projectSystem { ...documentSpanFromSubstring({ file: aTs, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" }), kind: ScriptElementKind.functionElement, name: "function fnA(): void", @@ -417,7 +417,7 @@ namespace ts.projectSystem { }, references: [ makeReferenceEntry({ file: userTs, /*isDefinition*/ isDefinition: false, text: "fnA" }), - makeReferenceEntry({ file: aTs, /*isDefinition*/ isDefinition: true, text: "fnA", declarationText: "export function fnA() {}" }), + makeReferenceEntry({ file: aTs, /*isDefinition*/ isDefinition: true, text: "fnA", contextText: "export function fnA() {}" }), ], }, ]); @@ -452,7 +452,7 @@ namespace ts.projectSystem { file: aTs, text: "f", options: { index: 1 }, - declarationText: "function f() {}" + contextText: "function f() {}" }), containerKind: ScriptElementKind.unknown, containerName: "", @@ -481,7 +481,7 @@ namespace ts.projectSystem { file: aTs, text: "f", options: { index: 1 }, - declarationText: "function f() {}", + contextText: "function f() {}", isDefinition: true }) ], @@ -499,7 +499,7 @@ namespace ts.projectSystem { file: bDts, isDefinition: true, text: "fnB", - declarationText: "export declare function fnB(): void;", + contextText: "export declare function fnB(): void;", lineText: "export declare function fnB(): void;" }), makeReferenceItem({ @@ -522,7 +522,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "fnA", - declarationText: "export function fnA() {}" + contextText: "export function fnA() {}" }) ], }); @@ -578,7 +578,7 @@ namespace ts.projectSystem { const response = executeSessionRequest(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual>(response, [ renameLocation({ file: userTs, text: "fnA" }), - renameLocation({ file: aTs, text: "fnA", declarationText: "export function fnA() {}" }), + renameLocation({ file: aTs, text: "fnA", contextText: "export function fnA() {}" }), ]); verifyATsConfigOriginalProject(session); }); @@ -603,7 +603,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: bDts.content, text: "fnB", - declarationText: "export declare function fnB(): void;" + contextText: "export declare function fnB(): void;" }) ], }, diff --git a/src/testRunner/unittests/tsserver/helpers.ts b/src/testRunner/unittests/tsserver/helpers.ts index 332e6f8bdc6..afffb6fad89 100644 --- a/src/testRunner/unittests/tsserver/helpers.ts +++ b/src/testRunner/unittests/tsserver/helpers.ts @@ -514,49 +514,49 @@ namespace ts.projectSystem { return { file: file.path, ...protocolTextSpanFromSubstring(file.content, text, options) }; } - interface DeclarationFileSpanFromSubString { + interface FileSpanWithContextFromSubString { file: File; text: string; options?: SpanFromSubstringOptions; - declarationText?: string; - declarationOptions?: SpanFromSubstringOptions; + contextText?: string; + contextOptions?: SpanFromSubstringOptions; } - export function protocolDeclarationFileSpanFromSubstring({ declarationText, declarationOptions, ...rest }: DeclarationFileSpanFromSubString): protocol.DeclarationFileSpan { + export function protocolFileSpanWithContextFromSubstring({ contextText, contextOptions, ...rest }: FileSpanWithContextFromSubString): protocol.FileSpanWithContext { const result = protocolFileSpanFromSubstring(rest); - const declarationSpan = declarationText !== undefined ? - protocolFileSpanFromSubstring({ file: rest.file, text: declarationText, options: declarationOptions }) : + const contextSpan = contextText !== undefined ? + protocolFileSpanFromSubstring({ file: rest.file, text: contextText, options: contextOptions }) : undefined; - return declarationSpan ? + return contextSpan ? { ...result, - declarationStart: declarationSpan.start, - declarationEnd: declarationSpan.end + contextStart: contextSpan.start, + contextEnd: contextSpan.end } : result; } - export interface ProtocolDeclarationTextSpanFromString { + export interface ProtocolTextSpanWithContextFromString { fileText: string; text: string; options?: SpanFromSubstringOptions; - declarationText?: string; - declarationOptions?: SpanFromSubstringOptions; + contextText?: string; + contextOptions?: SpanFromSubstringOptions; } - export function protocolDeclarationTextSpanFromSubstring({ fileText, text, options, declarationText, declarationOptions }: ProtocolDeclarationTextSpanFromString): protocol.DeclarationTextSpan { + export function protocolTextSpanWithContextFromSubstring({ fileText, text, options, contextText, contextOptions }: ProtocolTextSpanWithContextFromString): protocol.TextSpanWithContext { const span = textSpanFromSubstring(fileText, text, options); const toLocation = protocolToLocation(fileText); - const declarationSpan = declarationText !== undefined ? textSpanFromSubstring(fileText, declarationText, declarationOptions) : undefined; + const contextSpan = contextText !== undefined ? textSpanFromSubstring(fileText, contextText, contextOptions) : undefined; return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)), - ...declarationSpan && { - declarationStart: toLocation(declarationSpan.start), - declarationEnd: toLocation(textSpanEnd(declarationSpan)) + ...contextSpan && { + contextStart: toLocation(contextSpan.start), + contextEnd: toLocation(textSpanEnd(contextSpan)) } }; } - export interface ProtocolRenameSpanFromSubstring extends ProtocolDeclarationTextSpanFromString { + export interface ProtocolRenameSpanFromSubstring extends ProtocolTextSpanWithContextFromString { prefixSuffixText?: { readonly prefixText?: string; readonly suffixText?: string; @@ -564,7 +564,7 @@ namespace ts.projectSystem { } export function protocolRenameSpanFromSubstring({ prefixSuffixText, ...rest }: ProtocolRenameSpanFromSubstring): protocol.RenameTextSpan { return { - ...protocolDeclarationTextSpanFromSubstring(rest), + ...protocolTextSpanWithContextFromSubstring(rest), ...prefixSuffixText }; } diff --git a/src/testRunner/unittests/tsserver/projectReferences.ts b/src/testRunner/unittests/tsserver/projectReferences.ts index 1dd11ba7cf1..1b2e90bcd4f 100644 --- a/src/testRunner/unittests/tsserver/projectReferences.ts +++ b/src/testRunner/unittests/tsserver/projectReferences.ts @@ -78,10 +78,10 @@ namespace ts.projectSystem { arguments: { file: myConstFile, ...myConstStart } }).response as protocol.RenameResponseBody; - const locationOfMyConstInLib = protocolDeclarationFileSpanFromSubstring({ + const locationOfMyConstInLib = protocolFileSpanWithContextFromSubstring({ file: containerLib[1], text: "myConst", - declarationText: "export const myConst = 30;" + contextText: "export const myConst = 30;" }); const { file: _, ...renameTextOfMyConstInLib } = locationOfMyConstInLib; assert.deepEqual(response.locs, [ @@ -191,8 +191,8 @@ fn5(); file: dtsPath, start: { line: fn, offset: definition.start.offset + declareSpaceLength }, end: { line: fn, offset: definition.end.offset + declareSpaceLength }, - declarationStart: { line: fn, offset: 1 }, - declarationEnd: { line: fn, offset: 37 } + contextStart: { line: fn, offset: 1 }, + contextEnd: { line: fn, offset: 37 } }], textSpan }, @@ -204,20 +204,20 @@ fn5(); }; } - function declarationSpan(fn: number): protocol.DeclarationTextSpan { + function declarationSpan(fn: number): protocol.TextSpanWithContext { return { start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 }, - declarationStart: { line: fn, offset: 1 }, - declarationEnd: { line: fn, offset: 26 } + contextStart: { line: fn, offset: 1 }, + contextEnd: { line: fn, offset: 26 } }; } - function importSpan(fn: number): protocol.DeclarationTextSpan { + function importSpan(fn: number): protocol.TextSpanWithContext { return { start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 }, - declarationStart: { line: 1, offset: 1 }, - declarationEnd: { line: 7, offset: 27 } + contextStart: { line: 1, offset: 1 }, + contextEnd: { line: 7, offset: 27 } }; } function usageSpan(fn: number): protocol.TextSpan { @@ -226,7 +226,7 @@ fn5(); function renameFromDependencyTs(fn: number): SessionAction { const defSpan = declarationSpan(fn); - const { declarationStart: _, declarationEnd: _1, ...triggerSpan } = defSpan; + const { contextStart: _, contextEnd: _1, ...triggerSpan } = defSpan; return { reqName: "rename", request: { diff --git a/src/testRunner/unittests/tsserver/rename.ts b/src/testRunner/unittests/tsserver/rename.ts index 6f5633875fa..7849b36a3fc 100644 --- a/src/testRunner/unittests/tsserver/rename.ts +++ b/src/testRunner/unittests/tsserver/rename.ts @@ -20,7 +20,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: bTs.content, text: "./a", - declarationText: bTs.content + contextText: bTs.content }) ] }], @@ -45,7 +45,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: bTs.content, text: "./a", - declarationText: bTs.content + contextText: bTs.content }) ] }], @@ -71,7 +71,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: bTs.content, text: "./a", - declarationText: bTs.content + contextText: bTs.content }) ] }], @@ -103,7 +103,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", - declarationText: "const x = 0;" + contextText: "const x = 0;" }), protocolRenameSpanFromSubstring({ fileText: aTs.content, @@ -135,7 +135,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", - declarationText: "const x = 0;" + contextText: "const x = 0;" }), protocolRenameSpanFromSubstring({ fileText: aTs.content, @@ -169,7 +169,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", - declarationText: "const x = 0;" + contextText: "const x = 0;" }), protocolRenameSpanFromSubstring({ fileText: aTs.content, @@ -210,13 +210,13 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", - declarationText: "const x = 1;" + contextText: "const x = 1;" }), protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", options: { index: 2 }, - declarationText: "export { x };", + contextText: "export { x };", prefixSuffixText: { suffixText: " as x" } }), ], @@ -243,7 +243,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: bTs.content, text: "x", - declarationText: `import { x } from "./a";` + contextText: `import { x } from "./a";` }), protocolRenameSpanFromSubstring({ fileText: bTs.content, @@ -258,13 +258,13 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", - declarationText: "const x = 1;" + contextText: "const x = 1;" }), protocolRenameSpanFromSubstring({ fileText: aTs.content, text: "x", options: { index: 2 }, - declarationText: "export { x };", + contextText: "export { x };", }), ], }, diff --git a/src/testRunner/unittests/tsserver/symLinks.ts b/src/testRunner/unittests/tsserver/symLinks.ts index 1297b8ee0ac..c264bc2a6df 100644 --- a/src/testRunner/unittests/tsserver/symLinks.ts +++ b/src/testRunner/unittests/tsserver/symLinks.ts @@ -61,7 +61,7 @@ namespace ts.projectSystem { protocolRenameSpanFromSubstring({ fileText: aFile.content, text: "C", - declarationText: `import {C} from "./c/fc";` + contextText: `import {C} from "./c/fc";` }), protocolRenameSpanFromSubstring({ fileText: aFile.content, @@ -72,7 +72,7 @@ namespace ts.projectSystem { const span = protocolRenameSpanFromSubstring({ fileText: cFile.content, text: "C", - declarationText: "export const C = 8" + contextText: "export const C = 8" }); const cLocs: protocol.RenameTextSpan[] = [span]; assert.deepEqual(response, { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 00aa557ba19..cbab57b0644 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5172,8 +5172,8 @@ declare namespace ts { * If DocumentSpan.textSpan is the span for name of the declaration, * then this is the span for relevant declaration */ - declarationSpan?: TextSpan; - originalDeclarationSpan?: TextSpan; + contextSpan?: TextSpan; + originalContextSpan?: TextSpan; } interface RenameLocation extends DocumentSpan { readonly prefixText?: string; @@ -5202,7 +5202,7 @@ declare namespace ts { fileName?: string; isInString?: true; textSpan: TextSpan; - declarationSpan?: TextSpan; + contextSpan?: TextSpan; kind: HighlightSpanKind; } interface NavigateToItem { @@ -6496,21 +6496,21 @@ declare namespace ts.server.protocol { */ file: string; } - interface DeclarationTextSpan extends TextSpan { - declarationStart?: Location; - declarationEnd?: Location; + interface TextSpanWithContext extends TextSpan { + contextStart?: Location; + contextEnd?: Location; } - interface DeclarationFileSpan extends FileSpan, DeclarationTextSpan { + interface FileSpanWithContext extends FileSpan, TextSpanWithContext { } interface DefinitionInfoAndBoundSpan { - definitions: ReadonlyArray; + definitions: ReadonlyArray; textSpan: TextSpan; } /** * Definition response message. Gives text range for definition. */ interface DefinitionResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } interface DefinitionInfoAndBoundSpanReponse extends Response { body?: DefinitionInfoAndBoundSpan; @@ -6519,13 +6519,13 @@ declare namespace ts.server.protocol { * Definition response message. Gives text range for definition. */ interface TypeDefinitionResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } /** * Implementation response message. Gives text range for implementations. */ interface ImplementationResponse extends Response { - body?: DeclarationFileSpan[]; + body?: FileSpanWithContext[]; } /** * Request to get brace completion for a location in the file. @@ -6562,7 +6562,7 @@ declare namespace ts.server.protocol { command: CommandTypes.Occurrences; } /** @deprecated */ - interface OccurrencesResponseItem extends DeclarationFileSpan { + interface OccurrencesResponseItem extends FileSpanWithContext { /** * True if the occurrence is a write location, false otherwise. */ @@ -6588,7 +6588,7 @@ declare namespace ts.server.protocol { /** * Span augmented with extra information that denotes the kind of the highlighting to be used for span. */ - interface HighlightSpan extends DeclarationTextSpan { + interface HighlightSpan extends TextSpanWithContext { kind: HighlightSpanKind; } /** @@ -6618,7 +6618,7 @@ declare namespace ts.server.protocol { interface ReferencesRequest extends FileLocationRequest { command: CommandTypes.References; } - interface ReferencesResponseItem extends DeclarationFileSpan { + interface ReferencesResponseItem extends FileSpanWithContext { /** Text of line containing the reference. Including this * with the response avoids latency of editor loading files * to show text of reference line (the server already has @@ -6733,7 +6733,7 @@ declare namespace ts.server.protocol { /** The text spans in this group */ locs: RenameTextSpan[]; } - interface RenameTextSpan extends DeclarationTextSpan { + interface RenameTextSpan extends TextSpanWithContext { readonly prefixText?: string; readonly suffixText?: string; } @@ -9090,7 +9090,7 @@ declare namespace ts.server { private mapDefinitionInfo; private static mapToOriginalLocation; private toFileSpan; - private toDeclarationFileSpan; + private toFileSpanWithContext; private getTypeDefinition; private mapImplementationLocations; private getImplementation; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index bb98c6a873f..fd254a2fe50 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5172,8 +5172,8 @@ declare namespace ts { * If DocumentSpan.textSpan is the span for name of the declaration, * then this is the span for relevant declaration */ - declarationSpan?: TextSpan; - originalDeclarationSpan?: TextSpan; + contextSpan?: TextSpan; + originalContextSpan?: TextSpan; } interface RenameLocation extends DocumentSpan { readonly prefixText?: string; @@ -5202,7 +5202,7 @@ declare namespace ts { fileName?: string; isInString?: true; textSpan: TextSpan; - declarationSpan?: TextSpan; + contextSpan?: TextSpan; kind: HighlightSpanKind; } interface NavigateToItem { diff --git a/tests/cases/fourslash/ambientShorthandFindAllRefs.ts b/tests/cases/fourslash/ambientShorthandFindAllRefs.ts index 822a70ccaf6..3a0c30ef507 100644 --- a/tests/cases/fourslash/ambientShorthandFindAllRefs.ts +++ b/tests/cases/fourslash/ambientShorthandFindAllRefs.ts @@ -4,10 +4,10 @@ ////declare module "jquery"; // @Filename: user.ts -////[|import {[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]} from "jquery";|] +////[|import {[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]} from "jquery";|] // @Filename: user2.ts -////[|import {[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|]} from "jquery";|] +////[|import {[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|]} from "jquery";|] const [r0Def, r0, r1Def, r1] = test.ranges(); // TODO: Want these to be in the same group, but that would require creating a symbol for `x`. diff --git a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts index a6ff91fbbd5..aafb491008b 100644 --- a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts @@ -7,7 +7,7 @@ //// //// } //// -//// [|public /**/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){ +//// [|public /**/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|](){ //// return this; //// }|] //// diff --git a/tests/cases/fourslash/doubleUnderscoreRenames.ts b/tests/cases/fourslash/doubleUnderscoreRenames.ts index 6b50d65f124..5cfd87f1be6 100644 --- a/tests/cases/fourslash/doubleUnderscoreRenames.ts +++ b/tests/cases/fourslash/doubleUnderscoreRenames.ts @@ -1,11 +1,11 @@ /// // @Filename: fileA.ts -//// [|export function [|{| "declarationRangeIndex": 0 |}__foo|]() { +//// [|export function [|{| "contextRangeIndex": 0 |}__foo|]() { //// }|] //// // @Filename: fileB.ts -//// [|import { [|{| "declarationRangeIndex": 2 |}__foo|] as bar } from "./fileA";|] +//// [|import { [|{| "contextRangeIndex": 2 |}__foo|] as bar } from "./fileA";|] //// //// bar(); diff --git a/tests/cases/fourslash/duplicatePackageServices.ts b/tests/cases/fourslash/duplicatePackageServices.ts index e5653f9da6d..34eafde8199 100644 --- a/tests/cases/fourslash/duplicatePackageServices.ts +++ b/tests/cases/fourslash/duplicatePackageServices.ts @@ -2,11 +2,11 @@ // @noImplicitReferences: true // @Filename: /node_modules/a/index.d.ts -////[|import [|{| "name": "useAX", "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}X|] from "x";|] +////[|import [|{| "name": "useAX", "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}X|] from "x";|] ////export function a(x: [|X|]): void; // @Filename: /node_modules/a/node_modules/x/index.d.ts -////[|export default class /*defAX*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}X|] { +////[|export default class /*defAX*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}X|] { //// private x: number; ////}|] @@ -14,11 +14,11 @@ ////{ "name": "x", "version": "1.2.3" } // @Filename: /node_modules/b/index.d.ts -////[|import [|{| "name": "useBX", "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}X|] from "x";|] +////[|import [|{| "name": "useBX", "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}X|] from "x";|] ////export const b: [|X|]; // @Filename: /node_modules/b/node_modules/x/index.d.ts -////[|export default class /*defBX*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}X|] { +////[|export default class /*defBX*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}X|] { //// private x: number; ////}|] diff --git a/tests/cases/fourslash/esModuleInteropFindAllReferences.ts b/tests/cases/fourslash/esModuleInteropFindAllReferences.ts index e1ca3e4c9b1..842243c9b1b 100644 --- a/tests/cases/fourslash/esModuleInteropFindAllReferences.ts +++ b/tests/cases/fourslash/esModuleInteropFindAllReferences.ts @@ -4,7 +4,7 @@ // @Filename: /abc.d.ts ////declare module "a" { -//// [|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number;|] +//// [|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]: number;|] ////} // @Filename: /b.ts diff --git a/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts b/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts index 02dbddd6b4e..e70454f023a 100644 --- a/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts +++ b/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts @@ -6,7 +6,7 @@ // @Filename: /a.d.ts ////export as namespace abc; -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]: number;|] // @Filename: /b.ts ////import a from "./a"; diff --git a/tests/cases/fourslash/findAllReferPropertyAccessExpressionHeritageClause.ts b/tests/cases/fourslash/findAllReferPropertyAccessExpressionHeritageClause.ts index 9e9f552b528..2b28656c58e 100644 --- a/tests/cases/fourslash/findAllReferPropertyAccessExpressionHeritageClause.ts +++ b/tests/cases/fourslash/findAllReferPropertyAccessExpressionHeritageClause.ts @@ -2,7 +2,7 @@ //// class B {} //// function foo() { -//// return {[|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}B|]: B|]}; +//// return {[|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}B|]: B|]}; //// } //// class C extends (foo()).[|B|] {} //// class C1 extends foo().[|B|] {} diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport1.ts b/tests/cases/fourslash/findAllReferencesDynamicImport1.ts index 070621ef94b..999704edd3e 100644 --- a/tests/cases/fourslash/findAllReferencesDynamicImport1.ts +++ b/tests/cases/fourslash/findAllReferencesDynamicImport1.ts @@ -3,7 +3,7 @@ // @Filename: foo.ts //// export function foo() { return "foo"; } -//// [|import("[|{| "declarationRangeIndex": 0 |}./foo|]")|] -//// [|var x = import("[|{| "declarationRangeIndex": 2 |}./foo|]")|] +//// [|import("[|{| "contextRangeIndex": 0 |}./foo|]")|] +//// [|var x = import("[|{| "contextRangeIndex": 2 |}./foo|]")|] verify.singleReferenceGroup('module "/tests/cases/fourslash/foo"', "./foo"); diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport2.ts b/tests/cases/fourslash/findAllReferencesDynamicImport2.ts index 5e90911875b..987fccc219e 100644 --- a/tests/cases/fourslash/findAllReferencesDynamicImport2.ts +++ b/tests/cases/fourslash/findAllReferencesDynamicImport2.ts @@ -1,7 +1,7 @@ /// // @Filename: foo.ts -//// [|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}bar|]() { return "bar"; }|] +//// [|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}bar|]() { return "bar"; }|] //// var x = import("./foo"); //// x.then(foo => { diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport3.ts b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts index 1035ff40389..08160e403ad 100644 --- a/tests/cases/fourslash/findAllReferencesDynamicImport3.ts +++ b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts @@ -1,8 +1,8 @@ /// // @Filename: foo.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}bar|]() { return "bar"; }|] -////import('./foo').then(([|{ [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}bar|] }|]) => undefined); +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}bar|]() { return "bar"; }|] +////import('./foo').then(([|{ [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}bar|] }|]) => undefined); const [r0Def, r0, r1Def, r1] = test.ranges(); verify.referenceGroups(r0, [{ definition: "function bar(): string", ranges: [r0, r1] }]); diff --git a/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts b/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts index 50066b9b136..28e24da2791 100644 --- a/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts +++ b/tests/cases/fourslash/findAllReferencesJSDocFunctionNew.ts @@ -1,7 +1,7 @@ /// // @allowJs: true // @Filename: Foo.js -/////** @type {function ([|[|{|"isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0|}new|]: string|], string): string} */ +/////** @type {function ([|[|{|"isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0|}new|]: string|], string): string} */ ////var f; const [a0Def, a0] = test.ranges(); diff --git a/tests/cases/fourslash/findAllReferencesOfConstructor.ts b/tests/cases/fourslash/findAllReferencesOfConstructor.ts index ecaada06b1d..a952a2c6ee7 100644 --- a/tests/cases/fourslash/findAllReferencesOfConstructor.ts +++ b/tests/cases/fourslash/findAllReferencesOfConstructor.ts @@ -2,9 +2,9 @@ // @Filename: a.ts ////export class C { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|](n: number);|] -//// [|[|{| "declarationRangeIndex": 2 |}constructor|]();|] -//// [|[|{| "declarationRangeIndex": 4 |}constructor|](n?: number){}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|](n: number);|] +//// [|[|{| "contextRangeIndex": 2 |}constructor|]();|] +//// [|[|{| "contextRangeIndex": 4 |}constructor|](n?: number){}|] //// static f() { //// this.f(); //// new [|this|](); diff --git a/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts b/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts index ef4dc289359..c343df86e7a 100644 --- a/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts +++ b/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts @@ -1,8 +1,8 @@ /// ////class C { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|](n: number);|] -//// [|[|{| "declarationRangeIndex": 2 |}constructor|](){}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|](n: number);|] +//// [|[|{| "contextRangeIndex": 2 |}constructor|](){}|] ////} verify.singleReferenceGroup("class C", "constructor"); diff --git a/tests/cases/fourslash/findAllReferencesOfJsonModule.ts b/tests/cases/fourslash/findAllReferencesOfJsonModule.ts index fd944097299..7543d7a7899 100644 --- a/tests/cases/fourslash/findAllReferencesOfJsonModule.ts +++ b/tests/cases/fourslash/findAllReferencesOfJsonModule.ts @@ -5,7 +5,7 @@ // @esModuleInterop: true // @Filename: /foo.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}settings|] from "./settings.json";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}settings|] from "./settings.json";|] ////[|settings|]; // @Filename: /settings.json diff --git a/tests/cases/fourslash/findAllReferencesUmdModuleAsGlobalConst.ts b/tests/cases/fourslash/findAllReferencesUmdModuleAsGlobalConst.ts index 23435fa5cad..479d0d2b9b6 100644 --- a/tests/cases/fourslash/findAllReferencesUmdModuleAsGlobalConst.ts +++ b/tests/cases/fourslash/findAllReferencesUmdModuleAsGlobalConst.ts @@ -9,12 +9,12 @@ // @Filename: /node_modules/@types/three/index.d.ts ////export * from "./three-core"; -////[|export as namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}THREE|];|] +////[|export as namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}THREE|];|] // @Filename: /typings/global.d.ts -////[|import * as _THREE from '[|{| "declarationRangeIndex": 2 |}three|]';|] +////[|import * as _THREE from '[|{| "contextRangeIndex": 2 |}three|]';|] ////declare global { -//// [|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}THREE|]: typeof _THREE;|] +//// [|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}THREE|]: typeof _THREE;|] ////} // @Filename: /src/index.ts diff --git a/tests/cases/fourslash/findAllRefsBadImport.ts b/tests/cases/fourslash/findAllRefsBadImport.ts index cde75d2df9a..33974bf36ef 100644 --- a/tests/cases/fourslash/findAllRefsBadImport.ts +++ b/tests/cases/fourslash/findAllRefsBadImport.ts @@ -1,6 +1,6 @@ /// -////[|import { [|{| "declarationRangeIndex": 0 |}ab|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}cd|] } from "doesNotExist";|] +////[|import { [|{| "contextRangeIndex": 0 |}ab|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}cd|] } from "doesNotExist";|] const [r0Def, r0, r1] = test.ranges(); verify.referenceGroups(r0, undefined); diff --git a/tests/cases/fourslash/findAllRefsClassExpression0.ts b/tests/cases/fourslash/findAllRefsClassExpression0.ts index 9ccff25ab96..cb5faf045c5 100644 --- a/tests/cases/fourslash/findAllRefsClassExpression0.ts +++ b/tests/cases/fourslash/findAllRefsClassExpression0.ts @@ -1,12 +1,12 @@ /// // @Filename: /a.ts -////export = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] { +////export = [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] { //// m() { [|A|]; } ////}|]; // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}A|] = require("./a");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}A|] = require("./a");|] ////[|A|]; const [r0Def, r0, r1, r2Def, r2, r3] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsClassExpression1.ts b/tests/cases/fourslash/findAllRefsClassExpression1.ts index 96bba426a25..bbf14052408 100644 --- a/tests/cases/fourslash/findAllRefsClassExpression1.ts +++ b/tests/cases/fourslash/findAllRefsClassExpression1.ts @@ -3,10 +3,10 @@ // @allowJs: true // @Filename: /a.js -////module.exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] {}|]; +////module.exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] {}|]; // @Filename: /b.js -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}A|] = require("./a");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}A|] = require("./a");|] ////[|A|]; const [r0Def, r0, r1Def, r1, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsClassExpression2.ts b/tests/cases/fourslash/findAllRefsClassExpression2.ts index 9432e9e7181..bd0ee3a8804 100644 --- a/tests/cases/fourslash/findAllRefsClassExpression2.ts +++ b/tests/cases/fourslash/findAllRefsClassExpression2.ts @@ -3,10 +3,10 @@ // @allowJs: true // @Filename: /a.js -////[|exports.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] = class {};|] +////[|exports.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] = class {};|] // @Filename: /b.js -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}A|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}A|] } from "./a";|] ////[|A|]; const [r0Def, r0, r1Def, r1, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts b/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts index 419f61836d3..d67a239d06a 100644 --- a/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts +++ b/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts @@ -1,6 +1,6 @@ /// -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] { //// static s() { //// [|this|]; //// } diff --git a/tests/cases/fourslash/findAllRefsConstructorFunctions.ts b/tests/cases/fourslash/findAllRefsConstructorFunctions.ts index 8f95f94da2b..a020380db70 100644 --- a/tests/cases/fourslash/findAllRefsConstructorFunctions.ts +++ b/tests/cases/fourslash/findAllRefsConstructorFunctions.ts @@ -4,10 +4,10 @@ // @Filename: /a.js ////function f() { -//// [|this.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +//// [|this.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] ////} ////f.prototype.setX = function() { -//// [|this.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] = 1;|] +//// [|this.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] = 1;|] ////} ////f.prototype.useX = function() { this.[|x|]; } diff --git a/tests/cases/fourslash/findAllRefsDeclareClass.ts b/tests/cases/fourslash/findAllRefsDeclareClass.ts index 4632f48c527..789a4269403 100644 --- a/tests/cases/fourslash/findAllRefsDeclareClass.ts +++ b/tests/cases/fourslash/findAllRefsDeclareClass.ts @@ -1,6 +1,6 @@ /// -////[|declare class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] { +////[|declare class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] { //// static m(): void; ////}|] diff --git a/tests/cases/fourslash/findAllRefsDefaultImport.ts b/tests/cases/fourslash/findAllRefsDefaultImport.ts index 23b7c8af76a..a485a8ec371 100644 --- a/tests/cases/fourslash/findAllRefsDefaultImport.ts +++ b/tests/cases/fourslash/findAllRefsDefaultImport.ts @@ -1,10 +1,10 @@ /// // @Filename: /a.ts -////[|export default function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}a|]() {}|] +////[|export default function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}a|]() {}|] // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|], * as ns from "./a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|], * as ns from "./a";|] const [r0Def, r0, r1Def, r1] = test.ranges(); const a: FourSlashInterface.ReferenceGroup = { definition: "function a(): void", ranges: [r0] }; diff --git a/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts b/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts index ca99174463b..e9ab2cbd4ff 100644 --- a/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts +++ b/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts @@ -1,7 +1,7 @@ /// // @Filename: /a.ts -////[|export [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}default|] function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|]() {}|] +////[|export [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}default|] function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|]() {}|] // @Filename: /b.ts ////export import a = require("./a"); @@ -10,7 +10,7 @@ ////import { a } from "./b"; ////a.[|default|](); //// -////declare const x: { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}default|]: number|] }; +////declare const x: { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}default|]: number|] }; ////x.[|default|]; const [r0Def, r0, r1, r2, r3Def, r3, r4] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsDefinition.ts b/tests/cases/fourslash/findAllRefsDefinition.ts index 4d9d50a618a..73a88777cf5 100644 --- a/tests/cases/fourslash/findAllRefsDefinition.ts +++ b/tests/cases/fourslash/findAllRefsDefinition.ts @@ -1,6 +1,6 @@ /// -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] ////[|x|]; const ranges = test.rangesByText().get("x"); diff --git a/tests/cases/fourslash/findAllRefsDestructureGeneric.ts b/tests/cases/fourslash/findAllRefsDestructureGeneric.ts index d6e96155ec7..09d9aff004b 100644 --- a/tests/cases/fourslash/findAllRefsDestructureGeneric.ts +++ b/tests/cases/fourslash/findAllRefsDestructureGeneric.ts @@ -1,10 +1,10 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: boolean;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}x|]: boolean;|] ////} ////declare const i: I; -////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] } = i;|] +////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] } = i;|] const [r0Def, r0, r1Def, r1] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsDestructureGetter.ts b/tests/cases/fourslash/findAllRefsDestructureGetter.ts index ed4a74d5d2b..c1fdb0f111e 100644 --- a/tests/cases/fourslash/findAllRefsDestructureGetter.ts +++ b/tests/cases/fourslash/findAllRefsDestructureGetter.ts @@ -1,11 +1,11 @@ /// ////class Test { -//// [|get [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 0 |}x|]() { return 0; }|] +//// [|get [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 0 |}x|]() { return 0; }|] //// -//// [|set [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 2 |}y|](a: number) {}|] +//// [|set [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 2 |}y|](a: number) {}|] ////} -////[|const { [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 4 |}x|], [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 4 |}y|] } = new Test();|] +////[|const { [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 4 |}x|], [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 4 |}y|] } = new Test();|] ////[|x|]; [|y|]; const [x0Def, x0, y0Def, y0, xy1Def, x1, y1, x2, y2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsDestructureGetter2.ts b/tests/cases/fourslash/findAllRefsDestructureGetter2.ts index 8d6300e976f..58cf0013c91 100644 --- a/tests/cases/fourslash/findAllRefsDestructureGetter2.ts +++ b/tests/cases/fourslash/findAllRefsDestructureGetter2.ts @@ -4,11 +4,11 @@ // @Filename: /a.ts ////class C { -//// [|get [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}g|](): number { return 0; }|] +//// [|get [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}g|](): number { return 0; }|] //// -//// [|set [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}s|](value: number) {}|] +//// [|set [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}s|](value: number) {}|] ////} -////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}g|], [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}s|] } = new C();|] +////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}g|], [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}s|] } = new C();|] const [g0Def, g0, s0Def, s0, gs1Def, g1, s1] = test.ranges(); verify.quickInfoAt(g0, "(property) C.g: number"); diff --git a/tests/cases/fourslash/findAllRefsEnumAsNamespace.ts b/tests/cases/fourslash/findAllRefsEnumAsNamespace.ts index e98da5f8d9f..b8c6fc62105 100644 --- a/tests/cases/fourslash/findAllRefsEnumAsNamespace.ts +++ b/tests/cases/fourslash/findAllRefsEnumAsNamespace.ts @@ -1,6 +1,6 @@ /// -////[|enum [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}E|] { A }|] +////[|enum [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}E|] { A }|] ////let e: [|E|].A; verify.singleReferenceGroup("enum E", "E"); diff --git a/tests/cases/fourslash/findAllRefsExportAsNamespace.ts b/tests/cases/fourslash/findAllRefsExportAsNamespace.ts index e97d3411ce4..59b8792bc88 100644 --- a/tests/cases/fourslash/findAllRefsExportAsNamespace.ts +++ b/tests/cases/fourslash/findAllRefsExportAsNamespace.ts @@ -3,11 +3,11 @@ // `export as namespace` results in global search. // @Filename: /node_modules/a/index.d.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|](): void;|] +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|](): void;|] ////export as namespace A; // @Filename: /b.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}f|] } from "a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}f|] } from "a";|] // @Filename: /c.ts ////A.[|f|](); diff --git a/tests/cases/fourslash/findAllRefsExportConstEqualToClass.ts b/tests/cases/fourslash/findAllRefsExportConstEqualToClass.ts index 98ab1b3a456..e667a111efe 100644 --- a/tests/cases/fourslash/findAllRefsExportConstEqualToClass.ts +++ b/tests/cases/fourslash/findAllRefsExportConstEqualToClass.ts @@ -1,11 +1,11 @@ /// // @Filename: /a.ts -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] {}|] -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}D|] = [|C|];|] +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] {}|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}D|] = [|C|];|] // @Filename: /b.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}D|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}D|] } from "./a";|] const [C0Def, C0, D0Def, D0, C1, D1Def, D1] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts b/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts index e8754ff15be..5a882023c22 100644 --- a/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts +++ b/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts @@ -1,5 +1,5 @@ ////export default class { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|]() {}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|]() {}|] ////} verify.singleReferenceGroup("class default", "constructor"); diff --git a/tests/cases/fourslash/findAllRefsExportEquals.ts b/tests/cases/fourslash/findAllRefsExportEquals.ts index d7d80564e5b..647023b43ff 100644 --- a/tests/cases/fourslash/findAllRefsExportEquals.ts +++ b/tests/cases/fourslash/findAllRefsExportEquals.ts @@ -1,11 +1,11 @@ /// // @Filename: /a.ts -////[|type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|] -////[|[|{| "declarationRangeIndex": 2 |}export|] = [|{| "declarationRangeIndex": 2 |}T|];|] +////[|type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|] +////[|[|{| "contextRangeIndex": 2 |}export|] = [|{| "contextRangeIndex": 2 |}T|];|] // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}T|] = require("[|{| "declarationRangeIndex": 5 |}./a|]");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}T|] = require("[|{| "contextRangeIndex": 5 |}./a|]");|] const [r0Def, r0, r12Def, r1, r2, r3Def, r3, r4] = test.ranges(); const mod = { definition: 'module "/a"', ranges: [r4, r1] }; diff --git a/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts b/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts index a99116726f8..96e34260893 100644 --- a/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts +++ b/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts @@ -1,7 +1,7 @@ /// ////{ -//// [|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +//// [|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] //// [|x|]; ////} diff --git a/tests/cases/fourslash/findAllRefsForComputedProperties.ts b/tests/cases/fourslash/findAllRefsForComputedProperties.ts index d8a5ef9771f..90de1881b00 100644 --- a/tests/cases/fourslash/findAllRefsForComputedProperties.ts +++ b/tests/cases/fourslash/findAllRefsForComputedProperties.ts @@ -1,15 +1,15 @@ /// ////interface I { -//// [|["[|{| "isDefinition": true, "declarationRangeIndex": 0 |}prop1|]"]: () => void;|] +//// [|["[|{| "isDefinition": true, "contextRangeIndex": 0 |}prop1|]"]: () => void;|] ////} //// ////class C implements I { -//// [|["[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop1|]"]: any;|] +//// [|["[|{| "isDefinition": true, "contextRangeIndex": 2 |}prop1|]"]: any;|] ////} //// ////var x: I = { -//// [|["[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}prop1|]"]: function () { }|], +//// [|["[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}prop1|]"]: function () { }|], ////} const [r0Def, r0, r1Def, r1, r2Def, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsForComputedProperties2.ts b/tests/cases/fourslash/findAllRefsForComputedProperties2.ts index 8b66fd635e4..5b7e73af9d3 100644 --- a/tests/cases/fourslash/findAllRefsForComputedProperties2.ts +++ b/tests/cases/fourslash/findAllRefsForComputedProperties2.ts @@ -1,15 +1,15 @@ /// ////interface I { -//// [|[[|{| "isDefinition": true, "declarationRangeIndex": 0 |}42|]](): void;|] +//// [|[[|{| "isDefinition": true, "contextRangeIndex": 0 |}42|]](): void;|] ////} //// ////class C implements I { -//// [|[[|{| "isDefinition": true, "declarationRangeIndex": 2 |}42|]]: any;|] +//// [|[[|{| "isDefinition": true, "contextRangeIndex": 2 |}42|]]: any;|] ////} //// ////var x: I = { -//// [|["[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}42|]"]: function () { }|] +//// [|["[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}42|]"]: function () { }|] ////} const [r0Def, r0, r1Def, r1, r2Def, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport.ts b/tests/cases/fourslash/findAllRefsForDefaultExport.ts index 6570fa2857d..6e8bcb710b7 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport.ts @@ -1,10 +1,10 @@ /// // @Filename: a.ts -////[|export default function /*def*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|]() {}|] +////[|export default function /*def*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|]() {}|] // @Filename: b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}g|] from "./a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}g|] from "./a";|] ////[|/*ref*/g|](); // @Filename: c.ts diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport01.ts b/tests/cases/fourslash/findAllRefsForDefaultExport01.ts index 96b906ba9cb..4cb366d6173 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport01.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport01.ts @@ -1,6 +1,6 @@ /// -////[|export default class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}DefaultExportedClass|] { +////[|export default class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}DefaultExportedClass|] { ////}|] //// ////var x: [|DefaultExportedClass|]; diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport02.ts b/tests/cases/fourslash/findAllRefsForDefaultExport02.ts index 1e00bb4f68d..e0f0ecdafab 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport02.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport02.ts @@ -1,6 +1,6 @@ /// -////[|export default function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}DefaultExportedFunction|]() { +////[|export default function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}DefaultExportedFunction|]() { //// return [|DefaultExportedFunction|]; ////}|] //// @@ -8,7 +8,7 @@ //// ////var y = [|DefaultExportedFunction|](); //// -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}DefaultExportedFunction|] { +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}DefaultExportedFunction|] { ////}|] diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport03.ts b/tests/cases/fourslash/findAllRefsForDefaultExport03.ts index 1e8ddbc1507..3ad604e2282 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport03.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport03.ts @@ -1,16 +1,16 @@ /// -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|]() { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|]() { //// return 100; ////}|] //// -////[|export default [|{| "declarationRangeIndex": 2 |}f|];|] +////[|export default [|{| "contextRangeIndex": 2 |}f|];|] //// ////var x: typeof [|f|]; //// ////var y = [|f|](); //// -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}f|] { +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}f|] { //// var local = 100; ////}|] diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport04.ts b/tests/cases/fourslash/findAllRefsForDefaultExport04.ts index aa10ab1d59d..3e3bb1b625b 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport04.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport04.ts @@ -1,11 +1,11 @@ /// // @Filename: /a.ts -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}a|] = 0;|] -////[|export [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}default|] [|{| "declarationRangeIndex": 2 |}a|];|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}a|] = 0;|] +////[|export [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}default|] [|{| "contextRangeIndex": 2 |}a|];|] // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}a|] from "./a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}a|] from "./a";|] ////[|a|]; const [r0Def, r0, r1Def, r1, r2, r3Def, r3, r4] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport08.ts b/tests/cases/fourslash/findAllRefsForDefaultExport08.ts index d94a0ce5d3c..250944ff249 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport08.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport08.ts @@ -7,7 +7,7 @@ //// ////var y = new DefaultExportedClass; //// -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}DefaultExportedClass|] { +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}DefaultExportedClass|] { ////}|] verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExportAnonymous.ts b/tests/cases/fourslash/findAllRefsForDefaultExportAnonymous.ts index 1820624374d..a2098b24713 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExportAnonymous.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExportAnonymous.ts @@ -1,10 +1,10 @@ /// // @Filename: /a.ts -////[|export [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}default|] function() {}|] +////[|export [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}default|] function() {}|] // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}f|] from "./a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}f|] from "./a";|] const [r0Def, r0, r1Def, r1] = test.ranges(); verify.referenceGroups(r0, [ diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport_anonymous.ts b/tests/cases/fourslash/findAllRefsForDefaultExport_anonymous.ts index 778203c1bcd..30dbb7544a4 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport_anonymous.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport_anonymous.ts @@ -1,10 +1,10 @@ /// // @Filename: /a.ts -////[|export [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 0 |}default|] 1;|] +////[|export [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 0 |}default|] 1;|] // @Filename: /b.ts -////[|import [|{| "isDefinition": true, "isWriteAccess": true, "declarationRangeIndex": 2 |}a|] from "./a";|] +////[|import [|{| "isDefinition": true, "isWriteAccess": true, "contextRangeIndex": 2 |}a|] from "./a";|] const [r0Def, r0, r1Def, r1] = test.ranges(); verify.referenceGroups(r0, [ diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport_reExport.ts b/tests/cases/fourslash/findAllRefsForDefaultExport_reExport.ts index d9dd9d06736..2178f71d8f9 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport_reExport.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport_reExport.ts @@ -1,14 +1,14 @@ /// // @Filename: /export.ts -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|] = 1;|] -////[|export default [|{| "declarationRangeIndex": 2 |}foo|];|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|] = 1;|] +////[|export default [|{| "contextRangeIndex": 2 |}foo|];|] // @Filename: /re-export.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}default|] } from "./export";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}default|] } from "./export";|] // @Filename: /re-export-dep.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}fooDefault|] from "./re-export";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}fooDefault|] from "./re-export";|] const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = test.ranges(); verify.referenceGroups([r0, r1], [ diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport_reExport_allowSyntheticDefaultImports.ts b/tests/cases/fourslash/findAllRefsForDefaultExport_reExport_allowSyntheticDefaultImports.ts index e49f7ca41bc..2e45a18e396 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport_reExport_allowSyntheticDefaultImports.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport_reExport_allowSyntheticDefaultImports.ts @@ -3,14 +3,14 @@ // @allowSyntheticDefaultImports: true // @Filename: /export.ts -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|] = 1;|] -////[|export = [|{| "declarationRangeIndex": 2 |}foo|];|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|] = 1;|] +////[|export = [|{| "contextRangeIndex": 2 |}foo|];|] // @Filename: /re-export.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}default|] } from "./export";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}default|] } from "./export";|] // @Filename: /re-export-dep.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}fooDefault|] from "./re-export";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}fooDefault|] from "./re-export";|] verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsForFunctionExpression01.ts b/tests/cases/fourslash/findAllRefsForFunctionExpression01.ts index 16caacc2aad..9665c189715 100644 --- a/tests/cases/fourslash/findAllRefsForFunctionExpression01.ts +++ b/tests/cases/fourslash/findAllRefsForFunctionExpression01.ts @@ -1,7 +1,7 @@ /// // @Filename: file1.ts -////var foo = [|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](a = [|foo|](), b = () => [|foo|]) { +////var foo = [|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|](a = [|foo|](), b = () => [|foo|]) { //// [|foo|]([|foo|], [|foo|]); ////}|] diff --git a/tests/cases/fourslash/findAllRefsForMappedType.ts b/tests/cases/fourslash/findAllRefsForMappedType.ts index 8a64a730801..5c6aa30b3bb 100644 --- a/tests/cases/fourslash/findAllRefsForMappedType.ts +++ b/tests/cases/fourslash/findAllRefsForMappedType.ts @@ -1,9 +1,9 @@ /// -////interface T { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: number|] }; +////interface T { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number|] }; ////type U = { [K in keyof T]: string }; ////type V = { [K in keyof U]: boolean }; -////const u: U = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|]: ""|] } -////const v: V = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}a|]: true|] } +////const u: U = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|]: ""|] } +////const v: V = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}a|]: true|] } verify.singleReferenceGroup("(property) T.a: number", "a"); diff --git a/tests/cases/fourslash/findAllRefsForModule.ts b/tests/cases/fourslash/findAllRefsForModule.ts index 0449c6a4408..0197c272107 100644 --- a/tests/cases/fourslash/findAllRefsForModule.ts +++ b/tests/cases/fourslash/findAllRefsForModule.ts @@ -6,10 +6,10 @@ ////export const x = 0; // @Filename: /b.ts -////[|import { x } from "[|{| "declarationRangeIndex": 0 |}./a|]";|] +////[|import { x } from "[|{| "contextRangeIndex": 0 |}./a|]";|] // @Filename: /c/sub.js -////[|const a = require("[|{| "declarationRangeIndex": 2 |}../a|]");|] +////[|const a = require("[|{| "contextRangeIndex": 2 |}../a|]");|] // @Filename: /d.ts //// /// diff --git a/tests/cases/fourslash/findAllRefsForModuleGlobal.ts b/tests/cases/fourslash/findAllRefsForModuleGlobal.ts index bdb0d62a5cb..1ad69e01856 100644 --- a/tests/cases/fourslash/findAllRefsForModuleGlobal.ts +++ b/tests/cases/fourslash/findAllRefsForModuleGlobal.ts @@ -5,8 +5,8 @@ // @Filename: /b.ts /////// -////[|import { x } from "[|{| "declarationRangeIndex": 1 |}foo|]";|] -////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}foo|]" {}|] +////[|import { x } from "[|{| "contextRangeIndex": 1 |}foo|]";|] +////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}foo|]" {}|] verify.noErrors(); verify.singleReferenceGroup('module "/node_modules/foo/index"', "foo"); diff --git a/tests/cases/fourslash/findAllRefsForObjectLiteralProperties.ts b/tests/cases/fourslash/findAllRefsForObjectLiteralProperties.ts index 5a6557d65d9..a9de9bb632c 100644 --- a/tests/cases/fourslash/findAllRefsForObjectLiteralProperties.ts +++ b/tests/cases/fourslash/findAllRefsForObjectLiteralProperties.ts @@ -1,11 +1,11 @@ /// ////var x = { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}property|]: {}|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}property|]: {}|] ////}; //// ////x.[|property|]; //// -////[|let {[|{| "declarationRangeIndex": 3 |}property|]: pVar} = x;|] +////[|let {[|{| "contextRangeIndex": 3 |}property|]: pVar} = x;|] verify.singleReferenceGroup("(property) property: {}", "property"); diff --git a/tests/cases/fourslash/findAllRefsForObjectSpread.ts b/tests/cases/fourslash/findAllRefsForObjectSpread.ts index 5995d0d7cb0..c4226a5310c 100644 --- a/tests/cases/fourslash/findAllRefsForObjectSpread.ts +++ b/tests/cases/fourslash/findAllRefsForObjectSpread.ts @@ -1,7 +1,7 @@ /// -////interface A1 { [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: string|] }; -////interface A2 { [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}a|]?: number|] }; +////interface A1 { [|readonly [|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: string|] }; +////interface A2 { [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}a|]?: number|] }; ////let a1: A1; ////let a2: A2; ////let a12 = { ...a1, ...a2 }; diff --git a/tests/cases/fourslash/findAllRefsForRest.ts b/tests/cases/fourslash/findAllRefsForRest.ts index b39071c13c1..81aadfe69c9 100644 --- a/tests/cases/fourslash/findAllRefsForRest.ts +++ b/tests/cases/fourslash/findAllRefsForRest.ts @@ -1,7 +1,7 @@ /// ////interface Gen { //// x: number -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}parent|]: Gen;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}parent|]: Gen;|] //// millenial: string; ////} ////let t: Gen; diff --git a/tests/cases/fourslash/findAllRefsForUMDModuleAlias1.ts b/tests/cases/fourslash/findAllRefsForUMDModuleAlias1.ts index 97188a5bac8..10776d35617 100644 --- a/tests/cases/fourslash/findAllRefsForUMDModuleAlias1.ts +++ b/tests/cases/fourslash/findAllRefsForUMDModuleAlias1.ts @@ -4,7 +4,7 @@ //// export function doThing(): string; //// export function doTheOtherThing(): void; -//// [|export as namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}myLib|];|] +//// [|export as namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}myLib|];|] // @Filename: 1.ts //// /// diff --git a/tests/cases/fourslash/findAllRefsForVariableInExtendsClause01.ts b/tests/cases/fourslash/findAllRefsForVariableInExtendsClause01.ts index d72a1695cca..20037640a8c 100644 --- a/tests/cases/fourslash/findAllRefsForVariableInExtendsClause01.ts +++ b/tests/cases/fourslash/findAllRefsForVariableInExtendsClause01.ts @@ -1,6 +1,6 @@ /// -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Base|] = class { };|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Base|] = class { };|] ////class C extends [|Base|] { } verify.singleReferenceGroup("var Base: typeof Base", "Base"); diff --git a/tests/cases/fourslash/findAllRefsForVariableInExtendsClause02.ts b/tests/cases/fourslash/findAllRefsForVariableInExtendsClause02.ts index c2fd4bd077b..da9faa17ef4 100644 --- a/tests/cases/fourslash/findAllRefsForVariableInExtendsClause02.ts +++ b/tests/cases/fourslash/findAllRefsForVariableInExtendsClause02.ts @@ -1,6 +1,6 @@ /// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Base|] { }|] +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Base|] { }|] ////namespace n { //// var Base = class { }; //// interface I extends [|Base|] { } diff --git a/tests/cases/fourslash/findAllRefsGlobalModuleAugmentation.ts b/tests/cases/fourslash/findAllRefsGlobalModuleAugmentation.ts index 82016acd9f0..68f691e27f5 100644 --- a/tests/cases/fourslash/findAllRefsGlobalModuleAugmentation.ts +++ b/tests/cases/fourslash/findAllRefsGlobalModuleAugmentation.ts @@ -3,7 +3,7 @@ // @Filename: /a.ts ////export {}; ////declare global { -//// [|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|](): void;|] +//// [|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|](): void;|] ////} // @Filename: /b.ts diff --git a/tests/cases/fourslash/findAllRefsImportDefault.ts b/tests/cases/fourslash/findAllRefsImportDefault.ts index 253bbd4ae3f..5c491fc29f6 100644 --- a/tests/cases/fourslash/findAllRefsImportDefault.ts +++ b/tests/cases/fourslash/findAllRefsImportDefault.ts @@ -1,13 +1,13 @@ /// // @Filename: f.ts -////[|export { [|{| "declarationRangeIndex": 0 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}default|] };|] -////[|function /*start*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}foo|](a: number, b: number) { +////[|export { [|{| "contextRangeIndex": 0 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}default|] };|] +////[|function /*start*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}foo|](a: number, b: number) { //// return a + b; ////}|] // @Filename: b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}bar|] from "./f";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}bar|] from "./f";|] ////[|bar|](1, 2); verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsImportEquals.ts b/tests/cases/fourslash/findAllRefsImportEquals.ts index c085874d910..7a35f4a9fdb 100644 --- a/tests/cases/fourslash/findAllRefsImportEquals.ts +++ b/tests/cases/fourslash/findAllRefsImportEquals.ts @@ -1,7 +1,7 @@ /// ////import j = N./**/ [|q|]; -////namespace N { [|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 1 |}q|] = 0;|] } +////namespace N { [|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 1 |}q|] = 0;|] } goTo.marker(); verify.referenceGroups("", [{ definition: "const N.q: 0", ranges: test.rangesByText().get("q") }]); diff --git a/tests/cases/fourslash/findAllRefsImportEqualsJsonFile.ts b/tests/cases/fourslash/findAllRefsImportEqualsJsonFile.ts index 97147e4a1f6..f8b40c908f3 100644 --- a/tests/cases/fourslash/findAllRefsImportEqualsJsonFile.ts +++ b/tests/cases/fourslash/findAllRefsImportEqualsJsonFile.ts @@ -5,11 +5,11 @@ // @resolveJsonModule: true // @Filename: /a.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}j|] = require("[|{| "declarationRangeIndex": 0 |}./j.json|]");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}j|] = require("[|{| "contextRangeIndex": 0 |}./j.json|]");|] ////[|j|]; // @Filename: /b.js -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}j|] = require("[|{| "declarationRangeIndex": 4 |}./j.json|]");|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}j|] = require("[|{| "contextRangeIndex": 4 |}./j.json|]");|] ////[|j|]; // @Filename: /j.json diff --git a/tests/cases/fourslash/findAllRefsImportNamed.ts b/tests/cases/fourslash/findAllRefsImportNamed.ts index 50a88c2ed48..dab150508a3 100644 --- a/tests/cases/fourslash/findAllRefsImportNamed.ts +++ b/tests/cases/fourslash/findAllRefsImportNamed.ts @@ -1,8 +1,8 @@ /// // @Filename: f.ts -////[|export { [|{| "declarationRangeIndex": 0 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|] }|] -////[|function /*start*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}foo|](a: number, b: number) { }|] +////[|export { [|{| "contextRangeIndex": 0 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|] }|] +////[|function /*start*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}foo|](a: number, b: number) { }|] // @Filename: b.ts ////import x = require("./f"); diff --git a/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts b/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts index 56255873bc1..017ea4b520d 100644 --- a/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts +++ b/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts @@ -2,21 +2,21 @@ // @allowSyntheticDefaultimports: true // @Filename: /node_modules/a/index.d.ts -////[|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}a|](): void;|] -////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|] { +////[|declare function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}a|](): void;|] +////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|] { //// export const x: number; ////}|] -////[|export = [|{| "declarationRangeIndex": 4 |}a|];|] +////[|export = [|{| "contextRangeIndex": 4 |}a|];|] // Import with different name and we find local refs // @Filename: /b.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}b|] from "a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}b|] from "a";|] ////[|b|](); ////[|b|].x; // Import with same name and we find all refs // @Filename: /c.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}a|] from "a";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}a|] from "a";|] ////[|a|](); ////[|a|].x; diff --git a/tests/cases/fourslash/findAllRefsImportType.ts b/tests/cases/fourslash/findAllRefsImportType.ts index ad21110fa0f..5ae1495ca55 100644 --- a/tests/cases/fourslash/findAllRefsImportType.ts +++ b/tests/cases/fourslash/findAllRefsImportType.ts @@ -4,7 +4,7 @@ // @Filename: /a.js ////module.exports = 0; -////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}N|] = number;|] +////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}N|] = number;|] // @Filename: /b.js ////type T = import("./a").[|N|]; diff --git a/tests/cases/fourslash/findAllRefsInClassExpression.ts b/tests/cases/fourslash/findAllRefsInClassExpression.ts index a6e6de3d1f1..b2c18543c41 100644 --- a/tests/cases/fourslash/findAllRefsInClassExpression.ts +++ b/tests/cases/fourslash/findAllRefsInClassExpression.ts @@ -1,8 +1,8 @@ /// -////interface I { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}boom|](): void;|] } +////interface I { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}boom|](): void;|] } ////new class C implements I { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}boom|](){}|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}boom|](){}|] ////} const [r0Def, r0, r1Def, r1] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts b/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts index 34a17d8306d..aa80c6c3c1f 100644 --- a/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts +++ b/tests/cases/fourslash/findAllRefsIndexedAccessTypes.ts @@ -1,8 +1,8 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}0|]: number;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}s|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}0|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}s|]: string;|] ////} ////interface J { //// a: I[[|0|]], diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties1.ts b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts index 42bf6bcb70a..f2eef8e3a99 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties1.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts @@ -1,8 +1,8 @@ /// //// class class1 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|]() { }|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] //// } //// //// var v: class1; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties2.ts b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts index 3ba54ab0193..11795273799 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties2.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts @@ -1,8 +1,8 @@ /// //// interface interface1 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|](): void;|] // r0 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] // r1 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doStuff|](): void;|] // r0 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] // r1 //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties3.ts b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts index d7019164aeb..22f03d90982 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties3.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts @@ -1,16 +1,16 @@ /// //// class class1 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|]() { }|] // r0 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] // r1 +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] // r0 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] // r1 //// } //// interface interface1 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}doStuff|](): void;|] // r2 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}propName|]: string;|] // r3 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}doStuff|](): void;|] // r2 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}propName|]: string;|] // r3 //// } //// class class2 extends class1 implements interface1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}doStuff|]() { }|] // r4 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 10 |}propName|]: string;|] // r5 +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}doStuff|]() { }|] // r4 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 10 |}propName|]: string;|] // r5 //// } //// //// var v: class2; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties4.ts b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts index fde757d28d3..8fb97268d95 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties4.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts @@ -1,12 +1,12 @@ /// //// interface C extends D { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}prop0|]: string;|] // r0 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop1|]: number;|] // r1 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}prop0|]: string;|] // r0 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}prop1|]: number;|] // r1 //// } //// //// interface D extends C { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}prop0|]: string;|] // r2 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}prop0|]: string;|] // r2 //// } //// //// var d: D; diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties5.ts b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts index e917871f465..a8b37a254ab 100644 --- a/tests/cases/fourslash/findAllRefsInheritedProperties5.ts +++ b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts @@ -1,12 +1,12 @@ /// //// class C extends D { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}prop0|]: string;|] // r0 -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop1|]: number;|] // r1 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}prop0|]: string;|] // r0 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}prop1|]: number;|] // r1 //// } //// //// class D extends C { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}prop0|]: string;|] // r2 +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}prop0|]: string;|] // r2 //// } //// //// var d: D; diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates1.ts b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts index 44ad694d9bc..14e7d339991 100644 --- a/tests/cases/fourslash/findAllRefsInsideTemplates1.ts +++ b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts @@ -1,6 +1,6 @@ /// -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 10;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 10;|] ////var y = `${ [|x|] } ${ [|x|] }` verify.singleReferenceGroup("var x: number", "x"); diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates2.ts b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts index 09475e4cead..8096081e363 100644 --- a/tests/cases/fourslash/findAllRefsInsideTemplates2.ts +++ b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts @@ -1,6 +1,6 @@ /// -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|](...rest: any[]) { }|] +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|](...rest: any[]) { }|] ////[|f|] `${ [|f|] } ${ [|f|] }` verify.singleReferenceGroup("function f(...rest: any[]): void", "f"); diff --git a/tests/cases/fourslash/findAllRefsInsideWithBlock.ts b/tests/cases/fourslash/findAllRefsInsideWithBlock.ts index c31ab04376d..991bf257538 100644 --- a/tests/cases/fourslash/findAllRefsInsideWithBlock.ts +++ b/tests/cases/fourslash/findAllRefsInsideWithBlock.ts @@ -1,6 +1,6 @@ /// -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] //// ////with ({}) { //// var y = x; // Reference of x here should not be picked diff --git a/tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts b/tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts index f03511adf51..fb3cdf5bc33 100644 --- a/tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts +++ b/tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts @@ -5,7 +5,7 @@ // @allowJs: true // @Filename: /a.js -/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|]|] */ +/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */ //// /////** //// * @return {[|T|]} diff --git a/tests/cases/fourslash/findAllRefsMappedType.ts b/tests/cases/fourslash/findAllRefsMappedType.ts index 21090b0f32b..a505f41a151 100644 --- a/tests/cases/fourslash/findAllRefsMappedType.ts +++ b/tests/cases/fourslash/findAllRefsMappedType.ts @@ -1,6 +1,6 @@ /// -////interface T { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: number;|] } +////interface T { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number;|] } ////type U = { readonly [K in keyof T]?: string }; ////declare const t: T; ////t.[|a|]; diff --git a/tests/cases/fourslash/findAllRefsModuleAugmentation.ts b/tests/cases/fourslash/findAllRefsModuleAugmentation.ts index df8fb0ed615..35e42f7088d 100644 --- a/tests/cases/fourslash/findAllRefsModuleAugmentation.ts +++ b/tests/cases/fourslash/findAllRefsModuleAugmentation.ts @@ -1,7 +1,7 @@ /// // @Filename: /node_modules/foo/index.d.ts -////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|] +////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|] // @Filename: /a.ts ////import * as foo from "foo"; diff --git a/tests/cases/fourslash/findAllRefsModuleDotExports.ts b/tests/cases/fourslash/findAllRefsModuleDotExports.ts index 165944ba356..2d9a67a2155 100644 --- a/tests/cases/fourslash/findAllRefsModuleDotExports.ts +++ b/tests/cases/fourslash/findAllRefsModuleDotExports.ts @@ -3,10 +3,10 @@ // @allowJs: true // @Filename: /a.js -////[|const b = require("[|{| "declarationRangeIndex": 0 |}./b|]");|] +////[|const b = require("[|{| "contextRangeIndex": 0 |}./b|]");|] // @Filename: /b.js -////[|[|{| "declarationRangeIndex": 2 |}module|].exports = 0;|] +////[|[|{| "contextRangeIndex": 2 |}module|].exports = 0;|] const [r0Def, r0, rDef, r1] = test.ranges(); verify.singleReferenceGroup('module "/b"', [r0, r1]); diff --git a/tests/cases/fourslash/findAllRefsNoImportClause.ts b/tests/cases/fourslash/findAllRefsNoImportClause.ts index fc133afc4d8..4226af2b4cf 100644 --- a/tests/cases/fourslash/findAllRefsNoImportClause.ts +++ b/tests/cases/fourslash/findAllRefsNoImportClause.ts @@ -3,7 +3,7 @@ // https://github.com/Microsoft/TypeScript/issues/15452 // @Filename: /a.ts -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] // @Filename: /b.ts ////import "./a"; diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts index 404acea3ca4..ca1a23740ba 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName01.ts @@ -1,11 +1,11 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// ////var foo: I; -////[|var { [|{| "declarationRangeIndex": 2 |}property1|]: prop1 } = foo;|] +////[|var { [|{| "contextRangeIndex": 2 |}property1|]: prop1 } = foo;|] verify.singleReferenceGroup("(property) I.property1: number", "property1"); diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts index 95bfdc51d82..fba2676f6dd 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName02.ts @@ -1,11 +1,11 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// ////var foo: I; -////[|var { [|{| "declarationRangeIndex": 2 |}property1|]: {} } = foo;|] +////[|var { [|{| "contextRangeIndex": 2 |}property1|]: {} } = foo;|] verify.singleReferenceGroup("(property) I.property1: number", "property1"); diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts index aa209d15b54..db7c9d6f71f 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName03.ts @@ -1,12 +1,12 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// ////var foo: I; -////[|var [{ [|{| "declarationRangeIndex": 2 |}property1|]: prop1 }, { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}property1|], property2 } ] = [foo, foo];|] +////[|var [{ [|{| "contextRangeIndex": 2 |}property1|]: prop1 }, { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}property1|], property2 } ] = [foo, foo];|] const [r0Def, r0, r1Def, r1, r2] = test.ranges(); verify.referenceGroups([r0, r1], [{ diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts index b3fc306e47b..19bbf7d6cd8 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts @@ -1,12 +1,12 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// -////function f([|{ [|{| "declarationRangeIndex": 2 |}property1|]: p1 }: I|], -//// [|{ [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}property1|] }: I|], +////function f([|{ [|{| "contextRangeIndex": 2 |}property1|]: p1 }: I|], +//// [|{ [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}property1|] }: I|], //// { property1: p2 }) { //// //// return [|property1|] + 1; diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts index 2cf78e46c96..3405d1db44b 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName06.ts @@ -1,19 +1,19 @@ /// ////interface I { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// ////var elems: I[]; -////for ([|let { [|{| "declarationRangeIndex": 2 |}property1|]: p } of elems|]) { +////for ([|let { [|{| "contextRangeIndex": 2 |}property1|]: p } of elems|]) { ////} -////for ([|let { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}property1|] } of elems|]) { +////for ([|let { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}property1|] } of elems|]) { ////} -////for ([|var { [|{| "declarationRangeIndex": 6 |}property1|]: p1 } of elems|]) { +////for ([|var { [|{| "contextRangeIndex": 6 |}property1|]: p1 } of elems|]) { ////} ////var p2; -////for ([|{ [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}property1|] : p2 } of elems|]) { +////for ([|{ [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}property1|] : p2 } of elems|]) { ////} const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4Def, r4] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts index 318f26dc864..6fa268a2b7b 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName07.ts @@ -2,6 +2,6 @@ ////let p, b; //// -////p, [|[{ [|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: p, b }] = [{ [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|]: 10|], b: true }]|]; +////p, [|[{ [|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: p, b }] = [{ [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|]: 10|], b: true }]|]; verify.singleReferenceGroup("(property) a: any", "a"); diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts index 37c3a6ab0e1..64413cc8cba 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName10.ts @@ -1,11 +1,11 @@ /// ////interface Recursive { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}next|]?: Recursive;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}next|]?: Recursive;|] //// value: any; ////} //// -////function f ([|{ [|{| "declarationRangeIndex": 2 |}next|]: { [|{| "declarationRangeIndex": 2 |}next|]: x} }: Recursive|]) { +////function f ([|{ [|{| "contextRangeIndex": 2 |}next|]: { [|{| "contextRangeIndex": 2 |}next|]: x} }: Recursive|]) { ////} verify.singleReferenceGroup("(property) Recursive.next?: Recursive", "next"); diff --git a/tests/cases/fourslash/findAllRefsOfConstructor.ts b/tests/cases/fourslash/findAllRefsOfConstructor.ts index 26611ef9a03..b5c02e09c03 100644 --- a/tests/cases/fourslash/findAllRefsOfConstructor.ts +++ b/tests/cases/fourslash/findAllRefsOfConstructor.ts @@ -2,11 +2,11 @@ ////class A { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|](s: string) {}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|](s: string) {}|] ////} ////class B extends A { } ////class C extends B { -//// [|[|{| "declarationRangeIndex": 2 |}constructor|]() { +//// [|[|{| "contextRangeIndex": 2 |}constructor|]() { //// [|super|](""); //// }|] ////} diff --git a/tests/cases/fourslash/findAllRefsOfConstructor2.ts b/tests/cases/fourslash/findAllRefsOfConstructor2.ts index c51c7a1c098..5c65a098f4f 100644 --- a/tests/cases/fourslash/findAllRefsOfConstructor2.ts +++ b/tests/cases/fourslash/findAllRefsOfConstructor2.ts @@ -2,13 +2,13 @@ ////class A { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|](s: string) {}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|](s: string) {}|] ////} ////class B extends A { -//// [|[|{| "declarationRangeIndex": 2 |}constructor|]() { [|super|](""); }|] +//// [|[|{| "contextRangeIndex": 2 |}constructor|]() { [|super|](""); }|] ////} ////class C extends B { -//// [|[|{| "declarationRangeIndex": 5 |}constructor|]() { +//// [|[|{| "contextRangeIndex": 5 |}constructor|]() { //// [|super|](); //// }|] ////} diff --git a/tests/cases/fourslash/findAllRefsOfConstructor_multipleFiles.ts b/tests/cases/fourslash/findAllRefsOfConstructor_multipleFiles.ts index 9e2681a2249..f768cb1df26 100644 --- a/tests/cases/fourslash/findAllRefsOfConstructor_multipleFiles.ts +++ b/tests/cases/fourslash/findAllRefsOfConstructor_multipleFiles.ts @@ -3,21 +3,21 @@ // @Filename: f.ts ////class A { -//// [|[|{| "declarationRangeIndex": 0 |}constructor|](s: string) {}|] +//// [|[|{| "contextRangeIndex": 0 |}constructor|](s: string) {}|] ////} ////class B extends A { } -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}A|], [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}B|] };|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}A|], [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}B|] };|] // @Filename: a.ts -////[|import { [|{| "declarationRangeIndex": 5 |}A|] as A1 } from "./f";|] +////[|import { [|{| "contextRangeIndex": 5 |}A|] as A1 } from "./f";|] ////const a1 = new [|A1|]("a1"); ////export default class extends A1 { } -////[|export { [|{| "declarationRangeIndex": 8 |}B|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}B1|] } from "./f";|] +////[|export { [|{| "contextRangeIndex": 8 |}B|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}B1|] } from "./f";|] // @Filename: b.ts -////[|import [|{| "declarationRangeIndex": 11 |}B|], { B1 } from "./a";|] +////[|import [|{| "contextRangeIndex": 11 |}B|], { B1 } from "./a";|] ////const d = new [|B|]("b"); ////const d1 = new [|B1|]("b1"); diff --git a/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts b/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts index 0bbc5024345..f89bd730a77 100644 --- a/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts +++ b/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts @@ -1,7 +1,7 @@ /// ////class X { -//// [|public [|{| "declarationRangeIndex": 0 |}constructor|]() {}|] +//// [|public [|{| "contextRangeIndex": 0 |}constructor|]() {}|] ////} ////var x = new [|X|](); diff --git a/tests/cases/fourslash/findAllRefsOnDecorators.ts b/tests/cases/fourslash/findAllRefsOnDecorators.ts index 0bb91f507ec..0c261c9dd5b 100644 --- a/tests/cases/fourslash/findAllRefsOnDecorators.ts +++ b/tests/cases/fourslash/findAllRefsOnDecorators.ts @@ -1,7 +1,7 @@ /// // @Filename: a.ts -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}decorator|](target) { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}decorator|](target) { //// return target; ////}|] ////[|decorator|](); diff --git a/tests/cases/fourslash/findAllRefsOnDefinition.ts b/tests/cases/fourslash/findAllRefsOnDefinition.ts index 007b571fd03..f70d8a396c5 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition.ts @@ -7,7 +7,7 @@ //// //// } //// -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){ +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|](){ //// return this; //// }|] //// diff --git a/tests/cases/fourslash/findAllRefsOnDefinition2.ts b/tests/cases/fourslash/findAllRefsOnDefinition2.ts index 1d58dd7c701..7041dc22282 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition2.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition2.ts @@ -3,7 +3,7 @@ //@Filename: findAllRefsOnDefinition2-import.ts ////export module Test{ //// -//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|] { }|] +//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|] { }|] //// //// export interface stop { } ////} diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases.ts b/tests/cases/fourslash/findAllRefsOnImportAliases.ts index 88d9bfa3f3a..52d9bd9c518 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases.ts @@ -1,16 +1,16 @@ /// //@Filename: a.ts -////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Class|] { +////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Class|] { ////}|] //@Filename: b.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Class|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Class|] } from "./a";|] //// ////var c = new [|Class|](); //@Filename: c.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}Class|] } from "./a";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}Class|] } from "./a";|] const ranges = test.ranges(); const [r0Def, r0, r1Def, r1, r2, r3Def, r3] = ranges; diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts index 6faccc01dc9..d29be30ee85 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts @@ -1,14 +1,14 @@ /// //@Filename: a.ts -////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Class|] {}|] +////[|export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Class|] {}|] //@Filename: b.ts -////[|import { [|{| "declarationRangeIndex": 2 |}Class|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}C2|] } from "./a";|] +////[|import { [|{| "contextRangeIndex": 2 |}Class|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}C2|] } from "./a";|] ////var c = new [|C2|](); //@Filename: c.ts -////[|export { [|{| "declarationRangeIndex": 6 |}Class|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}C3|] } from "./a";|] +////[|export { [|{| "contextRangeIndex": 6 |}Class|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}C3|] } from "./a";|] const ranges = test.rangesByText(); const classRanges = ranges.get("Class"); diff --git a/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts index f335f21a0b7..e0a01693059 100644 --- a/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts +++ b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts @@ -1,7 +1,7 @@ /// ////class ABCD { -//// constructor(private x: number, public y: number, [|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}z|]: number|]) { +//// constructor(private x: number, public y: number, [|private [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}z|]: number|]) { //// } //// //// func() { diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts index 49812d2810f..1abd696775a 100644 --- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration1.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}privateParam|]: number|]) { +//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}privateParam|]: number|]) { //// let localPrivate = [|privateParam|]; //// this.[|{| "isWriteAccess": true |}privateParam|] += 10; //// } diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts index 7ee352cfcde..96070a24c40 100644 --- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration2.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}publicParam|]: number|]) { +//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}publicParam|]: number|]) { //// let localPublic = [|publicParam|]; //// this.[|{| "isWriteAccess": true |}publicParam|] += 10; //// } diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts index 3d58989a0f3..d261e995a2e 100644 --- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration3.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|protected [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}protectedParam|]: number|]) { +//// constructor([|protected [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}protectedParam|]: number|]) { //// let localProtected = [|protectedParam|]; //// this.[|{| "isWriteAccess": true |}protectedParam|] += 10; //// } diff --git a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts index e8998dbbf70..1741fdfbe48 100644 --- a/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts +++ b/tests/cases/fourslash/findAllRefsParameterPropertyDeclaration_inheritance.ts @@ -1,12 +1,12 @@ /// ////class C { -//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: string|]) { +//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]: string|]) { //// [|x|]; //// } ////} ////class D extends C { -//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}x|]: string|]) { +//// constructor([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}x|]: string|]) { //// super([|x|]); //// } ////} diff --git a/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts b/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts index 1d920552375..3fe2a874760 100644 --- a/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts +++ b/tests/cases/fourslash/findAllRefsPrefixSuffixPreference.ts @@ -2,17 +2,17 @@ // @Filename: /file1.ts ////declare function log(s: string | number): void; -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}q|] = 1;|] -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}q|] };|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}q|] = 1;|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}q|] };|] ////const x = { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}z|]: 'value'|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}z|]: 'value'|] ////} -////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}z|] } = x;|] +////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}z|] } = x;|] ////log([|z|]); // @Filename: /file2.ts ////declare function log(s: string | number): void; -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}q|] } from "./file1";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 9 |}q|] } from "./file1";|] ////log([|q|] + 1); verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts index ec666c1d8a6..22c69a1616f 100644 --- a/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts +++ b/tests/cases/fourslash/findAllRefsPropertyContextuallyTypedByTypeParam01.ts @@ -1,12 +1,12 @@ /// ////interface IFoo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: string;|] ////} ////class C { //// method() { //// var x: T = { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|]: ""|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|]: ""|] //// }; //// x.[|a|]; //// } @@ -14,7 +14,7 @@ //// //// ////var x: IFoo = { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}a|]: "ss"|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}a|]: "ss"|] ////}; verify.singleReferenceGroup("(property) IFoo.a: string", "a"); diff --git a/tests/cases/fourslash/findAllRefsReExportLocal.ts b/tests/cases/fourslash/findAllRefsReExportLocal.ts index e7601fd072b..ddc236d3e60 100644 --- a/tests/cases/fourslash/findAllRefsReExportLocal.ts +++ b/tests/cases/fourslash/findAllRefsReExportLocal.ts @@ -3,12 +3,12 @@ // @noLib: true // @Filename: /a.ts -////[|var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|];|] -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] };|] -////[|export { [|{| "declarationRangeIndex": 4 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}y|] };|] +////[|var [|{| "isDefinition": true, "contextRangeIndex": 0 |}x|];|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] };|] +////[|export { [|{| "contextRangeIndex": 4 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}y|] };|] // @Filename: /b.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}x|], [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}y|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}x|], [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}y|] } from "./a";|] ////[|x|]; [|y|]; verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts b/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts index 8649f8b3b3d..5d7bd485d05 100644 --- a/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts +++ b/tests/cases/fourslash/findAllRefsReExportRightNameWrongSymbol.ts @@ -1,18 +1,18 @@ /// // @Filename: /a.ts -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] // @Filename: /b.ts -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] = 0;|] //@Filename: /c.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|] } from "./b";|] -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|] } from "./a";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}x|] } from "./b";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}x|] } from "./a";|] ////[|x|]; // @Filename: /d.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}x|] } from "./c";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 9 |}x|] } from "./c";|] verify.noErrors(); const [aDef, a, bDef, b, cFromBDef, cFromB, cFromADef, cFromA, cUse, dDef, d] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsReExportStar.ts b/tests/cases/fourslash/findAllRefsReExportStar.ts index 759ef38cabe..f8103f70a9b 100644 --- a/tests/cases/fourslash/findAllRefsReExportStar.ts +++ b/tests/cases/fourslash/findAllRefsReExportStar.ts @@ -1,13 +1,13 @@ /// // @Filename: /a.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|] +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|](): void {}|] // @Filename: /b.ts ////export * from "./a"; // @Filename: /c.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}foo|] } from "./b";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}foo|] } from "./b";|] verify.noErrors(); const ranges = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsReExport_broken.ts b/tests/cases/fourslash/findAllRefsReExport_broken.ts index e8d35239795..4e17e26224e 100644 --- a/tests/cases/fourslash/findAllRefsReExport_broken.ts +++ b/tests/cases/fourslash/findAllRefsReExport_broken.ts @@ -1,6 +1,6 @@ /// // @Filename: /a.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] };|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] };|] verify.singleReferenceGroup("export x", "x"); diff --git a/tests/cases/fourslash/findAllRefsReExport_broken2.ts b/tests/cases/fourslash/findAllRefsReExport_broken2.ts index 5ae6afca6a9..a9d73730679 100644 --- a/tests/cases/fourslash/findAllRefsReExport_broken2.ts +++ b/tests/cases/fourslash/findAllRefsReExport_broken2.ts @@ -1,6 +1,6 @@ /// // @Filename: /a.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] } from "nonsense";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] } from "nonsense";|] verify.singleReferenceGroup("export x", "x"); diff --git a/tests/cases/fourslash/findAllRefsReExports.ts b/tests/cases/fourslash/findAllRefsReExports.ts index 69f2cff209c..76af87ed125 100644 --- a/tests/cases/fourslash/findAllRefsReExports.ts +++ b/tests/cases/fourslash/findAllRefsReExports.ts @@ -1,22 +1,22 @@ /// // @Filename: /a.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|] +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|](): void {}|] // @Filename: /b.ts -////[|export { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}bar|] } from "./a";|] +////[|export { [|{| "contextRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}bar|] } from "./a";|] // @Filename: /c.ts -////[|export { [|{| "declarationRangeIndex": 5 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}default|] } from "./a";|] +////[|export { [|{| "contextRangeIndex": 5 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}default|] } from "./a";|] // @Filename: /d.ts -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}default|] } from "./c";|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}default|] } from "./c";|] // @Filename: /e.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}bar|] } from "./b";|] -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}baz|] from "./c";|] -////[|import { [|{| "declarationRangeIndex": 14 |}default|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}bang|] } from "./c";|] -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 17 |}boom|] from "./d";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}bar|] } from "./b";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}baz|] from "./c";|] +////[|import { [|{| "contextRangeIndex": 14 |}default|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}bang|] } from "./c";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 17 |}boom|] from "./d";|] ////[|bar|](); [|baz|](); [|bang|](); [|boom|](); verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsReExports2.ts b/tests/cases/fourslash/findAllRefsReExports2.ts index 018bc6f6e08..b3eee515639 100644 --- a/tests/cases/fourslash/findAllRefsReExports2.ts +++ b/tests/cases/fourslash/findAllRefsReExports2.ts @@ -1,10 +1,10 @@ /// // @Filename: /a.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void {}|] +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|](): void {}|] // @Filename: /b.ts -////[|import { [|{| "declarationRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}oof|] } from "./a";|] +////[|import { [|{| "contextRangeIndex": 2 |}foo|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}oof|] } from "./a";|] verify.noErrors(); const [r0Def, r0, r1Def, r1, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts index 7afa3d2ef03..1886bd34d10 100644 --- a/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts +++ b/tests/cases/fourslash/findAllRefsRedeclaredPropertyInDerivedInterface.ts @@ -3,13 +3,13 @@ // @noLib: true ////interface A { -//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number | string;|] +//// [|readonly [|{| "isDefinition": true, "contextRangeIndex": 0 |}x|]: number | string;|] ////} ////interface B extends A { -//// [|readonly [|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: number;|] +//// [|readonly [|{| "isDefinition": true, "contextRangeIndex": 2 |}x|]: number;|] ////} -////const a: A = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: 0|] }; -////const b: B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}x|]: 0|] }; +////const a: A = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}x|]: 0|] }; +////const b: B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}x|]: 0|] }; const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = test.ranges(); verify.referenceGroups([r0, r1, r2, r3], [ diff --git a/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts b/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts index b161c467d73..6ccede2db1e 100644 --- a/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts +++ b/tests/cases/fourslash/findAllRefsRenameImportWithSameName.ts @@ -1,10 +1,10 @@ /// // @Filename: /a.ts -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] //@Filename: /b.ts -////[|import { [|{| "declarationRangeIndex": 2 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] } from "./a";|] +////[|import { [|{| "contextRangeIndex": 2 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] } from "./a";|] ////[|x|]; verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefsRootSymbols.ts b/tests/cases/fourslash/findAllRefsRootSymbols.ts index 3718562cb7f..0928c53fdcb 100644 --- a/tests/cases/fourslash/findAllRefsRootSymbols.ts +++ b/tests/cases/fourslash/findAllRefsRootSymbols.ts @@ -1,8 +1,8 @@ /// -////interface I { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: {};|] } -////interface J { [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}x|]: {};|] } -////declare const o: (I | J) & { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}x|]: string|] }; +////interface I { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}x|]: {};|] } +////interface J { [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}x|]: {};|] } +////declare const o: (I | J) & { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}x|]: string|] }; ////o.[|x|]; const [r0Def, r0, r1Def, r1, r2Def, r2, r3] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsThisKeyword.ts b/tests/cases/fourslash/findAllRefsThisKeyword.ts index 25601011ad2..9779169bdd0 100644 --- a/tests/cases/fourslash/findAllRefsThisKeyword.ts +++ b/tests/cases/fourslash/findAllRefsThisKeyword.ts @@ -21,7 +21,7 @@ //// } ////} ////// These are *not* real uses of the 'this' keyword, they are identifiers. -////const x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}this|]: 0|] } +////const x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 9 |}this|]: 0|] } ////x.[|this|]; const [glob, f0, f1, g0, g1, x, y, constructor, method, propDefDef, propDef, propUse] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsTypedef.ts b/tests/cases/fourslash/findAllRefsTypedef.ts index 19dd6611ba7..c17f568946d 100644 --- a/tests/cases/fourslash/findAllRefsTypedef.ts +++ b/tests/cases/fourslash/findAllRefsTypedef.ts @@ -5,7 +5,7 @@ // @Filename: /a.js /////** //// * @typedef I {Object} -//// * [|@prop [|{| "isDefinition": true, "declarationRangeIndex": 0 |}p|] {number} +//// * [|@prop [|{| "isDefinition": true, "contextRangeIndex": 0 |}p|] {number} //// |]*/ //// /////** @type {I} */ diff --git a/tests/cases/fourslash/findAllRefsTypedef_importType.ts b/tests/cases/fourslash/findAllRefsTypedef_importType.ts index ad2df19bd07..4816406d518 100644 --- a/tests/cases/fourslash/findAllRefsTypedef_importType.ts +++ b/tests/cases/fourslash/findAllRefsTypedef_importType.ts @@ -4,7 +4,7 @@ // @Filename: /a.js ////module.exports = 0; -/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|]|] */ +/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|]|] */ ////const dummy = 0; // @Filename: /b.js diff --git a/tests/cases/fourslash/findAllRefsTypeofImport.ts b/tests/cases/fourslash/findAllRefsTypeofImport.ts index 4d381bedc17..c89c0037b59 100644 --- a/tests/cases/fourslash/findAllRefsTypeofImport.ts +++ b/tests/cases/fourslash/findAllRefsTypeofImport.ts @@ -1,7 +1,7 @@ /// // @Filename: /a.ts -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] ////declare const a: typeof import("./a"); ////a.[|x|]; diff --git a/tests/cases/fourslash/findAllRefsUnionProperty.ts b/tests/cases/fourslash/findAllRefsUnionProperty.ts index 61f4df03047..cb83398c191 100644 --- a/tests/cases/fourslash/findAllRefsUnionProperty.ts +++ b/tests/cases/fourslash/findAllRefsUnionProperty.ts @@ -1,11 +1,11 @@ /// ////type T = -//// | { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}type|]: "a",|] [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop|]: number|] } -//// | { [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}type|]: "b",|] [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}prop|]: string|] }; +//// | { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}type|]: "a",|] [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}prop|]: number|] } +//// | { [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}type|]: "b",|] [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}prop|]: string|] }; ////const tt: T = { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}type|]: "a"|], -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}prop|]: 0|], +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}type|]: "a"|], +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}prop|]: 0|], ////}; ////declare const t: T; ////if (t.[|type|] === "a") { diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts index 7da05388de2..a63d511ef09 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}_bar|]() { return 0; }|] +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}_bar|]() { return 0; }|] ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts index 9d64e11d64e..bc449992fc0 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__bar|]() { return 0; }|] +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}__bar|]() { return 0; }|] ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts index e93dfe75b9d..8af1468e8b8 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}___bar|]() { return 0; }|] +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}___bar|]() { return 0; }|] ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts index 131cff144e4..dcc15f35382 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}____bar|]() { return 0; }|] +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}____bar|]() { return 0; }|] ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts index 389772051e5..26e7ed094ff 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts @@ -3,7 +3,7 @@ ////class Foo { //// public _bar; //// public __bar; -//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 0 |}___bar|];|] +//// [|public [|{| "isDefinition": true, "contextRangeIndex": 0 |}___bar|];|] //// public ____bar; ////} //// diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts index 77fd15f1296..7b1a4066adf 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts @@ -2,7 +2,7 @@ ////class Foo { //// public _bar; -//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 0 |}__bar|];|] +//// [|public [|{| "isDefinition": true, "contextRangeIndex": 0 |}__bar|];|] //// public ___bar; //// public ____bar; ////} diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts index 2616d6f7f3c..1876e71d3ae 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts @@ -1,6 +1,6 @@ /// -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__foo|]() { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}__foo|]() { //// [|__foo|](); ////}|] diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts index 3785099aa2f..1c8b80dde95 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts @@ -1,6 +1,6 @@ /// -////([|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__foo|]() { +////([|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}__foo|]() { //// [|__foo|](); ////}|]) diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts index f4506809e76..5fd2097788e 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts @@ -1,6 +1,6 @@ /// -////([|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}___foo|]() { +////([|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}___foo|]() { //// [|___foo|](); ////}|]) diff --git a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts index 490b87d624d..3dc322c842c 100644 --- a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts +++ b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts @@ -1,9 +1,9 @@ /// -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}name|] = "Foo";|] +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}name|] = "Foo";|] //// //// var obj = { [|{| "isWriteAccess": true, "isDefinition": true |}name|] }; -//// var obj1 = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}name|]:[|name|]|] }; +//// var obj1 = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}name|]:[|name|]|] }; //// obj.[|name|]; const [r0Def, r0, r1, r2Def, r2, r3, r4] = test.ranges(); diff --git a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts index 39804714464..52aaf8d2f1f 100644 --- a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts +++ b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts @@ -1,8 +1,8 @@ /// -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}dx|] = "Foo";|] +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}dx|] = "Foo";|] //// -//// module M { [|export var [|{| "isDefinition": true, "declarationRangeIndex": 2 |}dx|];|] } +//// module M { [|export var [|{| "isDefinition": true, "contextRangeIndex": 2 |}dx|];|] } //// module M { //// var z = 100; //// export var y = { [|{| "isWriteAccess": true, "isDefinition": true |}dx|], z }; diff --git a/tests/cases/fourslash/findAllRefs_importType_exportEquals.ts b/tests/cases/fourslash/findAllRefs_importType_exportEquals.ts index e2c86d60c9c..61e66de94ca 100644 --- a/tests/cases/fourslash/findAllRefs_importType_exportEquals.ts +++ b/tests/cases/fourslash/findAllRefs_importType_exportEquals.ts @@ -1,15 +1,15 @@ /// // @Filename: /a.ts -////[|type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|] -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}T|] { +////[|type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|] +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] { //// export type U = string; ////}|] -////[|[|{| "declarationRangeIndex": 4 |}export|] = [|{| "declarationRangeIndex": 4 |}T|];|] +////[|[|{| "contextRangeIndex": 4 |}export|] = [|{| "contextRangeIndex": 4 |}T|];|] // @Filename: /b.ts -////[|const x: import("[|{| "declarationRangeIndex": 7 |}./[|a|]|]") = 0;|] -////[|const y: import("[|{| "declarationRangeIndex": 10 |}./[|a|]|]").U = "";|] +////[|const x: import("[|{| "contextRangeIndex": 7 |}./[|a|]|]") = 0;|] +////[|const y: import("[|{| "contextRangeIndex": 10 |}./[|a|]|]").U = "";|] verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefs_importType_js.ts b/tests/cases/fourslash/findAllRefs_importType_js.ts index 51d99aaae7a..0f952ae28e3 100644 --- a/tests/cases/fourslash/findAllRefs_importType_js.ts +++ b/tests/cases/fourslash/findAllRefs_importType_js.ts @@ -4,13 +4,13 @@ // @checkJs: true // @Filename: /a.js -////[|[|{| "declarationRangeIndex": 0 |}module|].exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}C|] {}|];|] -////[|module.exports.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}D|] = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}D|] {}|];|] +////[|[|{| "contextRangeIndex": 0 |}module|].exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}C|] {}|];|] +////[|module.exports.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}D|] = [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}D|] {}|];|] // @Filename: /b.js -/////** [|@type {import("[|{| "declarationRangeIndex": 8 |}./a|]")}|] */ +/////** [|@type {import("[|{| "contextRangeIndex": 8 |}./a|]")}|] */ ////const x = 0; -/////** [|@type {import("[|{| "declarationRangeIndex": 10 |}./a|]").[|D|]}|] */ +/////** [|@type {import("[|{| "contextRangeIndex": 10 |}./a|]").[|D|]}|] */ ////const y = 0; verify.noErrors(); diff --git a/tests/cases/fourslash/findAllRefs_importType_meaningAtLocation.ts b/tests/cases/fourslash/findAllRefs_importType_meaningAtLocation.ts index 367a6f0febd..2671cd0c00a 100644 --- a/tests/cases/fourslash/findAllRefs_importType_meaningAtLocation.ts +++ b/tests/cases/fourslash/findAllRefs_importType_meaningAtLocation.ts @@ -1,8 +1,8 @@ /// // @Filename: /a.ts -////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = 0;|] -////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}T|] = 0;|] +////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = 0;|] +////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] = 0;|] // @Filename: /b.ts ////const x: import("./a").[|T|] = 0; diff --git a/tests/cases/fourslash/findAllRefs_importType_named.ts b/tests/cases/fourslash/findAllRefs_importType_named.ts index ae3b7585764..921464e9b83 100644 --- a/tests/cases/fourslash/findAllRefs_importType_named.ts +++ b/tests/cases/fourslash/findAllRefs_importType_named.ts @@ -1,8 +1,8 @@ /// // @Filename: /a.ts -////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|] -////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}U|] = string;|] +////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|] +////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}U|] = string;|] // @Filename: /b.ts ////const x: import("./a").[|T|] = 0; diff --git a/tests/cases/fourslash/findAllRefs_importType_typeofImport.ts b/tests/cases/fourslash/findAllRefs_importType_typeofImport.ts index 082b34b6792..89741206c74 100644 --- a/tests/cases/fourslash/findAllRefs_importType_typeofImport.ts +++ b/tests/cases/fourslash/findAllRefs_importType_typeofImport.ts @@ -4,7 +4,7 @@ ////export const x = 0; // @Filename: /b.ts -////[|const x: typeof import("[|{| "declarationRangeIndex": 0 |}./a|]") = { x: 0 };|] -////[|const y: typeof import("[|{| "declarationRangeIndex": 2 |}./a|]") = { x: 0 };|] +////[|const x: typeof import("[|{| "contextRangeIndex": 0 |}./a|]") = { x: 0 };|] +////[|const y: typeof import("[|{| "contextRangeIndex": 2 |}./a|]") = { x: 0 };|] verify.singleReferenceGroup('module "/a"', "./a"); diff --git a/tests/cases/fourslash/findAllRefs_jsEnum.ts b/tests/cases/fourslash/findAllRefs_jsEnum.ts index c82c2507108..f9033d6c588 100644 --- a/tests/cases/fourslash/findAllRefs_jsEnum.ts +++ b/tests/cases/fourslash/findAllRefs_jsEnum.ts @@ -4,7 +4,7 @@ // @Filename: /a.js /////** @enum {string} */ -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}E|] = { A: "" };|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}E|] = { A: "" };|] ////[|E|]["A"]; /////** @type {[|E|]} */ ////const e = [|E|].A; diff --git a/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts b/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts index 94b07d9305e..bfa20f51959 100644 --- a/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts +++ b/tests/cases/fourslash/findReferencesAcrossMultipleProjects.ts @@ -1,7 +1,7 @@ /// //@Filename: a.ts -////[|var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number;|] +////[|var [|{| "isDefinition": true, "contextRangeIndex": 0 |}x|]: number;|] //@Filename: b.ts /////// diff --git a/tests/cases/fourslash/findReferencesAfterEdit.ts b/tests/cases/fourslash/findReferencesAfterEdit.ts index 9193f10f33d..4974132dd12 100644 --- a/tests/cases/fourslash/findReferencesAfterEdit.ts +++ b/tests/cases/fourslash/findReferencesAfterEdit.ts @@ -2,7 +2,7 @@ // @Filename: a.ts ////interface A { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}foo|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}foo|]: string;|] ////} // @Filename: b.ts diff --git a/tests/cases/fourslash/findReferencesJSXTagName.ts b/tests/cases/fourslash/findReferencesJSXTagName.ts index cd6675c7c3f..3fb221822b3 100644 --- a/tests/cases/fourslash/findReferencesJSXTagName.ts +++ b/tests/cases/fourslash/findReferencesJSXTagName.ts @@ -1,14 +1,14 @@ /// // @Filename: index.tsx -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}SubmissionComp|] } from "./RedditSubmission"|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}SubmissionComp|] } from "./RedditSubmission"|] ////function displaySubreddit(subreddit: string) { //// let components = submissions -//// .map((value, index) => [|<[|{| "declarationRangeIndex": 2 |}SubmissionComp|] key={ index } elementPosition= { index } {...value.data} />|]); +//// .map((value, index) => [|<[|{| "contextRangeIndex": 2 |}SubmissionComp|] key={ index } elementPosition= { index } {...value.data} />|]); ////} // @Filename: RedditSubmission.ts -////export const [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}SubmissionComp|] = (submission: SubmissionProps) => +////export const [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}SubmissionComp|] = (submission: SubmissionProps) => ////
; const [r0Def, r0, r1Def, r1, r2Def, r2] = test.ranges(); diff --git a/tests/cases/fourslash/findReferencesJSXTagName2.ts b/tests/cases/fourslash/findReferencesJSXTagName2.ts index 8036b943cc8..dc942720a0e 100644 --- a/tests/cases/fourslash/findReferencesJSXTagName2.ts +++ b/tests/cases/fourslash/findReferencesJSXTagName2.ts @@ -1,7 +1,7 @@ /// // @Filename: index.tsx -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}obj|] = {Component: () =>
};|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}obj|] = {Component: () =>
};|] ////const element = <[|obj|].Component/>; verify.singleReferenceGroup(`const obj: { diff --git a/tests/cases/fourslash/findReferencesJSXTagName3.ts b/tests/cases/fourslash/findReferencesJSXTagName3.ts index b4e87388f99..2613f864730 100644 --- a/tests/cases/fourslash/findReferencesJSXTagName3.ts +++ b/tests/cases/fourslash/findReferencesJSXTagName3.ts @@ -6,19 +6,19 @@ ////namespace JSX { //// export interface Element { } //// export interface IntrinsicElements { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}div|]: any;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}div|]: any;|] //// } ////} //// -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Comp|] = () => -//// [|<[|{| "declarationRangeIndex": 4 |}div|]> +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Comp|] = () => +//// [|<[|{| "contextRangeIndex": 4 |}div|]> //// Some content -//// [|<[|{| "declarationRangeIndex": 6 |}div|]>More content|] -//// |];|] +//// [|<[|{| "contextRangeIndex": 6 |}div|]>More content|] +//// |];|] //// -////const x = [|<[|{| "declarationRangeIndex": 10 |}Comp|]> +////const x = [|<[|{| "contextRangeIndex": 10 |}Comp|]> //// Content -////|]; +////|]; const [d0Def, d0, c0Def, c0, d1Def, d1, d2Def, d2, d3, d4, c1Def, c1, c2] = test.ranges(); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfArrowFunction.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfArrowFunction.ts index 094191f09ce..839a270e611 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfArrowFunction.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfArrowFunction.ts @@ -1,5 +1,5 @@ /// -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|] = x => x + 1;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|] = x => x + 1;|] ////[|f|](12); verify.singleReferenceGroup("var f: (x: any) => any", "f"); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts index 44a7c70e001..e5df8984ad3 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts @@ -1,5 +1,5 @@ /// -////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|], y } = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|]: 1|], y: 2 };|] +////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|], y } = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|]: 1|], y: 2 };|] ////const z = [|x|]; const [r0Def, r0, r1Def, r1, r2] = test.ranges(); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts index 7d4c3517767..c6ab29fd884 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts @@ -1,5 +1,5 @@ /// -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] { //// n: number; //// constructor() { //// this.n = 12; diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts index 23f3eca6cf6..16c29b88006 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts @@ -1,5 +1,5 @@ /// -////let o = { [|["[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|]"]: 12|] }; +////let o = { [|["[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|]"]: 12|] }; ////let y = o.[|foo|]; ////let z = o['[|foo|]']; diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfEnum.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfEnum.ts index 0b76608e523..26010967b25 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfEnum.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfEnum.ts @@ -1,5 +1,5 @@ /// -////[|enum [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}E|] { +////[|enum [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}E|] { //// First, //// Second ////}|] diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfExport.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfExport.ts index 1f0439b8d50..61c25e0de2e 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfExport.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfExport.ts @@ -1,8 +1,8 @@ /// // @Filename: m.ts -////[|export var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 12;|] +////[|export var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 12;|] // @Filename: main.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|] } from "./m";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] } from "./m";|] ////const y = [|x|]; const ranges = test.ranges(); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfFunction.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfFunction.ts index e45dcf110d4..1275671d433 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfFunction.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfFunction.ts @@ -1,5 +1,5 @@ /// -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}func|](x: number) { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}func|](x: number) { ////}|] ////[|func|](x) diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterface.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterface.ts index 974cc7d4589..3fe4753feef 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterface.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterface.ts @@ -1,5 +1,5 @@ /// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}I|] { +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}I|] { //// p: number; ////}|] ////let i: [|I|] = { p: 12 }; diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts index df19e7473e9..a454f212531 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts @@ -1,11 +1,11 @@ /// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Numbers|] { +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Numbers|] { //// p: number; ////}|] -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Numbers|] { +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Numbers|] { //// m: number; ////}|] -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}Numbers|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}Numbers|] { //// f(n: number) { //// return this.p + this.m + n; //// } diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfNamespace.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfNamespace.ts index b0f5030f454..48ec42cdac0 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfNamespace.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfNamespace.ts @@ -1,5 +1,5 @@ /// -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Numbers|] { +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Numbers|] { //// export var n = 12; ////}|] ////let x = [|Numbers|].n + 1; diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfNumberNamedProperty.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfNumberNamedProperty.ts index 4ace81eb773..02bdbb14f51 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfNumberNamedProperty.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfNumberNamedProperty.ts @@ -1,5 +1,5 @@ /// -////let o = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}1|]: 12|] }; +////let o = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}1|]: 12|] }; ////let y = o[[|1|]]; verify.singleReferenceGroup("(property) 1: number", "1"); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfParameter.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfParameter.ts index 8ac460150bc..1a09882464a 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfParameter.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfParameter.ts @@ -1,5 +1,5 @@ /// -////function f([|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number|]) { +////function f([|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]: number|]) { //// return [|x|] + 1 ////} diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfStringNamedProperty.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfStringNamedProperty.ts index 267cc1cdcbe..1e806fc4968 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfStringNamedProperty.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfStringNamedProperty.ts @@ -1,5 +1,5 @@ /// -////let o = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|]": 12|] }; +////let o = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|]": 12|] }; ////let y = o.[|x|]; verify.singleReferenceGroup('(property) "x": number', "x"); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfTypeAlias.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfTypeAlias.ts index 122c6c8ea16..dae8c5e3840 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfTypeAlias.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfTypeAlias.ts @@ -1,5 +1,5 @@ /// -////[|type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Alias|]= number;|] +////[|type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Alias|]= number;|] ////let n: [|Alias|] = 12; verify.singleReferenceGroup("type Alias = number", "Alias"); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfVariable.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfVariable.ts index f3667912506..b90641779f6 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfVariable.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfVariable.ts @@ -1,5 +1,5 @@ /// -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|] = 0;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}x|] = 0;|] ////var assignmentRightHandSide = [|x|]; ////var assignmentRightHandSide2 = 1 + [|x|]; //// diff --git a/tests/cases/fourslash/javaScriptClass2.ts b/tests/cases/fourslash/javaScriptClass2.ts index d13a7727214..e8edf33bc42 100644 --- a/tests/cases/fourslash/javaScriptClass2.ts +++ b/tests/cases/fourslash/javaScriptClass2.ts @@ -6,8 +6,8 @@ // @Filename: Foo.js //// class Foo { //// constructor() { -//// [|this.[|{| "declarationRangeIndex": 0 |}union|] = 'foo';|] -//// [|this.[|{| "declarationRangeIndex": 2 |}union|] = 100;|] +//// [|this.[|{| "contextRangeIndex": 0 |}union|] = 'foo';|] +//// [|this.[|{| "contextRangeIndex": 2 |}union|] = 100;|] //// } //// method() { return this.[|union|]; } //// } diff --git a/tests/cases/fourslash/jsDocServices.ts b/tests/cases/fourslash/jsDocServices.ts index 75c8957b5eb..01619abe44d 100644 --- a/tests/cases/fourslash/jsDocServices.ts +++ b/tests/cases/fourslash/jsDocServices.ts @@ -7,7 +7,7 @@ /////** //// * @param /*use*/[|foo|] I pity the foo //// */ -////function f([|[|/*def*/{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 1 |}foo|]: I|]) { +////function f([|[|/*def*/{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 1 |}foo|]: I|]) { //// return [|foo|]; ////} diff --git a/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts b/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts index 5cde088e8b2..44156116d2f 100644 --- a/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts +++ b/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts @@ -3,9 +3,9 @@ // @allowJs: true // @Filename: a.js -/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|]|] */ +/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */ -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}T|] = 1;|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] = 1;|] /////** @type {[|T|]} */ ////const n = [|T|]; diff --git a/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning1.ts b/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning1.ts index d5da73d588e..10b076c55f8 100644 --- a/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning1.ts +++ b/tests/cases/fourslash/jsdocTypedefTagSemanticMeaning1.ts @@ -4,7 +4,7 @@ // @Filename: a.js /////** @typedef {number} */ -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = 1;|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = 1;|] /////** @type {[|T|]} */ ////const n = [|T|]; diff --git a/tests/cases/fourslash/jsdocTypedefTagServices.ts b/tests/cases/fourslash/jsdocTypedefTagServices.ts index 282569dfb91..7d9e4154c6c 100644 --- a/tests/cases/fourslash/jsdocTypedefTagServices.ts +++ b/tests/cases/fourslash/jsdocTypedefTagServices.ts @@ -5,7 +5,7 @@ /////** //// * Doc comment -//// * [|@typedef /*def*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Product|] +//// * [|@typedef /*def*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Product|] //// * @property {string} title //// |]*/ diff --git a/tests/cases/fourslash/jsxSpreadReference.ts b/tests/cases/fourslash/jsxSpreadReference.ts index 310b5cbadb4..62e6328aa07 100644 --- a/tests/cases/fourslash/jsxSpreadReference.ts +++ b/tests/cases/fourslash/jsxSpreadReference.ts @@ -14,7 +14,7 @@ //// } //// } //// -//// [|var [|/*dst*/{| "declarationRangeIndex": 0 |}nn|]: {name?: string; size?: number};|] +//// [|var [|/*dst*/{| "contextRangeIndex": 0 |}nn|]: {name?: string; size?: number};|] //// var x = ; verify.goToDefinition("src", "dst"); diff --git a/tests/cases/fourslash/localGetReferences.ts b/tests/cases/fourslash/localGetReferences.ts index dd783693987..c3253ea960c 100644 --- a/tests/cases/fourslash/localGetReferences.ts +++ b/tests/cases/fourslash/localGetReferences.ts @@ -3,15 +3,15 @@ // @Filename: localGetReferences_1.ts ////// Comment Refence Test: g/*1*/lobalVar ////// References to a variable declared in global. -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}globalVar|]: number = 2;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalVar|]: number = 2;|] //// ////class fooCls { //// // References to static variable declared in a class. -//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}clsSVar|] = 1;|] +//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}clsSVar|] = 1;|] //// // References to a variable declared in a class. -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}clsVar|] = 1;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}clsVar|] = 1;|] //// -//// constructor ([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}clsParam|]: number|]) { +//// constructor ([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}clsParam|]: number|]) { //// //Increments //// [|{| "isWriteAccess": true |}globalVar|]++; //// this.[|{| "isWriteAccess": true |}clsVar|]++; @@ -23,9 +23,9 @@ ////} //// ////// References to a function parameter. -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}foo|]([|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}x|]: number|]) { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}foo|]([|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}x|]: number|]) { //// // References to a variable declared in a function. -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 16 |}fnVar|] = 1;|] +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 16 |}fnVar|] = 1;|] //// //// //Increments //// fooCls.[|{| "isWriteAccess": true |}clsSVar|]++; @@ -85,7 +85,7 @@ /////*3*/err = err++; /////*4*/ //////Shadowed fn Parameter -////function shdw([|[|{| "isWriteAccess": true, "isDefinition": true, "shadow": true, "declarationRangeIndex": 39 |}globalVar|]: number|]) { +////function shdw([|[|{| "isWriteAccess": true, "isDefinition": true, "shadow": true, "contextRangeIndex": 39 |}globalVar|]: number|]) { //// //Increments //// [|{| "isWriteAccess": true, "shadow": true |}globalVar|]++; //// return [|{| "shadow": true |}globalVar|]; diff --git a/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts b/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts index c2c633926d5..bd087bd155e 100644 --- a/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts +++ b/tests/cases/fourslash/referenceInParameterPropertyDeclaration.ts @@ -2,9 +2,9 @@ // @Filename: file1.ts //// class Foo { -//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 0 |}privateParam|]: number|], -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "declarationRangeIndex": 2 |}publicParam|]: string|], -//// [|protected [|{| "isWriteAccess": true, "isDefinition": true, "type": "boolean", "declarationRangeIndex": 4 |}protectedParam|]: boolean|]) { +//// constructor([|private [|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 0 |}privateParam|]: number|], +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "contextRangeIndex": 2 |}publicParam|]: string|], +//// [|protected [|{| "isWriteAccess": true, "isDefinition": true, "type": "boolean", "contextRangeIndex": 4 |}protectedParam|]: boolean|]) { //// //// let localPrivate = [|privateParam|]; //// this.[|{| "isWriteAccess": true |}privateParam|] += 10; diff --git a/tests/cases/fourslash/referenceToClass.ts b/tests/cases/fourslash/referenceToClass.ts index 7e0228cd8f5..37e5322165e 100644 --- a/tests/cases/fourslash/referenceToClass.ts +++ b/tests/cases/fourslash/referenceToClass.ts @@ -3,7 +3,7 @@ // Class references should work across file and not find local variables. // @Filename: referenceToClass_1.ts -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|] { //// public n: [|foo|]; //// public foo: number; ////}|] diff --git a/tests/cases/fourslash/referencesBloomFilters.ts b/tests/cases/fourslash/referencesBloomFilters.ts index 374964a236f..c71ec7533c6 100644 --- a/tests/cases/fourslash/referencesBloomFilters.ts +++ b/tests/cases/fourslash/referencesBloomFilters.ts @@ -3,7 +3,7 @@ // Ensure BloomFilter building logic is correct, by having one reference per file // @Filename: declaration.ts -////var container = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}searchProp|] : 1|] }; +////var container = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}searchProp|] : 1|] }; // @Filename: expression.ts ////function blah() { return (1 + 2 + container.[|searchProp|]()) === 2; }; @@ -12,6 +12,6 @@ ////function blah2() { container["[|searchProp|]"] }; // @Filename: redeclaration.ts -////container = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}searchProp|]" : 18|] }; +////container = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}searchProp|]" : 18|] }; verify.singleReferenceGroup("(property) searchProp: number", "searchProp"); diff --git a/tests/cases/fourslash/referencesBloomFilters2.ts b/tests/cases/fourslash/referencesBloomFilters2.ts index 9dbb8b6605b..ee74343c462 100644 --- a/tests/cases/fourslash/referencesBloomFilters2.ts +++ b/tests/cases/fourslash/referencesBloomFilters2.ts @@ -3,7 +3,7 @@ // Ensure BloomFilter building logic is correct, by having one reference per file // @Filename: declaration.ts -////var container = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}42|]: 1|] }; +////var container = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}42|]: 1|] }; // @Filename: expression.ts ////function blah() { return (container[[|42|]]) === 2; }; @@ -12,6 +12,6 @@ ////function blah2() { container["[|42|]"] }; // @Filename: redeclaration.ts -////container = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}42|]" : 18|] }; +////container = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}42|]" : 18|] }; verify.singleReferenceGroup("(property) 42: number", "42"); diff --git a/tests/cases/fourslash/referencesBloomFilters3.ts b/tests/cases/fourslash/referencesBloomFilters3.ts index b8888ca27ad..5d6d68c9dd5 100644 --- a/tests/cases/fourslash/referencesBloomFilters3.ts +++ b/tests/cases/fourslash/referencesBloomFilters3.ts @@ -4,7 +4,7 @@ // @Filename: declaration.ts -////enum Test { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}42|]" = 1|] }; +////enum Test { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}42|]" = 1|] }; // @Filename: expression.ts ////(Test[[|42|]]); diff --git a/tests/cases/fourslash/referencesForAmbients.ts b/tests/cases/fourslash/referencesForAmbients.ts index 4631a659b00..6852ad8f2cb 100644 --- a/tests/cases/fourslash/referencesForAmbients.ts +++ b/tests/cases/fourslash/referencesForAmbients.ts @@ -1,16 +1,16 @@ /// -////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|]" { -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}f|]: number;|] +////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|]" { +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}f|]: number;|] ////}|] //// -////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}bar|]" { -//// [|export import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}foo|] = require("[|{| "declarationRangeIndex": 6 |}foo|]");|] +////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}bar|]" { +//// [|export import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}foo|] = require("[|{| "contextRangeIndex": 6 |}foo|]");|] //// var f2: typeof [|foo|].[|f|]; ////}|] //// ////declare module "baz" { -//// [|import bar = require("[|{| "declarationRangeIndex": 11 |}bar|]");|] +//// [|import bar = require("[|{| "contextRangeIndex": 11 |}bar|]");|] //// var f2: typeof bar.[|foo|]; ////} diff --git a/tests/cases/fourslash/referencesForAmbients2.ts b/tests/cases/fourslash/referencesForAmbients2.ts index c0945e9a076..2ec60cf3731 100644 --- a/tests/cases/fourslash/referencesForAmbients2.ts +++ b/tests/cases/fourslash/referencesForAmbients2.ts @@ -2,7 +2,7 @@ // @Filename: /defA.ts ////declare module "a" { -//// [|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|] +//// [|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] = number;|] ////} // @Filename: /defB.ts diff --git a/tests/cases/fourslash/referencesForClassLocal.ts b/tests/cases/fourslash/referencesForClassLocal.ts index 5562666f091..406b512d62b 100644 --- a/tests/cases/fourslash/referencesForClassLocal.ts +++ b/tests/cases/fourslash/referencesForClassLocal.ts @@ -5,7 +5,7 @@ ////var n = 14; //// ////class foo { -//// [|private [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}n|] = 0;|] +//// [|private [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}n|] = 0;|] //// //// public bar() { //// this.[|{| "isWriteAccess": true |}n|] = 9; diff --git a/tests/cases/fourslash/referencesForClassMembers.ts b/tests/cases/fourslash/referencesForClassMembers.ts index bdee20544d7..ff9b5098aa2 100644 --- a/tests/cases/fourslash/referencesForClassMembers.ts +++ b/tests/cases/fourslash/referencesForClassMembers.ts @@ -1,12 +1,12 @@ /// ////class Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: number;|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}method|](): void { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}method|](): void { }|] ////} ////class MyClass extends Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}a|];|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}method|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}a|];|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}method|]() { }|] ////} //// ////var c: MyClass; diff --git a/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts b/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts index 95405ccb0c4..ed227602355 100644 --- a/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts +++ b/tests/cases/fourslash/referencesForClassMembersExtendingAbstractClass.ts @@ -1,12 +1,12 @@ /// ////abstract class Base { -//// [|abstract [|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: number;|] -//// [|abstract [|{| "isDefinition": true, "declarationRangeIndex": 2 |}method|](): void;|] +//// [|abstract [|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number;|] +//// [|abstract [|{| "isDefinition": true, "contextRangeIndex": 2 |}method|](): void;|] ////} ////class MyClass extends Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}a|];|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}method|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}a|];|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}method|]() { }|] ////} //// ////var c: MyClass; diff --git a/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts b/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts index bfa6b8d6fb5..a05007b638b 100644 --- a/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts +++ b/tests/cases/fourslash/referencesForClassMembersExtendingGenericClass.ts @@ -1,12 +1,12 @@ /// ////class Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: this;|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}method|](a?:T, b?:U): this { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: this;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}method|](a?:T, b?:U): this { }|] ////} ////class MyClass extends Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}a|];|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}method|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}a|];|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}method|]() { }|] ////} //// ////var c: MyClass; diff --git a/tests/cases/fourslash/referencesForClassParameter.ts b/tests/cases/fourslash/referencesForClassParameter.ts index 8fdf9b98154..011be7e85bb 100644 --- a/tests/cases/fourslash/referencesForClassParameter.ts +++ b/tests/cases/fourslash/referencesForClassParameter.ts @@ -7,7 +7,7 @@ ////class p { } //// ////class foo { -//// constructor ([|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}p|]: any|]) { +//// constructor ([|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}p|]: any|]) { //// } //// //// public f(p) { diff --git a/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts b/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts index 5345d6e8aa3..4cd84392690 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedObjectLiteralProperties.ts @@ -1,26 +1,26 @@ /// -////interface IFoo { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}xy|]: number;|] } +////interface IFoo { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}xy|]: number;|] } //// ////// Assignment -////var a1: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}xy|]: 0|] }; -////var a2: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}xy|]: 0|] }; +////var a1: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}xy|]: 0|] }; +////var a2: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}xy|]: 0|] }; //// ////// Function call ////function consumer(f: IFoo) { } -////consumer({ [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}xy|]: 1|] }); +////consumer({ [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}xy|]: 1|] }); //// ////// Type cast -////var c = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}xy|]: 0|] }; +////var c = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}xy|]: 0|] }; //// ////// Array literal -////var ar: IFoo[] = [{ [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}xy|]: 1|] }, { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}xy|]: 2|] }]; +////var ar: IFoo[] = [{ [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}xy|]: 1|] }, { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}xy|]: 2|] }]; //// ////// Nested object literal -////var ob: { ifoo: IFoo } = { ifoo: { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}xy|]: 0|] } }; +////var ob: { ifoo: IFoo } = { ifoo: { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}xy|]: 0|] } }; //// ////// Widened type -////var w: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "declarationRangeIndex": 16 |}xy|]: undefined|] }; +////var w: IFoo = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "contextRangeIndex": 16 |}xy|]: undefined|] }; //// ////// Untped -- should not be included ////var u = { xy: 0 }; diff --git a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts index da1adb8f98d..fecef826152 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties.ts @@ -2,33 +2,33 @@ ////interface A { //// a: number; -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}common|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}common|]: string;|] ////} //// ////interface B { //// b: number; -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}common|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}common|]: number;|] ////} //// ////// Assignment -////var v1: A | B = { a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "declarationRangeIndex": 4 |}common|]: ""|] }; -////var v2: A | B = { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 6 |}common|]: 3|] }; +////var v1: A | B = { a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "contextRangeIndex": 4 |}common|]: ""|] }; +////var v2: A | B = { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 6 |}common|]: 3|] }; //// ////// Function call ////function consumer(f: A | B) { } -////consumer({ a: 0, b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 8 |}common|]: 1|] }); +////consumer({ a: 0, b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 8 |}common|]: 1|] }); //// ////// Type cast -////var c = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 10 |}common|]: 0|], b: 0 }; +////var c = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 10 |}common|]: 0|], b: 0 }; //// ////// Array literal -////var ar: Array = [{ a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "declarationRangeIndex": 12 |}common|]: ""|] }, { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 14 |}common|]: 0|] }]; +////var ar: Array = [{ a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "string", "contextRangeIndex": 12 |}common|]: ""|] }, { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 14 |}common|]: 0|] }]; //// ////// Nested object literal -////var ob: { aorb: A|B } = { aorb: { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 16 |}common|]: 0|] } }; +////var ob: { aorb: A|B } = { aorb: { b: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 16 |}common|]: 0|] } }; //// ////// Widened type -////var w: A|B = { a:0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "declarationRangeIndex": 18 |}common|]: undefined|] }; +////var w: A|B = { a:0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "contextRangeIndex": 18 |}common|]: undefined|] }; //// ////// Untped -- should not be included ////var u1 = { a: 0, b: 0, common: "" }; diff --git a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts index 0ad5f327995..22e5da052b0 100644 --- a/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts +++ b/tests/cases/fourslash/referencesForContextuallyTypedUnionProperties2.ts @@ -6,29 +6,29 @@ ////} //// ////interface B { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}b|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}b|]: number;|] //// common: number; ////} //// ////// Assignment ////var v1: A | B = { a: 0, common: "" }; -////var v2: A | B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 2 |}b|]: 0|], common: 3 }; +////var v2: A | B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 2 |}b|]: 0|], common: 3 }; //// ////// Function call ////function consumer(f: A | B) { } -////consumer({ a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 4 |}b|]: 0|], common: 1 }); +////consumer({ a: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 4 |}b|]: 0|], common: 1 }); //// ////// Type cast -////var c = { common: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 6 |}b|]: 0|] }; +////var c = { common: 0, [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 6 |}b|]: 0|] }; //// ////// Array literal -////var ar: Array = [{ a: 0, common: "" }, { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 8 |}b|]: 0|], common: 0 }]; +////var ar: Array = [{ a: 0, common: "" }, { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 8 |}b|]: 0|], common: 0 }]; //// ////// Nested object literal -////var ob: { aorb: A|B } = { aorb: { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "declarationRangeIndex": 10 |}b|]: 0|], common: 0 } }; +////var ob: { aorb: A|B } = { aorb: { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "number", "contextRangeIndex": 10 |}b|]: 0|], common: 0 } }; //// ////// Widened type -////var w: A|B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "declarationRangeIndex": 12 |}b|]:undefined|], common: undefined }; +////var w: A|B = { [|[|{| "isWriteAccess": true, "isDefinition": true, "type": "undefined", "contextRangeIndex": 12 |}b|]:undefined|], common: undefined }; //// ////// Untped -- should not be included ////var u1 = { a: 0, b: 0, common: "" }; diff --git a/tests/cases/fourslash/referencesForEnums.ts b/tests/cases/fourslash/referencesForEnums.ts index 464de3e40be..395dee4a3a7 100644 --- a/tests/cases/fourslash/referencesForEnums.ts +++ b/tests/cases/fourslash/referencesForEnums.ts @@ -1,9 +1,9 @@ /// ////enum E { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}value1|] = 1|], -//// [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}value2|]" = [|value1|]|], -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}111|] = 11|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}value1|] = 1|], +//// [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}value2|]" = [|value1|]|], +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}111|] = 11|] ////} //// ////E.[|value1|]; diff --git a/tests/cases/fourslash/referencesForExportedValues.ts b/tests/cases/fourslash/referencesForExportedValues.ts index 547de612c58..c623e270bed 100644 --- a/tests/cases/fourslash/referencesForExportedValues.ts +++ b/tests/cases/fourslash/referencesForExportedValues.ts @@ -1,7 +1,7 @@ /// ////module M { -//// [|export var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}variable|] = 0;|] +//// [|export var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}variable|] = 0;|] //// //// // local use //// var x = [|variable|]; diff --git a/tests/cases/fourslash/referencesForExternalModuleNames.ts b/tests/cases/fourslash/referencesForExternalModuleNames.ts index 66fa11d45c3..699e04a518a 100644 --- a/tests/cases/fourslash/referencesForExternalModuleNames.ts +++ b/tests/cases/fourslash/referencesForExternalModuleNames.ts @@ -1,11 +1,11 @@ /// // @Filename: referencesForGlobals_1.ts -////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|]" { +////[|declare module "[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|]" { //// var f: number; ////}|] // @Filename: referencesForGlobals_2.ts -////[|import f = require("[|{| "declarationRangeIndex": 2 |}foo|]");|] +////[|import f = require("[|{| "contextRangeIndex": 2 |}foo|]");|] verify.singleReferenceGroup('module "foo"', "foo"); diff --git a/tests/cases/fourslash/referencesForFunctionOverloads.ts b/tests/cases/fourslash/referencesForFunctionOverloads.ts index da9ad0e70f5..a124321f464 100644 --- a/tests/cases/fourslash/referencesForFunctionOverloads.ts +++ b/tests/cases/fourslash/referencesForFunctionOverloads.ts @@ -2,8 +2,8 @@ // Function overloads should be highlighted together. -////[|function [|{| "isDefinition": true, "declarationRangeIndex": 0 |}foo|](x: string);|] -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}foo|](x: string, y: number) { +////[|function [|{| "isDefinition": true, "contextRangeIndex": 0 |}foo|](x: string);|] +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}foo|](x: string, y: number) { //// [|foo|]('', 43); ////}|] diff --git a/tests/cases/fourslash/referencesForFunctionParameter.ts b/tests/cases/fourslash/referencesForFunctionParameter.ts index d7fbc947fac..83baed3b834 100644 --- a/tests/cases/fourslash/referencesForFunctionParameter.ts +++ b/tests/cases/fourslash/referencesForFunctionParameter.ts @@ -3,7 +3,7 @@ ////var x; ////var n; //// -////function n(x: number, [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}n|]: number|]) { +////function n(x: number, [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}n|]: number|]) { //// [|{| "isWriteAccess": true |}n|] = 32; //// x = [|n|]; ////} diff --git a/tests/cases/fourslash/referencesForGlobals.ts b/tests/cases/fourslash/referencesForGlobals.ts index 540ab767317..0cbe1aae9fa 100644 --- a/tests/cases/fourslash/referencesForGlobals.ts +++ b/tests/cases/fourslash/referencesForGlobals.ts @@ -3,7 +3,7 @@ // Global variable reference. // @Filename: referencesForGlobals_1.ts -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}global|] = 2;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}global|] = 2;|] //// ////class foo { //// constructor (public global) { } diff --git a/tests/cases/fourslash/referencesForGlobals2.ts b/tests/cases/fourslash/referencesForGlobals2.ts index c5e56d01ed7..35399447455 100644 --- a/tests/cases/fourslash/referencesForGlobals2.ts +++ b/tests/cases/fourslash/referencesForGlobals2.ts @@ -3,7 +3,7 @@ // Global class reference. // @Filename: referencesForGlobals_1.ts -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}globalClass|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalClass|] { //// public f() { } ////}|] diff --git a/tests/cases/fourslash/referencesForGlobals3.ts b/tests/cases/fourslash/referencesForGlobals3.ts index 28c6277869d..76c7f4d54e3 100644 --- a/tests/cases/fourslash/referencesForGlobals3.ts +++ b/tests/cases/fourslash/referencesForGlobals3.ts @@ -3,7 +3,7 @@ // Global interface reference. // @Filename: referencesForGlobals_1.ts -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}globalInterface|] { +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalInterface|] { //// f(); ////}|] diff --git a/tests/cases/fourslash/referencesForGlobals4.ts b/tests/cases/fourslash/referencesForGlobals4.ts index 5aee51ef4b5..3ce0bf541a9 100644 --- a/tests/cases/fourslash/referencesForGlobals4.ts +++ b/tests/cases/fourslash/referencesForGlobals4.ts @@ -3,7 +3,7 @@ // Global module reference. // @Filename: referencesForGlobals_1.ts -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}globalModule|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalModule|] { //// export f() { }; ////}|] diff --git a/tests/cases/fourslash/referencesForGlobals5.ts b/tests/cases/fourslash/referencesForGlobals5.ts index e49d412d905..b0be1609cf8 100644 --- a/tests/cases/fourslash/referencesForGlobals5.ts +++ b/tests/cases/fourslash/referencesForGlobals5.ts @@ -7,7 +7,7 @@ //// export var x; ////} //// -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}globalAlias|] = globalModule;|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}globalAlias|] = globalModule;|] // @Filename: referencesForGlobals_2.ts ////var m = [|globalAlias|]; diff --git a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts index 2c1caf040c0..3c3af49a382 100644 --- a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts +++ b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts @@ -2,16 +2,16 @@ // Global variable reference. -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}topLevelVar|] = 2;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}topLevelVar|] = 2;|] ////var topLevelVar2 = [|topLevelVar|]; //// -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}topLevelClass|] { }|] +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}topLevelClass|] { }|] ////var c = new [|topLevelClass|](); //// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}topLevelInterface|] { }|] +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}topLevelInterface|] { }|] ////var i: [|topLevelInterface|]; //// -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}topLevelModule|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 9 |}topLevelModule|] { //// export var x; ////}|] ////var x = [|topLevelModule|].x; diff --git a/tests/cases/fourslash/referencesForIllegalAssignment.ts b/tests/cases/fourslash/referencesForIllegalAssignment.ts index 760f440bb02..e96b969de30 100644 --- a/tests/cases/fourslash/referencesForIllegalAssignment.ts +++ b/tests/cases/fourslash/referencesForIllegalAssignment.ts @@ -2,7 +2,7 @@ ////f/*1*/oo = fo/*2*/o; -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}bar|] = function () { };|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}bar|] = function () { };|] ////[|{| "isWriteAccess": true |}bar|] = [|bar|] + 1; goTo.marker("1"); diff --git a/tests/cases/fourslash/referencesForImports.ts b/tests/cases/fourslash/referencesForImports.ts index 0b763b09775..ed9ec91b6f8 100644 --- a/tests/cases/fourslash/referencesForImports.ts +++ b/tests/cases/fourslash/referencesForImports.ts @@ -5,10 +5,10 @@ //// export = $; ////} -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}$|] = require("jquery");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}$|] = require("jquery");|] ////[|$|]("a"); -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}$|] = require("jquery");|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}$|] = require("jquery");|] const [r0Def, r0, r1, r2Def, r2] = test.ranges(); verify.singleReferenceGroup('import $ = require("jquery")', [r0, r1]); diff --git a/tests/cases/fourslash/referencesForIndexProperty.ts b/tests/cases/fourslash/referencesForIndexProperty.ts index 52560baeff9..6c5abf44200 100644 --- a/tests/cases/fourslash/referencesForIndexProperty.ts +++ b/tests/cases/fourslash/referencesForIndexProperty.ts @@ -3,8 +3,8 @@ // References a class property using string index access ////class Foo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}property|]: number;|] -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}method|](): void { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}property|]: number;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}method|](): void { }|] ////} //// ////var f: Foo; diff --git a/tests/cases/fourslash/referencesForIndexProperty3.ts b/tests/cases/fourslash/referencesForIndexProperty3.ts index fc1fe34749d..4cb763baec1 100644 --- a/tests/cases/fourslash/referencesForIndexProperty3.ts +++ b/tests/cases/fourslash/referencesForIndexProperty3.ts @@ -3,7 +3,7 @@ // References to a property of the apparent type using string indexer ////interface Object { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}toMyString|]();|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}toMyString|]();|] ////} //// ////var y: Object; diff --git a/tests/cases/fourslash/referencesForInheritedProperties.ts b/tests/cases/fourslash/referencesForInheritedProperties.ts index 47e642d01e2..10b24aeef39 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties.ts @@ -1,15 +1,15 @@ /// ////interface interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doStuff|](): void;|] ////} //// ////interface interface2 extends interface1{ -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}doStuff|](): void;|] ////} //// ////class class1 implements interface2 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}doStuff|]() { +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}doStuff|]() { //// //// }|] ////} diff --git a/tests/cases/fourslash/referencesForInheritedProperties2.ts b/tests/cases/fourslash/referencesForInheritedProperties2.ts index 31b875f4509..d6b5d25af14 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties2.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties2.ts @@ -3,18 +3,18 @@ // extends statement in a diffrent declaration ////interface interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doStuff|](): void;|] ////} //// ////interface interface2 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}doStuff|](): void;|] ////} //// ////interface interface2 extends interface1 { ////} //// ////class class1 implements interface2 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}doStuff|]() { +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}doStuff|]() { //// //// }|] ////} diff --git a/tests/cases/fourslash/referencesForInheritedProperties3.ts b/tests/cases/fourslash/referencesForInheritedProperties3.ts index 8dda63e69b4..3cff5ac7e99 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties3.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties3.ts @@ -1,8 +1,8 @@ /// //// interface interface1 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|](): void;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties4.ts b/tests/cases/fourslash/referencesForInheritedProperties4.ts index e252cb522f1..7e2ec514213 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties4.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties4.ts @@ -1,8 +1,8 @@ /// //// class class1 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|]() { }|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] //// } //// //// var c: class1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties5.ts b/tests/cases/fourslash/referencesForInheritedProperties5.ts index c86b8d01b85..d1d5019af80 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties5.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties5.ts @@ -1,12 +1,12 @@ /// //// interface interface1 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|](): void;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] //// } //// interface interface2 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}doStuff|](): void;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}propName|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}propName|]: string;|] //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/referencesForInheritedProperties6.ts b/tests/cases/fourslash/referencesForInheritedProperties6.ts index c71a17119f9..40e17136a1d 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties6.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties6.ts @@ -1,10 +1,10 @@ /// ////class class1 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|]() { }|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] ////} ////class class2 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}doStuff|]() { }|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}doStuff|]() { }|] ////} //// ////var v: class2; diff --git a/tests/cases/fourslash/referencesForInheritedProperties7.ts b/tests/cases/fourslash/referencesForInheritedProperties7.ts index a2efe171339..c10548c9a8a 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties7.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties7.ts @@ -1,16 +1,16 @@ /// //// class class1 extends class1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}doStuff|]() { }|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propName|]: string;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] //// } //// interface interface1 extends interface1 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}doStuff|](): void;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}propName|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}doStuff|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}propName|]: string;|] //// } //// class class2 extends class1 implements interface1 { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}doStuff|]() { }|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 10 |}propName|]: string;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}doStuff|]() { }|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 10 |}propName|]: string;|] //// } //// //// var v: class2; diff --git a/tests/cases/fourslash/referencesForInheritedProperties8.ts b/tests/cases/fourslash/referencesForInheritedProperties8.ts index 86aa3500a1c..fef6e41e0a4 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties8.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties8.ts @@ -1,11 +1,11 @@ /// //// interface C extends D { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}propD|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}propD|]: number;|] //// } //// interface D extends C { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}propD|]: string;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}propC|]: number;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propD|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}propC|]: number;|] //// } //// var d: D; //// d.[|propD|]; diff --git a/tests/cases/fourslash/referencesForInheritedProperties9.ts b/tests/cases/fourslash/referencesForInheritedProperties9.ts index 5bbcefb7753..941d286f86d 100644 --- a/tests/cases/fourslash/referencesForInheritedProperties9.ts +++ b/tests/cases/fourslash/referencesForInheritedProperties9.ts @@ -1,11 +1,11 @@ /// //// class D extends C { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}prop1|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}prop1|]: string;|] //// } //// //// class C extends D { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop1|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}prop1|]: string;|] //// } //// //// var c: C; diff --git a/tests/cases/fourslash/referencesForLabel.ts b/tests/cases/fourslash/referencesForLabel.ts index bc77f5b0031..c7ee984b6a7 100644 --- a/tests/cases/fourslash/referencesForLabel.ts +++ b/tests/cases/fourslash/referencesForLabel.ts @@ -2,12 +2,12 @@ // Valid References for a label -////[|[|{| "declarationRangeIndex": 0 |}label|]: while (true) { -//// if (false) [|break [|{| "declarationRangeIndex": 2 |}label|];|] -//// if (true) [|continue [|{| "declarationRangeIndex": 4 |}label|];|] +////[|[|{| "contextRangeIndex": 0 |}label|]: while (true) { +//// if (false) [|break [|{| "contextRangeIndex": 2 |}label|];|] +//// if (true) [|continue [|{| "contextRangeIndex": 4 |}label|];|] ////}|] //// -////[|[|{| "declarationRangeIndex": 6 |}label|]: while (false) { }|] +////[|[|{| "contextRangeIndex": 6 |}label|]: while (false) { }|] ////var label = "label"; const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = test.ranges(); diff --git a/tests/cases/fourslash/referencesForLabel3.ts b/tests/cases/fourslash/referencesForLabel3.ts index be700ed6df0..4d666aff632 100644 --- a/tests/cases/fourslash/referencesForLabel3.ts +++ b/tests/cases/fourslash/referencesForLabel3.ts @@ -2,7 +2,7 @@ // References to unused label -////[|[|{| "declarationRangeIndex": 0 |}label|]: while (true) { +////[|[|{| "contextRangeIndex": 0 |}label|]: while (true) { //// var label = "label"; ////}|] diff --git a/tests/cases/fourslash/referencesForLabel4.ts b/tests/cases/fourslash/referencesForLabel4.ts index 353e663b0d9..4cf8bf2baf7 100644 --- a/tests/cases/fourslash/referencesForLabel4.ts +++ b/tests/cases/fourslash/referencesForLabel4.ts @@ -2,9 +2,9 @@ // References to a label outside function bounderies -////[|[|{| "declarationRangeIndex": 0 |}label|]: function foo(label) { +////[|[|{| "contextRangeIndex": 0 |}label|]: function foo(label) { //// while (true) { -//// [|break [|{| "declarationRangeIndex": 2 |}label|];|] +//// [|break [|{| "contextRangeIndex": 2 |}label|];|] //// } ////}|] diff --git a/tests/cases/fourslash/referencesForLabel5.ts b/tests/cases/fourslash/referencesForLabel5.ts index 91223507624..923c0be9c72 100644 --- a/tests/cases/fourslash/referencesForLabel5.ts +++ b/tests/cases/fourslash/referencesForLabel5.ts @@ -2,14 +2,14 @@ // References to shadowed label -////[|[|{| "declarationRangeIndex": 0 |}label|]: while (true) { -//// if (false) [|break [|{| "declarationRangeIndex": 2 |}label|];|] +////[|[|{| "contextRangeIndex": 0 |}label|]: while (true) { +//// if (false) [|break [|{| "contextRangeIndex": 2 |}label|];|] //// function blah() { -////[|[|{| "declarationRangeIndex": 4 |}label|]: while (true) { -//// if (false) [|break [|{| "declarationRangeIndex": 6 |}label|];|] +////[|[|{| "contextRangeIndex": 4 |}label|]: while (true) { +//// if (false) [|break [|{| "contextRangeIndex": 6 |}label|];|] //// }|] //// } -//// if (false) [|break [|{| "declarationRangeIndex": 8 |}label|];|] +//// if (false) [|break [|{| "contextRangeIndex": 8 |}label|];|] //// }|] const [ourter1Def, outer1, outer2Def, outer2, inner1Def, inner1, inner2Def, inner2, outer3Def, outer3] = test.ranges(); diff --git a/tests/cases/fourslash/referencesForLabel6.ts b/tests/cases/fourslash/referencesForLabel6.ts index 2597d8a7291..0fbc468fc92 100644 --- a/tests/cases/fourslash/referencesForLabel6.ts +++ b/tests/cases/fourslash/referencesForLabel6.ts @@ -2,8 +2,8 @@ // References to labels with close names -////[|[|{| "declarationRangeIndex": 0 |}labela|]: while (true) { -////[|[|{| "declarationRangeIndex": 2 |}labelb|]: while (false) { [|break [|{| "declarationRangeIndex": 4 |}labelb|];|] }|] +////[|[|{| "contextRangeIndex": 0 |}labela|]: while (true) { +////[|[|{| "contextRangeIndex": 2 |}labelb|]: while (false) { [|break [|{| "contextRangeIndex": 4 |}labelb|];|] }|] //// break labelc; ////}|] diff --git a/tests/cases/fourslash/referencesForMergedDeclarations.ts b/tests/cases/fourslash/referencesForMergedDeclarations.ts index 3fb29fe0c7d..22d17342afd 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations.ts @@ -1,13 +1,13 @@ /// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|] { +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|] { ////}|] //// -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Foo|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Foo|] { //// export interface Bar { } ////}|] //// -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}Foo|](): void { +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}Foo|](): void { ////}|] //// ////var f1: [|Foo|].Bar; diff --git a/tests/cases/fourslash/referencesForMergedDeclarations2.ts b/tests/cases/fourslash/referencesForMergedDeclarations2.ts index 5521bb96990..f590c321385 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations2.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations2.ts @@ -6,7 +6,7 @@ //// ////function ATest() { } //// -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}alias|] = ATest;|] // definition +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}alias|] = ATest;|] // definition //// ////var a: [|alias|].Bar; // namespace ////[|alias|].call(this); // value diff --git a/tests/cases/fourslash/referencesForMergedDeclarations3.ts b/tests/cases/fourslash/referencesForMergedDeclarations3.ts index 4013c5bd49b..8f142223949 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations3.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations3.ts @@ -2,12 +2,12 @@ // class and uninstantiated module -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}testClass|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}testClass|] { //// static staticMethod() { } //// method() { } ////}|] //// -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}testClass|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}testClass|] { //// export interface Bar { //// //// } diff --git a/tests/cases/fourslash/referencesForMergedDeclarations4.ts b/tests/cases/fourslash/referencesForMergedDeclarations4.ts index 880c714421e..63dc543b9d2 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations4.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations4.ts @@ -2,12 +2,12 @@ // class and instantiated module -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}testClass|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}testClass|] { //// static staticMethod() { } //// method() { } ////}|] //// -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}testClass|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}testClass|] { //// export interface Bar { //// //// } diff --git a/tests/cases/fourslash/referencesForMergedDeclarations5.ts b/tests/cases/fourslash/referencesForMergedDeclarations5.ts index 6b3e7a8c766..241a097d6a2 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations5.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations5.ts @@ -1,10 +1,10 @@ /// -////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|] { }|] -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Foo|] { export interface Bar { } }|] -////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}Foo|]() { }|] +////[|interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|] { }|] +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Foo|] { export interface Bar { } }|] +////[|function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}Foo|]() { }|] //// -////[|export = [|{| "declarationRangeIndex": 6 |}Foo|];|] +////[|export = [|{| "contextRangeIndex": 6 |}Foo|];|] const ranges = test.ranges(); const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = ranges; diff --git a/tests/cases/fourslash/referencesForMergedDeclarations6.ts b/tests/cases/fourslash/referencesForMergedDeclarations6.ts index 4d6edf4df4c..1557fdb7201 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations6.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations6.ts @@ -1,7 +1,7 @@ /// ////interface Foo { } -////[|module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Foo|] { +////[|module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|] { //// export interface Bar { } //// export module Bar { export interface Baz { } } //// export function Bar() { } diff --git a/tests/cases/fourslash/referencesForMergedDeclarations7.ts b/tests/cases/fourslash/referencesForMergedDeclarations7.ts index 8a35ead235c..695e7bef050 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations7.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations7.ts @@ -2,9 +2,9 @@ ////interface Foo { } ////module Foo { -//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Bar|] { }|] -//// [|export module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Bar|] { export interface Baz { } }|] -//// [|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}Bar|]() { }|] +//// [|export interface [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Bar|] { }|] +//// [|export module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}Bar|] { export interface Baz { } }|] +//// [|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}Bar|]() { }|] ////} //// ////// module, value and type diff --git a/tests/cases/fourslash/referencesForMergedDeclarations8.ts b/tests/cases/fourslash/referencesForMergedDeclarations8.ts index 81996361158..7434fda95b4 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations8.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations8.ts @@ -3,7 +3,7 @@ ////interface Foo { } ////module Foo { //// export interface Bar { } -//// [|export module [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Bar|] { export interface Baz { } }|] +//// [|export module [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Bar|] { export interface Baz { } }|] //// export function Bar() { } ////} //// diff --git a/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts b/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts index 8f9ab78eb02..153460912b5 100644 --- a/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts +++ b/tests/cases/fourslash/referencesForNumericLiteralPropertyNames.ts @@ -1,12 +1,12 @@ /// ////class Foo { -//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 0 |}12|]: any;|] +//// [|public [|{| "isDefinition": true, "contextRangeIndex": 0 |}12|]: any;|] ////} //// ////var x: Foo; ////x[[|12|]]; -////x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}12|]": 0|] }; -////x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}12|]: 0|] }; +////x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}12|]": 0|] }; +////x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}12|]: 0|] }; verify.singleReferenceGroup("(property) Foo[12]: any", "12"); diff --git a/tests/cases/fourslash/referencesForObjectLiteralProperties.ts b/tests/cases/fourslash/referencesForObjectLiteralProperties.ts index 60b1c808376..86e8cea583d 100644 --- a/tests/cases/fourslash/referencesForObjectLiteralProperties.ts +++ b/tests/cases/fourslash/referencesForObjectLiteralProperties.ts @@ -2,7 +2,7 @@ // References to an object literal property -////var x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}add|]: 0|], b: "string" }; +////var x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}add|]: 0|], b: "string" }; ////x["[|add|]"]; ////x.[|add|]; ////var y = x; diff --git a/tests/cases/fourslash/referencesForOverrides.ts b/tests/cases/fourslash/referencesForOverrides.ts index f0dcc3e3621..e639ba09281 100644 --- a/tests/cases/fourslash/referencesForOverrides.ts +++ b/tests/cases/fourslash/referencesForOverrides.ts @@ -3,59 +3,59 @@ ////module FindRef3 { //// module SimpleClassTest { //// export class Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|](): void { +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|](): void { //// }|] //// } //// export class Bar extends Foo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}foo|](): void { +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}foo|](): void { //// }|] //// } //// } //// //// module SimpleInterfaceTest { //// export interface IFoo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}ifoo|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}ifoo|](): void;|] //// } //// export interface IBar extends IFoo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}ifoo|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}ifoo|](): void;|] //// } //// } //// //// module SimpleClassInterfaceTest { //// export interface IFoo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 8 |}icfoo|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 8 |}icfoo|](): void;|] //// } //// export class Bar implements IFoo { -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}icfoo|](): void { +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}icfoo|](): void { //// }|] //// } //// } //// //// module Test { //// export interface IBase { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 12 |}field|]: string;|] -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 14 |}method|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 12 |}field|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 14 |}method|](): void;|] //// } //// //// export interface IBlah extends IBase { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 16 |}field|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 16 |}field|]: string;|] //// } //// //// export interface IBlah2 extends IBlah { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 18 |}field|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 18 |}field|]: string;|] //// } //// //// export interface IDerived extends IBlah2 { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 20 |}method|](): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 20 |}method|](): void;|] //// } //// //// export class Bar implements IDerived { -//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 22 |}field|]: string;|] -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 24 |}method|](): void { }|] +//// [|public [|{| "isDefinition": true, "contextRangeIndex": 22 |}field|]: string;|] +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 24 |}method|](): void { }|] //// } //// //// export class BarBlah extends Bar { -//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 26 |}field|]: string;|] +//// [|public [|{| "isDefinition": true, "contextRangeIndex": 26 |}field|]: string;|] //// } //// } //// diff --git a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts index e8ae86b2cef..c7cc345970a 100644 --- a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts +++ b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts @@ -1,7 +1,7 @@ /// ////interface IFoo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}doSomething|](v: T): T;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}doSomething|](v: T): T;|] ////} //// ////var x: IFoo; diff --git a/tests/cases/fourslash/referencesForStatic.ts b/tests/cases/fourslash/referencesForStatic.ts index 2e0a6182edb..2571e379528 100644 --- a/tests/cases/fourslash/referencesForStatic.ts +++ b/tests/cases/fourslash/referencesForStatic.ts @@ -6,7 +6,7 @@ ////var n = 43; //// ////class foo { -//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}n|] = '';|] +//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}n|] = '';|] //// //// public bar() { //// foo.[|{| "isWriteAccess": true |}n|] = "'"; diff --git a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts index 146fc87581c..655b4b9a308 100644 --- a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts +++ b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts @@ -3,12 +3,12 @@ ////module FindRef4 { //// module MixedStaticsClassTest { //// export class Foo { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}bar|]: Foo;|] -//// [|static [|{| "isDefinition": true, "declarationRangeIndex": 2 |}bar|]: Foo;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}bar|]: Foo;|] +//// [|static [|{| "isDefinition": true, "contextRangeIndex": 2 |}bar|]: Foo;|] //// -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}foo|](): void { +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}foo|](): void { //// }|] -//// [|public static [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}foo|](): void { +//// [|public static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}foo|](): void { //// }|] //// } //// } diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts index 564f33bad48..b0497753f90 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames.ts @@ -1,13 +1,13 @@ /// ////class Foo { -//// [|public "[|{| "isDefinition": true, "declarationRangeIndex": 0 |}ss|]": any;|] +//// [|public "[|{| "isDefinition": true, "contextRangeIndex": 0 |}ss|]": any;|] ////} //// ////var x: Foo; ////x.[|ss|]; ////x["[|ss|]"]; -////x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}ss|]": 0|] }; -////x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}ss|]: 0|] }; +////x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}ss|]": 0|] }; +////x = { [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}ss|]: 0|] }; verify.singleReferenceGroup('(property) Foo["ss"]: any', "ss"); diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts index 24e4e29ba8a..4402316c5a3 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts @@ -1,7 +1,7 @@ /// ////class Foo { -//// [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}blah|]"() { return 0; }|] +//// [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}blah|]"() { return 0; }|] ////} //// ////var x: Foo; diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts index 23519a0facf..2ef57d19b5c 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts @@ -1,8 +1,8 @@ /// ////class Foo2 { -//// [|get "[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}42|]"() { return 0; }|] -//// [|set [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}42|](n) { }|] +//// [|get "[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}42|]"() { return 0; }|] +//// [|set [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}42|](n) { }|] ////} //// ////var y: Foo2; diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts index b4503030213..39fa5c7ec7d 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts @@ -1,6 +1,6 @@ /// -////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}someProperty|]": 0|] } +////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}someProperty|]": 0|] } ////x["[|someProperty|]"] = 3; ////x.[|{| "isWriteAccess": true |}someProperty|] = 5; diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames5.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames5.ts index fc2174df21a..a3fc6f7405c 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames5.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames5.ts @@ -1,6 +1,6 @@ /// -////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}someProperty|]": 0|] } +////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}someProperty|]": 0|] } ////x["[|someProperty|]"] = 3; ////x.[|{| "isWriteAccess": true, "isDefinition": false |}someProperty|] = 5; diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames7.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames7.ts index 4f6cd66fc73..eac206f90de 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames7.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames7.ts @@ -4,9 +4,9 @@ // @allowJs: true // @checkJs: true -////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}someProperty|]": 0|] } +////var x = { [|"[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}someProperty|]": 0|] } ////x["[|someProperty|]"] = 3; -////[|x.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}someProperty|] = 5;|] +////[|x.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 3 |}someProperty|] = 5;|] const [r0Def, r0, r1, r2Def, r2] = test.ranges(); const ranges = [r0, r1, r2]; diff --git a/tests/cases/fourslash/referencesForUnionProperties.ts b/tests/cases/fourslash/referencesForUnionProperties.ts index afaf78eb995..eaeccce41a1 100644 --- a/tests/cases/fourslash/referencesForUnionProperties.ts +++ b/tests/cases/fourslash/referencesForUnionProperties.ts @@ -1,16 +1,16 @@ /// ////interface One { -//// common: { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|]: number;|] }; +//// common: { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number;|] }; ////} //// ////interface Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}a|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}a|]: string;|] //// b: string; ////} //// ////interface HasAOrB extends Base { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}a|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}a|]: string;|] //// b: string; ////} //// diff --git a/tests/cases/fourslash/remoteGetReferences.ts b/tests/cases/fourslash/remoteGetReferences.ts index 0c4e63d75f2..5636be5d242 100644 --- a/tests/cases/fourslash/remoteGetReferences.ts +++ b/tests/cases/fourslash/remoteGetReferences.ts @@ -119,12 +119,12 @@ ////}); // @Filename: remoteGetReferences_2.ts -////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}remoteglobalVar|]: number = 2;|] +////[|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}remoteglobalVar|]: number = 2;|] //// -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 12 |}remotefooCls|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 12 |}remotefooCls|] { //// //Declare -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 14 |}remoteclsVar|] = 1;|] -//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 16 |}remoteclsSVar|] = 1;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 14 |}remoteclsVar|] = 1;|] +//// [|static [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 16 |}remoteclsSVar|] = 1;|] //// //// constructor(public remoteclsParam: number) { //// //Increments diff --git a/tests/cases/fourslash/renameAcrossMultipleProjects.ts b/tests/cases/fourslash/renameAcrossMultipleProjects.ts index adad26a957a..dc497e8ee3a 100644 --- a/tests/cases/fourslash/renameAcrossMultipleProjects.ts +++ b/tests/cases/fourslash/renameAcrossMultipleProjects.ts @@ -1,7 +1,7 @@ /// //@Filename: a.ts -////[|var [|{| "declarationRangeIndex": 0 |}x|]: number;|] +////[|var [|{| "contextRangeIndex": 0 |}x|]: number;|] //@Filename: b.ts /////// diff --git a/tests/cases/fourslash/renameAlias.ts b/tests/cases/fourslash/renameAlias.ts index 58dfc4c460e..6ff2b87816f 100644 --- a/tests/cases/fourslash/renameAlias.ts +++ b/tests/cases/fourslash/renameAlias.ts @@ -1,7 +1,7 @@ /// ////module SomeModule { export class SomeClass { } } -////[|import [|{| "declarationRangeIndex": 0 |}M|] = SomeModule;|] +////[|import [|{| "contextRangeIndex": 0 |}M|] = SomeModule;|] ////import C = [|M|].SomeClass; verify.rangesWithSameTextAreRenameLocations("M"); diff --git a/tests/cases/fourslash/renameAlias2.ts b/tests/cases/fourslash/renameAlias2.ts index 25540f45304..60fb0eab3f4 100644 --- a/tests/cases/fourslash/renameAlias2.ts +++ b/tests/cases/fourslash/renameAlias2.ts @@ -1,6 +1,6 @@ /// -////[|module [|{| "declarationRangeIndex": 0 |}SomeModule|] { export class SomeClass { } }|] +////[|module [|{| "contextRangeIndex": 0 |}SomeModule|] { export class SomeClass { } }|] ////import M = [|SomeModule|]; ////import C = M.SomeClass; diff --git a/tests/cases/fourslash/renameAlias3.ts b/tests/cases/fourslash/renameAlias3.ts index d20b58c75e8..78e01f6b13b 100644 --- a/tests/cases/fourslash/renameAlias3.ts +++ b/tests/cases/fourslash/renameAlias3.ts @@ -1,6 +1,6 @@ /// -////module SomeModule { [|export class [|{| "declarationRangeIndex": 0 |}SomeClass|] { }|] } +////module SomeModule { [|export class [|{| "contextRangeIndex": 0 |}SomeClass|] { }|] } ////import M = SomeModule; ////import C = M.[|SomeClass|]; diff --git a/tests/cases/fourslash/renameAliasExternalModule.ts b/tests/cases/fourslash/renameAliasExternalModule.ts index 71bce0dd282..dc259a2ef5a 100644 --- a/tests/cases/fourslash/renameAliasExternalModule.ts +++ b/tests/cases/fourslash/renameAliasExternalModule.ts @@ -5,7 +5,7 @@ ////export = SomeModule; // @Filename: b.ts -////[|import [|{| "declarationRangeIndex": 0 |}M|] = require("./a");|] +////[|import [|{| "contextRangeIndex": 0 |}M|] = require("./a");|] ////import C = [|M|].SomeClass; verify.rangesWithSameTextAreRenameLocations("M"); diff --git a/tests/cases/fourslash/renameAliasExternalModule2.ts b/tests/cases/fourslash/renameAliasExternalModule2.ts index e5e772179f5..a78a616d6ef 100644 --- a/tests/cases/fourslash/renameAliasExternalModule2.ts +++ b/tests/cases/fourslash/renameAliasExternalModule2.ts @@ -1,11 +1,11 @@ /// // @Filename: a.ts -////[|module [|{| "declarationRangeIndex": 0 |}SomeModule|] { export class SomeClass { } }|] -////[|export = [|{| "declarationRangeIndex": 2 |}SomeModule|];|] +////[|module [|{| "contextRangeIndex": 0 |}SomeModule|] { export class SomeClass { } }|] +////[|export = [|{| "contextRangeIndex": 2 |}SomeModule|];|] // @Filename: b.ts -////[|import [|{| "declarationRangeIndex": 4 |}M|] = require("./a");|] +////[|import [|{| "contextRangeIndex": 4 |}M|] = require("./a");|] ////import C = [|M|].SomeClass; const [r0Def, r0, r1Def, r1, r2Def, r2, r3] = test.ranges(); diff --git a/tests/cases/fourslash/renameAliasExternalModule3.ts b/tests/cases/fourslash/renameAliasExternalModule3.ts index 1d2df353a3f..0aee598124c 100644 --- a/tests/cases/fourslash/renameAliasExternalModule3.ts +++ b/tests/cases/fourslash/renameAliasExternalModule3.ts @@ -1,7 +1,7 @@ /// // @Filename: a.ts -////module SomeModule { [|export class [|{| "declarationRangeIndex": 0 |}SomeClass|] { }|] } +////module SomeModule { [|export class [|{| "contextRangeIndex": 0 |}SomeClass|] { }|] } ////export = SomeModule; // @Filename: b.ts diff --git a/tests/cases/fourslash/renameCommentsAndStrings1.ts b/tests/cases/fourslash/renameCommentsAndStrings1.ts index cef7088b09c..53cae40e72f 100644 --- a/tests/cases/fourslash/renameCommentsAndStrings1.ts +++ b/tests/cases/fourslash/renameCommentsAndStrings1.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to Bar in a comment. //// "this is a reference to Bar in a string" ////}|] diff --git a/tests/cases/fourslash/renameCommentsAndStrings2.ts b/tests/cases/fourslash/renameCommentsAndStrings2.ts index 85e748988d9..8d088759b07 100644 --- a/tests/cases/fourslash/renameCommentsAndStrings2.ts +++ b/tests/cases/fourslash/renameCommentsAndStrings2.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to Bar in a comment. //// "this is a reference to [|Bar|] in a string" ////}|] diff --git a/tests/cases/fourslash/renameCommentsAndStrings3.ts b/tests/cases/fourslash/renameCommentsAndStrings3.ts index c2d8482adbe..08672716a61 100644 --- a/tests/cases/fourslash/renameCommentsAndStrings3.ts +++ b/tests/cases/fourslash/renameCommentsAndStrings3.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to [|Bar|] in a comment. //// "this is a reference to Bar in a string" ////}|] diff --git a/tests/cases/fourslash/renameCommentsAndStrings4.ts b/tests/cases/fourslash/renameCommentsAndStrings4.ts index 0e04f22bde6..a5e0e24b3ef 100644 --- a/tests/cases/fourslash/renameCommentsAndStrings4.ts +++ b/tests/cases/fourslash/renameCommentsAndStrings4.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to [|Bar|] in a comment. //// "this is a reference to [|Bar|] in a string"; //// `Foo [|Bar|] Baz.`; diff --git a/tests/cases/fourslash/renameContextuallyTypedProperties.ts b/tests/cases/fourslash/renameContextuallyTypedProperties.ts index 4b5b03dbe94..da5286a714c 100644 --- a/tests/cases/fourslash/renameContextuallyTypedProperties.ts +++ b/tests/cases/fourslash/renameContextuallyTypedProperties.ts @@ -1,57 +1,57 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}prop1|]: () => void;|] +//// [|[|{| "contextRangeIndex": 0 |}prop1|]: () => void;|] //// prop2(): void; ////} //// ////var o1: I = { -//// [|[|{| "declarationRangeIndex": 2 |}prop1|]() { }|], +//// [|[|{| "contextRangeIndex": 2 |}prop1|]() { }|], //// prop2() { } ////}; //// ////var o2: I = { -//// [|[|{| "declarationRangeIndex": 4 |}prop1|]: () => { }|], +//// [|[|{| "contextRangeIndex": 4 |}prop1|]: () => { }|], //// prop2: () => { } ////}; //// ////var o3: I = { -//// [|get [|{| "declarationRangeIndex": 6 |}prop1|]() { return () => { }; }|], +//// [|get [|{| "contextRangeIndex": 6 |}prop1|]() { return () => { }; }|], //// get prop2() { return () => { }; } ////}; //// ////var o4: I = { -//// [|set [|{| "declarationRangeIndex": 8 |}prop1|](v) { }|], +//// [|set [|{| "contextRangeIndex": 8 |}prop1|](v) { }|], //// set prop2(v) { } ////}; //// ////var o5: I = { -//// [|"[|{| "declarationRangeIndex": 10 |}prop1|]"() { }|], +//// [|"[|{| "contextRangeIndex": 10 |}prop1|]"() { }|], //// "prop2"() { } ////}; //// ////var o6: I = { -//// [|"[|{| "declarationRangeIndex": 12 |}prop1|]": function () { }|], +//// [|"[|{| "contextRangeIndex": 12 |}prop1|]": function () { }|], //// "prop2": function () { } ////}; //// ////var o7: I = { -//// [|["[|{| "declarationRangeIndex": 14 |}prop1|]"]: function () { }|], +//// [|["[|{| "contextRangeIndex": 14 |}prop1|]"]: function () { }|], //// ["prop2"]: function () { } ////}; //// ////var o8: I = { -//// [|["[|{| "declarationRangeIndex": 16 |}prop1|]"]() { }|], +//// [|["[|{| "contextRangeIndex": 16 |}prop1|]"]() { }|], //// ["prop2"]() { } ////}; //// ////var o9: I = { -//// [|get ["[|{| "declarationRangeIndex": 18 |}prop1|]"]() { return () => { }; }|], +//// [|get ["[|{| "contextRangeIndex": 18 |}prop1|]"]() { return () => { }; }|], //// get ["prop2"]() { return () => { }; } ////}; //// ////var o10: I = { -//// [|set ["[|{| "declarationRangeIndex": 20 |}prop1|]"](v) { }|], +//// [|set ["[|{| "contextRangeIndex": 20 |}prop1|]"](v) { }|], //// set ["prop2"](v) { } ////}; diff --git a/tests/cases/fourslash/renameContextuallyTypedProperties2.ts b/tests/cases/fourslash/renameContextuallyTypedProperties2.ts index 44bc668fd25..fc3980404c9 100644 --- a/tests/cases/fourslash/renameContextuallyTypedProperties2.ts +++ b/tests/cases/fourslash/renameContextuallyTypedProperties2.ts @@ -2,57 +2,57 @@ ////interface I { //// prop1: () => void; -//// [|[|{| "declarationRangeIndex": 0 |}prop2|](): void;|] +//// [|[|{| "contextRangeIndex": 0 |}prop2|](): void;|] ////} //// ////var o1: I = { //// prop1() { }, -//// [|[|{| "declarationRangeIndex": 2 |}prop2|]() { }|] +//// [|[|{| "contextRangeIndex": 2 |}prop2|]() { }|] ////}; //// ////var o2: I = { //// prop1: () => { }, -//// [|[|{| "declarationRangeIndex": 4 |}prop2|]: () => { }|] +//// [|[|{| "contextRangeIndex": 4 |}prop2|]: () => { }|] ////}; //// ////var o3: I = { //// get prop1() { return () => { }; }, -//// [|get [|{| "declarationRangeIndex": 6 |}prop2|]() { return () => { }; }|] +//// [|get [|{| "contextRangeIndex": 6 |}prop2|]() { return () => { }; }|] ////}; //// ////var o4: I = { //// set prop1(v) { }, -//// [|set [|{| "declarationRangeIndex": 8 |}prop2|](v) { }|] +//// [|set [|{| "contextRangeIndex": 8 |}prop2|](v) { }|] ////}; //// ////var o5: I = { //// "prop1"() { }, -//// [|"[|{| "declarationRangeIndex": 10 |}prop2|]"() { }|] +//// [|"[|{| "contextRangeIndex": 10 |}prop2|]"() { }|] ////}; //// ////var o6: I = { //// "prop1": function () { }, -//// [|"[|{| "declarationRangeIndex": 12 |}prop2|]": function () { }|] +//// [|"[|{| "contextRangeIndex": 12 |}prop2|]": function () { }|] ////}; //// ////var o7: I = { //// ["prop1"]: function () { }, -//// [|["[|{| "declarationRangeIndex": 14 |}prop2|]"]: function () { }|] +//// [|["[|{| "contextRangeIndex": 14 |}prop2|]"]: function () { }|] ////}; //// ////var o8: I = { //// ["prop1"]() { }, -//// [|["[|{| "declarationRangeIndex": 16 |}prop2|]"]() { }|] +//// [|["[|{| "contextRangeIndex": 16 |}prop2|]"]() { }|] ////}; //// ////var o9: I = { //// get ["prop1"]() { return () => { }; }, -//// [|get ["[|{| "declarationRangeIndex": 18 |}prop2|]"]() { return () => { }; }|] +//// [|get ["[|{| "contextRangeIndex": 18 |}prop2|]"]() { return () => { }; }|] ////}; //// ////var o10: I = { //// set ["prop1"](v) { }, -//// [|set ["[|{| "declarationRangeIndex": 20 |}prop2|]"](v) { }|] +//// [|set ["[|{| "contextRangeIndex": 20 |}prop2|]"](v) { }|] ////}; verify.rangesWithSameTextAreRenameLocations("prop2"); diff --git a/tests/cases/fourslash/renameCrossJsTs01.ts b/tests/cases/fourslash/renameCrossJsTs01.ts index b4b3448d8c8..2ebdaf80d04 100644 --- a/tests/cases/fourslash/renameCrossJsTs01.ts +++ b/tests/cases/fourslash/renameCrossJsTs01.ts @@ -2,10 +2,10 @@ // @allowJs: true // @Filename: a.js -////[|exports.[|{| "declarationRangeIndex": 0 |}area|] = function (r) { return r * r; }|] +////[|exports.[|{| "contextRangeIndex": 0 |}area|] = function (r) { return r * r; }|] // @Filename: b.ts -////[|import { [|{| "declarationRangeIndex": 2 |}area|] } from './a';|] +////[|import { [|{| "contextRangeIndex": 2 |}area|] } from './a';|] ////var t = [|area|](10); const [r0Def, r0, r1Def, r1, r2] = test.ranges(); diff --git a/tests/cases/fourslash/renameDefaultImport.ts b/tests/cases/fourslash/renameDefaultImport.ts index 9c2a2d67dc1..e8599bf7cb6 100644 --- a/tests/cases/fourslash/renameDefaultImport.ts +++ b/tests/cases/fourslash/renameDefaultImport.ts @@ -1,13 +1,13 @@ /// // @Filename: B.ts -////[|export default class /*1*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}B|] { +////[|export default class /*1*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}B|] { //// test() { //// } ////}|] // @Filename: A.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}B|] from "./B";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}B|] from "./B";|] ////let b = new [|B|](); ////b.test(); diff --git a/tests/cases/fourslash/renameDefaultImportDifferentName.ts b/tests/cases/fourslash/renameDefaultImportDifferentName.ts index 8c05efe3add..c0d58e3a76b 100644 --- a/tests/cases/fourslash/renameDefaultImportDifferentName.ts +++ b/tests/cases/fourslash/renameDefaultImportDifferentName.ts @@ -1,13 +1,13 @@ /// // @Filename: B.ts -////[|export default class /*1*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] { +////[|export default class /*1*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] { //// test() { //// } ////}|] // @Filename: A.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}B|] from "./B";|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}B|] from "./B";|] ////let b = new [|B|](); ////b.test(); diff --git a/tests/cases/fourslash/renameDefaultLibDontWork.ts b/tests/cases/fourslash/renameDefaultLibDontWork.ts index 02d7e1d19ea..87b17f6f084 100644 --- a/tests/cases/fourslash/renameDefaultLibDontWork.ts +++ b/tests/cases/fourslash/renameDefaultLibDontWork.ts @@ -4,7 +4,7 @@ // "test" is a comment on the default library. // @Filename: file1.ts -//// [|var [|{| "declarationRangeIndex": 0 |}test|] = "foo";|] +//// [|var [|{| "contextRangeIndex": 0 |}test|] = "foo";|] //// console.log([|test|]); const [r0Def, ...ranges] = test.ranges(); diff --git a/tests/cases/fourslash/renameDestructuringAssignment.ts b/tests/cases/fourslash/renameDestructuringAssignment.ts index cc4a9eb6fe1..5fc19730691 100644 --- a/tests/cases/fourslash/renameDestructuringAssignment.ts +++ b/tests/cases/fourslash/renameDestructuringAssignment.ts @@ -1,10 +1,10 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}x|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}x|]: number;|] ////} ////var a: I; ////var x; -////([|{ [|{| "declarationRangeIndex": 2 |}x|]: x } = a|]); +////([|{ [|{| "contextRangeIndex": 2 |}x|]: x } = a|]); verify.rangesWithSameTextAreRenameLocations("x"); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts b/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts index 0ed560bb3fb..1444d597ba5 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts @@ -1,16 +1,16 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} ////var elems: I[]; //// -////var p2: number, [|[|{| "declarationRangeIndex": 2 |}property1|]: number|]; -////for ([|{ [|{| "declarationRangeIndex": 4 |}property1|] } = elems[0]|]; p2 < 100; p2++) { +////var p2: number, [|[|{| "contextRangeIndex": 2 |}property1|]: number|]; +////for ([|{ [|{| "contextRangeIndex": 4 |}property1|] } = elems[0]|]; p2 < 100; p2++) { //// p2 = [|property1|]++; ////} -////for ([|{ [|{| "declarationRangeIndex": 7 |}property1|]: p2 } = elems[0]|]; p2 < 100; p2++) { +////for ([|{ [|{| "contextRangeIndex": 7 |}property1|]: p2 } = elems[0]|]; p2 < 100; p2++) { ////} verify.noErrors(); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts b/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts index 80bc064ac0b..53bd7786adb 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts @@ -1,16 +1,16 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} ////var elems: I[]; //// -////var [|[|{| "declarationRangeIndex": 2 |}property1|]: number|], p2: number; -////for ([|{ [|{| "declarationRangeIndex": 4 |}property1|] } of elems|]) { +////var [|[|{| "contextRangeIndex": 2 |}property1|]: number|], p2: number; +////for ([|{ [|{| "contextRangeIndex": 4 |}property1|] } of elems|]) { //// [|property1|]++; ////} -////for ([|{ [|{| "declarationRangeIndex": 7 |}property1|]: p2 } of elems|]) { +////for ([|{ [|{| "contextRangeIndex": 7 |}property1|]: p2 } of elems|]) { ////} verify.noErrors(); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts index 2b8b882407c..260e80ed4d0 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts @@ -1,12 +1,12 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} -////var elems: I[], p1: number, [|[|{| "declarationRangeIndex": 2 |}property1|]: number|]; -////[|[{ [|{| "declarationRangeIndex": 4 |}property1|]: p1 }] = elems;|] -////[|[{ [|{| "declarationRangeIndex": 6 |}property1|] }] = elems;|] +////var elems: I[], p1: number, [|[|{| "contextRangeIndex": 2 |}property1|]: number|]; +////[|[{ [|{| "contextRangeIndex": 4 |}property1|]: p1 }] = elems;|] +////[|[{ [|{| "contextRangeIndex": 6 |}property1|] }] = elems;|] const ranges = test.ranges(); const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3] = ranges; diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts index 5a2f4699942..a275f63d0b3 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts @@ -3,15 +3,15 @@ ////interface MultiRobot { //// name: string; //// skills: { -//// [|[|{| "declarationRangeIndex": 0 |}primary|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}primary|]: string;|] //// secondary: string; //// }; ////} -////let multiRobot: MultiRobot, [|[|{| "declarationRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string, i: number; -////for ([|{ skills: { [|{| "declarationRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } = multiRobot|], i = 0; i < 1; i++) { +////let multiRobot: MultiRobot, [|[|{| "contextRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string, i: number; +////for ([|{ skills: { [|{| "contextRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } = multiRobot|], i = 0; i < 1; i++) { //// primaryA; ////} -////for ([|{ skills: { [|{| "declarationRangeIndex": 6 |}primary|], secondary } } = multiRobot|], i = 0; i < 1; i++) { +////for ([|{ skills: { [|{| "contextRangeIndex": 6 |}primary|], secondary } } = multiRobot|], i = 0; i < 1; i++) { //// [|primary|]; ////} diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts index 5a2f4699942..a275f63d0b3 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts @@ -3,15 +3,15 @@ ////interface MultiRobot { //// name: string; //// skills: { -//// [|[|{| "declarationRangeIndex": 0 |}primary|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}primary|]: string;|] //// secondary: string; //// }; ////} -////let multiRobot: MultiRobot, [|[|{| "declarationRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string, i: number; -////for ([|{ skills: { [|{| "declarationRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } = multiRobot|], i = 0; i < 1; i++) { +////let multiRobot: MultiRobot, [|[|{| "contextRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string, i: number; +////for ([|{ skills: { [|{| "contextRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } = multiRobot|], i = 0; i < 1; i++) { //// primaryA; ////} -////for ([|{ skills: { [|{| "declarationRangeIndex": 6 |}primary|], secondary } } = multiRobot|], i = 0; i < 1; i++) { +////for ([|{ skills: { [|{| "contextRangeIndex": 6 |}primary|], secondary } } = multiRobot|], i = 0; i < 1; i++) { //// [|primary|]; ////} diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts index 7a7786d5a99..18161d538a0 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts @@ -3,16 +3,16 @@ ////interface MultiRobot { //// name: string; //// skills: { -//// [|[|{| "declarationRangeIndex": 0 |}primary|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}primary|]: string;|] //// secondary: string; //// }; ////} ////let multiRobots: MultiRobot[]; -////let [|[|{| "declarationRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string; -////for ([|{ skills: { [|{| "declarationRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { +////let [|[|{| "contextRangeIndex": 2 |}primary|]: string|], secondary: string, primaryA: string, secondaryA: string; +////for ([|{ skills: { [|{| "contextRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { //// primaryA; ////} -////for ([|{ skills: { [|{| "declarationRangeIndex": 6 |}primary|], secondary } } of multiRobots|]) { +////for ([|{ skills: { [|{| "contextRangeIndex": 6 |}primary|], secondary } } of multiRobots|]) { //// [|primary|]; ////} diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts index 897c0ba871c..90835e75b5a 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts @@ -3,15 +3,15 @@ ////interface MultiRobot { //// name: string; //// skills: { -//// [|[|{| "declarationRangeIndex": 0 |}primary|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}primary|]: string;|] //// secondary: string; //// }; ////} -////let multiRobots: MultiRobot[], [|[|{| "declarationRangeIndex": 2 |}primary|]: string|]; -////for ([|{ skills: { [|{| "declarationRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { +////let multiRobots: MultiRobot[], [|[|{| "contextRangeIndex": 2 |}primary|]: string|]; +////for ([|{ skills: { [|{| "contextRangeIndex": 4 |}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { //// console.log(primaryA); ////} -////for ([|{ skills: { [|{| "declarationRangeIndex": 6 |}primary|], secondary } } of multiRobots|]) { +////for ([|{ skills: { [|{| "contextRangeIndex": 6 |}primary|], secondary } } of multiRobots|]) { //// console.log([|primary|]); ////} diff --git a/tests/cases/fourslash/renameDestructuringClassProperty.ts b/tests/cases/fourslash/renameDestructuringClassProperty.ts index 1cab702903f..365d7fb6b25 100644 --- a/tests/cases/fourslash/renameDestructuringClassProperty.ts +++ b/tests/cases/fourslash/renameDestructuringClassProperty.ts @@ -1,17 +1,17 @@ /// ////class A { -//// [|[|{| "declarationRangeIndex": 0 |}foo|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}foo|]: string;|] ////} ////class B { //// syntax1(a: A): void { -//// [|let { [|{| "declarationRangeIndex": 2 |}foo|] } = a;|] +//// [|let { [|{| "contextRangeIndex": 2 |}foo|] } = a;|] //// } //// syntax2(a: A): void { -//// [|let { [|{| "declarationRangeIndex": 4 |}foo|]: foo } = a;|] +//// [|let { [|{| "contextRangeIndex": 4 |}foo|]: foo } = a;|] //// } //// syntax11(a: A): void { -//// [|let { [|{| "declarationRangeIndex": 6 |}foo|] } = a;|] +//// [|let { [|{| "contextRangeIndex": 6 |}foo|] } = a;|] //// [|foo|] = "newString"; //// } ////} diff --git a/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts b/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts index bde0f348736..b1a653775ec 100644 --- a/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts +++ b/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts @@ -1,15 +1,15 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} ////var elems: I[]; //// ////var p2: number, property1: number; -////for ([|let { [|{| "declarationRangeIndex": 2 |}property1|]: p2 } = elems[0]|]; p2 < 100; p2++) { +////for ([|let { [|{| "contextRangeIndex": 2 |}property1|]: p2 } = elems[0]|]; p2 < 100; p2++) { ////} -////for ([|let { [|{| "declarationRangeIndex": 4 |}property1|] } = elems[0]|]; p2 < 100; p2++) { +////for ([|let { [|{| "contextRangeIndex": 4 |}property1|] } = elems[0]|]; p2 < 100; p2++) { //// [|property1|] = p2; ////} diff --git a/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts b/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts index b2ad6e01b31..f0c35ce8125 100644 --- a/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts @@ -1,15 +1,15 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} ////var elems: I[]; //// -////for ([|let { [|{| "declarationRangeIndex": 2 |}property1|] } of elems|]) { +////for ([|let { [|{| "contextRangeIndex": 2 |}property1|] } of elems|]) { //// [|property1|]++; ////} -////for ([|let { [|{| "declarationRangeIndex": 5 |}property1|]: p2 } of elems|]) { +////for ([|let { [|{| "contextRangeIndex": 5 |}property1|]: p2 } of elems|]) { ////} const [r0Def, r0, r1Def, r1, r2, r3Def, r3] = test.ranges(); diff --git a/tests/cases/fourslash/renameDestructuringFunctionParameter.ts b/tests/cases/fourslash/renameDestructuringFunctionParameter.ts index 80d82512ac5..faa423dac49 100644 --- a/tests/cases/fourslash/renameDestructuringFunctionParameter.ts +++ b/tests/cases/fourslash/renameDestructuringFunctionParameter.ts @@ -1,6 +1,6 @@ /// -////function f([|{[|{| "declarationRangeIndex": 0 |}a|]}: {[|a|]}|]) { +////function f([|{[|{| "contextRangeIndex": 0 |}a|]}: {[|a|]}|]) { //// f({[|a|]}); ////} diff --git a/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts b/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts index f262f44c6f0..040106a0c90 100644 --- a/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts +++ b/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts @@ -3,15 +3,15 @@ ////interface MultiRobot { //// name: string; //// skills: { -//// [|[|{| "declarationRangeIndex": 0|}primary|]: string;|] +//// [|[|{| "contextRangeIndex": 0|}primary|]: string;|] //// secondary: string; //// }; ////} ////let multiRobots: MultiRobot[]; -////for ([|let { skills: {[|{| "declarationRangeIndex": 2|}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { +////for ([|let { skills: {[|{| "contextRangeIndex": 2|}primary|]: primaryA, secondary: secondaryA } } of multiRobots|]) { //// console.log(primaryA); ////} -////for ([|let { skills: {[|{| "declarationRangeIndex": 4|}primary|], secondary } } of multiRobots|]) { +////for ([|let { skills: {[|{| "contextRangeIndex": 4|}primary|], secondary } } of multiRobots|]) { //// console.log([|primary|]); ////} diff --git a/tests/cases/fourslash/renameForDefaultExport01.ts b/tests/cases/fourslash/renameForDefaultExport01.ts index 04169d093e5..26697d1df1e 100644 --- a/tests/cases/fourslash/renameForDefaultExport01.ts +++ b/tests/cases/fourslash/renameForDefaultExport01.ts @@ -1,6 +1,6 @@ /// -////[|export default class [|{| "declarationRangeIndex": 0 |}DefaultExportedClass|] { +////[|export default class [|{| "contextRangeIndex": 0 |}DefaultExportedClass|] { ////}|] /////* //// * Commenting [|{| "inComment": true |}DefaultExportedClass|] diff --git a/tests/cases/fourslash/renameForDefaultExport02.ts b/tests/cases/fourslash/renameForDefaultExport02.ts index 1b97657da67..d9b172f2d2e 100644 --- a/tests/cases/fourslash/renameForDefaultExport02.ts +++ b/tests/cases/fourslash/renameForDefaultExport02.ts @@ -1,6 +1,6 @@ /// -////[|export default function /*1*/[|{| "declarationRangeIndex": 0 |}DefaultExportedFunction|]() { +////[|export default function /*1*/[|{| "contextRangeIndex": 0 |}DefaultExportedFunction|]() { //// return /*2*/[|DefaultExportedFunction|] ////}|] /////** diff --git a/tests/cases/fourslash/renameForDefaultExport03.ts b/tests/cases/fourslash/renameForDefaultExport03.ts index f9f859d2396..7b67d2e4509 100644 --- a/tests/cases/fourslash/renameForDefaultExport03.ts +++ b/tests/cases/fourslash/renameForDefaultExport03.ts @@ -1,10 +1,10 @@ /// -////[|function /*1*/[|{| "declarationRangeIndex": 0 |}f|]() { +////[|function /*1*/[|{| "contextRangeIndex": 0 |}f|]() { //// return 100; ////}|] //// -////[|export default /*2*/[|{| "declarationRangeIndex": 2 |}f|];|] +////[|export default /*2*/[|{| "contextRangeIndex": 2 |}f|];|] //// ////var x: typeof /*3*/[|f|]; //// @@ -13,7 +13,7 @@ /////** //// * Commenting [|{| "inComment": true |}f|] //// */ -////[|namespace /*5*/[|{| "declarationRangeIndex": 7 |}f|] { +////[|namespace /*5*/[|{| "contextRangeIndex": 7 |}f|] { //// var local = 100; ////}|] diff --git a/tests/cases/fourslash/renameImportAndExport.ts b/tests/cases/fourslash/renameImportAndExport.ts index bae23ec2d1a..9b94d6fedda 100644 --- a/tests/cases/fourslash/renameImportAndExport.ts +++ b/tests/cases/fourslash/renameImportAndExport.ts @@ -1,7 +1,7 @@ /// -////[|import [|{| "declarationRangeIndex": 0 |}a|] from "module";|] -////[|export { [|{| "declarationRangeIndex": 2 |}a|] };|] +////[|import [|{| "contextRangeIndex": 0 |}a|] from "module";|] +////[|export { [|{| "contextRangeIndex": 2 |}a|] };|] const [r0Def, r0, r1Def, r1] = test.ranges(); verify.renameLocations(r0, [r0, { range: r1, suffixText: " as a" }]); diff --git a/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts b/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts index c2578a80849..1e459e6ec07 100644 --- a/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts +++ b/tests/cases/fourslash/renameImportAndExportInDiffFiles.ts @@ -1,11 +1,11 @@ /// // @Filename: a.ts -////[|export var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}a|];|] +////[|export var [|{| "isDefinition": true, "contextRangeIndex": 0 |}a|];|] // @Filename: b.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}a|] } from './a';|] -////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}a|] };|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}a|] } from './a';|] +////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}a|] };|] const [r0Def, r0, r1Def, r1, r2Def, r2] = test.ranges(); const vars = { definition: "var a: any", ranges: [r0] }; diff --git a/tests/cases/fourslash/renameImportAndShorthand.ts b/tests/cases/fourslash/renameImportAndShorthand.ts index be3ee23fb10..376f16c9c5b 100644 --- a/tests/cases/fourslash/renameImportAndShorthand.ts +++ b/tests/cases/fourslash/renameImportAndShorthand.ts @@ -1,6 +1,6 @@ /// -////[|import [|{| "declarationRangeIndex": 0 |}foo|] from 'bar';|] +////[|import [|{| "contextRangeIndex": 0 |}foo|] from 'bar';|] ////const bar = { [|foo|] }; const [r0Def, r0, r1] = test.ranges(); diff --git a/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts index 942d6a5ffde..5a3ed66e976 100644 --- a/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts +++ b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts @@ -1,6 +1,6 @@ /// -////[|import * as [|{| "declarationRangeIndex": 0 |}foo|] from 'bar';|] +////[|import * as [|{| "contextRangeIndex": 0 |}foo|] from 'bar';|] ////const bar = { [|foo|] }; const [r0Def, r0, r1] = test.ranges(); diff --git a/tests/cases/fourslash/renameImportOfExportEquals.ts b/tests/cases/fourslash/renameImportOfExportEquals.ts index 230c50d71fd..25e58947d30 100644 --- a/tests/cases/fourslash/renameImportOfExportEquals.ts +++ b/tests/cases/fourslash/renameImportOfExportEquals.ts @@ -1,17 +1,17 @@ /// -////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}N|] { -//// [|export var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|]: number;|] +////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}N|] { +//// [|export var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|]: number;|] ////}|] ////declare module "mod" { -//// [|export = [|{| "declarationRangeIndex": 4 |}N|];|] +//// [|export = [|{| "contextRangeIndex": 4 |}N|];|] ////} ////declare module "a" { -//// [|import * as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}N|] from "mod";|] -//// [|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}N|] };|] // Renaming N here would rename +//// [|import * as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}N|] from "mod";|] +//// [|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}N|] };|] // Renaming N here would rename ////} ////declare module "b" { -//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}N|] } from "a";|] +//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 10 |}N|] } from "a";|] //// export const y: typeof [|N|].[|x|]; ////} diff --git a/tests/cases/fourslash/renameImportOfExportEquals2.ts b/tests/cases/fourslash/renameImportOfExportEquals2.ts index df915f45fb7..4f1e6c39f22 100644 --- a/tests/cases/fourslash/renameImportOfExportEquals2.ts +++ b/tests/cases/fourslash/renameImportOfExportEquals2.ts @@ -1,17 +1,17 @@ /// -////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}N|] { +////[|declare namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}N|] { //// export var x: number; ////}|] ////declare module "mod" { -//// [|export = [|{| "declarationRangeIndex": 2 |}N|];|] +//// [|export = [|{| "contextRangeIndex": 2 |}N|];|] ////} ////declare module "a" { -//// [|import * as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}O|] from "mod";|] -//// [|export { [|{| "declarationRangeIndex": 6 |}O|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}P|] };|] // Renaming N here would rename +//// [|import * as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}O|] from "mod";|] +//// [|export { [|{| "contextRangeIndex": 6 |}O|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}P|] };|] // Renaming N here would rename ////} ////declare module "b" { -//// [|import { [|{| "declarationRangeIndex": 9 |}P|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 9 |}Q|] } from "a";|] +//// [|import { [|{| "contextRangeIndex": 9 |}P|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 9 |}Q|] } from "a";|] //// export const y: typeof [|Q|].x; ////} diff --git a/tests/cases/fourslash/renameImportOfReExport.ts b/tests/cases/fourslash/renameImportOfReExport.ts index 9d181b3892f..c80da246699 100644 --- a/tests/cases/fourslash/renameImportOfReExport.ts +++ b/tests/cases/fourslash/renameImportOfReExport.ts @@ -2,13 +2,13 @@ // @noLib: true ////declare module "a" { -//// [|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] {}|] +//// [|export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] {}|] ////} ////declare module "b" { -//// [|export { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}C|] } from "a";|] +//// [|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}C|] } from "a";|] ////} ////declare module "c" { -//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}C|] } from "b";|] +//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}C|] } from "b";|] //// export function f(c: [|C|]): void; ////} diff --git a/tests/cases/fourslash/renameImportOfReExport2.ts b/tests/cases/fourslash/renameImportOfReExport2.ts index fe3926fbf9b..f8589dbb41d 100644 --- a/tests/cases/fourslash/renameImportOfReExport2.ts +++ b/tests/cases/fourslash/renameImportOfReExport2.ts @@ -1,13 +1,13 @@ /// ////declare module "a" { -//// [|export class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] {}|] +//// [|export class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}C|] {}|] ////} ////declare module "b" { -//// [|export { [|{| "declarationRangeIndex": 2 |}C|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}D|] } from "a";|] +//// [|export { [|{| "contextRangeIndex": 2 |}C|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}D|] } from "a";|] ////} ////declare module "c" { -//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}D|] } from "b";|] +//// [|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}D|] } from "b";|] //// export function f(c: [|D|]): void; ////} diff --git a/tests/cases/fourslash/renameImportRequire.ts b/tests/cases/fourslash/renameImportRequire.ts index 11b729c72d6..fc41d5a95ac 100644 --- a/tests/cases/fourslash/renameImportRequire.ts +++ b/tests/cases/fourslash/renameImportRequire.ts @@ -1,14 +1,14 @@ /// // @Filename: /a.ts -////[|import [|{| "declarationRangeIndex": 0 |}e|] = require("mod4");|] +////[|import [|{| "contextRangeIndex": 0 |}e|] = require("mod4");|] ////[|e|]; ////a = { [|e|] }; -////[|export { [|{| "declarationRangeIndex": 4 |}e|] };|] +////[|export { [|{| "contextRangeIndex": 4 |}e|] };|] // @Filename: /b.ts -////[|import { [|{| "declarationRangeIndex": 6 |}e|] } from "./a";|] -////[|export { [|{| "declarationRangeIndex": 8 |}e|] };|] +////[|import { [|{| "contextRangeIndex": 6 |}e|] } from "./a";|] +////[|export { [|{| "contextRangeIndex": 8 |}e|] };|] const [r0Def, r0, r1, r2, r3Def, r3, r4Def, r4, r5Def, r5] = test.ranges(); verify.renameLocations([r0, r1, r2], [r0, r1, { range: r2, prefixText: "e: " }, { range: r3, suffixText: " as e" }]); diff --git a/tests/cases/fourslash/renameInheritedProperties1.ts b/tests/cases/fourslash/renameInheritedProperties1.ts index 784d77cb609..5f52732d65f 100644 --- a/tests/cases/fourslash/renameInheritedProperties1.ts +++ b/tests/cases/fourslash/renameInheritedProperties1.ts @@ -1,7 +1,7 @@ /// //// class class1 extends class1 { -//// [|[|{| "declarationRangeIndex": 0 |}propName|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}propName|]: string;|] //// } //// //// var v: class1; diff --git a/tests/cases/fourslash/renameInheritedProperties2.ts b/tests/cases/fourslash/renameInheritedProperties2.ts index 632ff0b30ca..0dd3435a807 100644 --- a/tests/cases/fourslash/renameInheritedProperties2.ts +++ b/tests/cases/fourslash/renameInheritedProperties2.ts @@ -1,7 +1,7 @@ /// //// class class1 extends class1 { -//// [|[|{| "declarationRangeIndex": 0 |}doStuff|]() { }|] +//// [|[|{| "contextRangeIndex": 0 |}doStuff|]() { }|] //// } //// //// var v: class1; diff --git a/tests/cases/fourslash/renameInheritedProperties3.ts b/tests/cases/fourslash/renameInheritedProperties3.ts index 511bf8e0a01..ecdab6c3901 100644 --- a/tests/cases/fourslash/renameInheritedProperties3.ts +++ b/tests/cases/fourslash/renameInheritedProperties3.ts @@ -1,7 +1,7 @@ /// //// interface interface1 extends interface1 { -//// [|[|{| "declarationRangeIndex": 0 |}propName|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}propName|]: string;|] //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/renameInheritedProperties4.ts b/tests/cases/fourslash/renameInheritedProperties4.ts index e3ac0da7e63..b16eaa55d1b 100644 --- a/tests/cases/fourslash/renameInheritedProperties4.ts +++ b/tests/cases/fourslash/renameInheritedProperties4.ts @@ -1,7 +1,7 @@ /// //// interface interface1 extends interface1 { -//// [|[|{| "declarationRangeIndex": 0 |}doStuff|](): string;|] +//// [|[|{| "contextRangeIndex": 0 |}doStuff|](): string;|] //// } //// //// var v: interface1; diff --git a/tests/cases/fourslash/renameInheritedProperties5.ts b/tests/cases/fourslash/renameInheritedProperties5.ts index 2c6340eaab2..430744110f7 100644 --- a/tests/cases/fourslash/renameInheritedProperties5.ts +++ b/tests/cases/fourslash/renameInheritedProperties5.ts @@ -4,7 +4,7 @@ //// propC: number; //// } //// interface D extends C { -//// [|[|{| "declarationRangeIndex": 0 |}propD|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}propD|]: string;|] //// } //// var d: D; //// d.[|propD|]; diff --git a/tests/cases/fourslash/renameInheritedProperties6.ts b/tests/cases/fourslash/renameInheritedProperties6.ts index a07587bb9ff..31f28fbbd33 100644 --- a/tests/cases/fourslash/renameInheritedProperties6.ts +++ b/tests/cases/fourslash/renameInheritedProperties6.ts @@ -4,7 +4,7 @@ //// propD: number; //// } //// interface D extends C { -//// [|[|{| "declarationRangeIndex": 0 |}propC|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}propC|]: number;|] //// } //// var d: D; //// d.[|propC|]; diff --git a/tests/cases/fourslash/renameInheritedProperties7.ts b/tests/cases/fourslash/renameInheritedProperties7.ts index 38d36a5416c..02bdae31329 100644 --- a/tests/cases/fourslash/renameInheritedProperties7.ts +++ b/tests/cases/fourslash/renameInheritedProperties7.ts @@ -1,7 +1,7 @@ /// //// class C extends D { -//// [|[|{| "declarationRangeIndex": 0 |}prop1|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}prop1|]: string;|] //// } //// //// class D extends C { diff --git a/tests/cases/fourslash/renameInheritedProperties8.ts b/tests/cases/fourslash/renameInheritedProperties8.ts index 4762178aacf..2113ec92db5 100644 --- a/tests/cases/fourslash/renameInheritedProperties8.ts +++ b/tests/cases/fourslash/renameInheritedProperties8.ts @@ -1,11 +1,11 @@ /// //// class C implements D { -//// [|[|{| "declarationRangeIndex": 0 |}prop1|]: string;|] +//// [|[|{| "contextRangeIndex": 0 |}prop1|]: string;|] //// } //// //// interface D extends C { -//// [|[|{| "declarationRangeIndex": 2 |}prop1|]: string;|] +//// [|[|{| "contextRangeIndex": 2 |}prop1|]: string;|] //// } //// //// var c: C; diff --git a/tests/cases/fourslash/renameJsExports01.ts b/tests/cases/fourslash/renameJsExports01.ts index 2a081525bbe..bcb9b3b78e5 100644 --- a/tests/cases/fourslash/renameJsExports01.ts +++ b/tests/cases/fourslash/renameJsExports01.ts @@ -2,7 +2,7 @@ // @allowJs: true // @Filename: a.js -////[|exports.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}area|] = function (r) { return r * r; }|] +////[|exports.[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}area|] = function (r) { return r * r; }|] // @Filename: b.js ////var mod = require('./a'); diff --git a/tests/cases/fourslash/renameJsExports02.ts b/tests/cases/fourslash/renameJsExports02.ts index 3628a9c8101..17f69760931 100644 --- a/tests/cases/fourslash/renameJsExports02.ts +++ b/tests/cases/fourslash/renameJsExports02.ts @@ -2,10 +2,10 @@ // @allowJs: true // @Filename: a.js -////module.exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] {}|] +////module.exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] {}|] // @Filename: b.js -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}A|] = require("./a");|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}A|] = require("./a");|] const [rDef, r0, r1Def, r1] = test.ranges(); verify.referenceGroups(r0, [ diff --git a/tests/cases/fourslash/renameJsExports03.ts b/tests/cases/fourslash/renameJsExports03.ts index 308f3c55ada..d1fafa70c80 100644 --- a/tests/cases/fourslash/renameJsExports03.ts +++ b/tests/cases/fourslash/renameJsExports03.ts @@ -2,13 +2,13 @@ // @allowJs: true // @Filename: a.js -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] { -//// [|[|{| "declarationRangeIndex": 2 |}constructor|]() { }|] +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] { +//// [|[|{| "contextRangeIndex": 2 |}constructor|]() { }|] ////}|] -////[|module.exports = [|{| "declarationRangeIndex": 4 |}A|];|] +////[|module.exports = [|{| "contextRangeIndex": 4 |}A|];|] // @Filename: b.js -////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}A|] = require("./a");|] +////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}A|] = require("./a");|] ////new [|A|]; const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4] = test.ranges(); diff --git a/tests/cases/fourslash/renameJsPropertyAssignment.ts b/tests/cases/fourslash/renameJsPropertyAssignment.ts index 75b1a486255..5db313ad5ab 100644 --- a/tests/cases/fourslash/renameJsPropertyAssignment.ts +++ b/tests/cases/fourslash/renameJsPropertyAssignment.ts @@ -4,7 +4,7 @@ // @Filename: a.js ////function bar() { ////} -////[|bar.[|{| "declarationRangeIndex": 0 |}foo|] = "foo";|] +////[|bar.[|{| "contextRangeIndex": 0 |}foo|] = "foo";|] ////console.log(bar.[|foo|]); verify.rangesWithSameTextAreRenameLocations("foo"); diff --git a/tests/cases/fourslash/renameJsPropertyAssignment2.ts b/tests/cases/fourslash/renameJsPropertyAssignment2.ts index 0539fcf87d6..9bdc71f4713 100644 --- a/tests/cases/fourslash/renameJsPropertyAssignment2.ts +++ b/tests/cases/fourslash/renameJsPropertyAssignment2.ts @@ -4,7 +4,7 @@ // @Filename: a.js ////class Minimatch { ////} -////[|Minimatch.[|{| "declarationRangeIndex": 0 |}staticProperty|] = "string";|] +////[|Minimatch.[|{| "contextRangeIndex": 0 |}staticProperty|] = "string";|] ////console.log(Minimatch.[|staticProperty|]); verify.rangesWithSameTextAreRenameLocations("staticProperty"); diff --git a/tests/cases/fourslash/renameJsPropertyAssignment3.ts b/tests/cases/fourslash/renameJsPropertyAssignment3.ts index acd44682b41..0d32cf55752 100644 --- a/tests/cases/fourslash/renameJsPropertyAssignment3.ts +++ b/tests/cases/fourslash/renameJsPropertyAssignment3.ts @@ -4,7 +4,7 @@ // @Filename: a.js ////var C = class { ////} -////[|C.[|{| "declarationRangeIndex": 0 |}staticProperty|] = "string";|] +////[|C.[|{| "contextRangeIndex": 0 |}staticProperty|] = "string";|] ////console.log(C.[|staticProperty|]); verify.rangesWithSameTextAreRenameLocations("staticProperty"); diff --git a/tests/cases/fourslash/renameJsPrototypeProperty01.ts b/tests/cases/fourslash/renameJsPrototypeProperty01.ts index 519c161e727..8e37e6b88be 100644 --- a/tests/cases/fourslash/renameJsPrototypeProperty01.ts +++ b/tests/cases/fourslash/renameJsPrototypeProperty01.ts @@ -4,8 +4,8 @@ // @Filename: a.js ////function bar() { ////} -////[|bar.prototype.[|{| "declarationRangeIndex": 0 |}x|] = 10;|] +////[|bar.prototype.[|{| "contextRangeIndex": 0 |}x|] = 10;|] ////var t = new bar(); -////[|t.[|{| "declarationRangeIndex": 2 |}x|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}x|] = 11;|] verify.rangesWithSameTextAreRenameLocations("x"); diff --git a/tests/cases/fourslash/renameJsPrototypeProperty02.ts b/tests/cases/fourslash/renameJsPrototypeProperty02.ts index 519c161e727..8e37e6b88be 100644 --- a/tests/cases/fourslash/renameJsPrototypeProperty02.ts +++ b/tests/cases/fourslash/renameJsPrototypeProperty02.ts @@ -4,8 +4,8 @@ // @Filename: a.js ////function bar() { ////} -////[|bar.prototype.[|{| "declarationRangeIndex": 0 |}x|] = 10;|] +////[|bar.prototype.[|{| "contextRangeIndex": 0 |}x|] = 10;|] ////var t = new bar(); -////[|t.[|{| "declarationRangeIndex": 2 |}x|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}x|] = 11;|] verify.rangesWithSameTextAreRenameLocations("x"); diff --git a/tests/cases/fourslash/renameJsThisProperty01.ts b/tests/cases/fourslash/renameJsThisProperty01.ts index d08e11455bc..de42aa6be03 100644 --- a/tests/cases/fourslash/renameJsThisProperty01.ts +++ b/tests/cases/fourslash/renameJsThisProperty01.ts @@ -3,9 +3,9 @@ // @allowJs: true // @Filename: a.js ////function bar() { -//// [|this.[|{| "declarationRangeIndex": 0 |}x|] = 10;|] +//// [|this.[|{| "contextRangeIndex": 0 |}x|] = 10;|] ////} ////var t = new bar(); -////[|t.[|{| "declarationRangeIndex": 2 |}x|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}x|] = 11;|] verify.rangesWithSameTextAreRenameLocations("x"); diff --git a/tests/cases/fourslash/renameJsThisProperty03.ts b/tests/cases/fourslash/renameJsThisProperty03.ts index 14150674e91..c9891aef81f 100644 --- a/tests/cases/fourslash/renameJsThisProperty03.ts +++ b/tests/cases/fourslash/renameJsThisProperty03.ts @@ -4,10 +4,10 @@ // @Filename: a.js ////class C { //// constructor(y) { -//// [|this.[|{| "declarationRangeIndex": 0 |}x|] = y;|] +//// [|this.[|{| "contextRangeIndex": 0 |}x|] = y;|] //// } ////} ////var t = new C(12); -////[|t.[|{| "declarationRangeIndex": 2 |}x|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}x|] = 11;|] verify.rangesWithSameTextAreRenameLocations("x"); diff --git a/tests/cases/fourslash/renameJsThisProperty05.ts b/tests/cases/fourslash/renameJsThisProperty05.ts index 1277df32288..b9d36f164a8 100644 --- a/tests/cases/fourslash/renameJsThisProperty05.ts +++ b/tests/cases/fourslash/renameJsThisProperty05.ts @@ -7,8 +7,8 @@ //// this.x = y; //// } ////} -////[|C.prototype.[|{| "declarationRangeIndex": 0 |}z|] = 1;|] +////[|C.prototype.[|{| "contextRangeIndex": 0 |}z|] = 1;|] ////var t = new C(12); -////[|t.[|{| "declarationRangeIndex": 2 |}z|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}z|] = 11;|] verify.rangesWithSameTextAreRenameLocations("z"); diff --git a/tests/cases/fourslash/renameJsThisProperty06.ts b/tests/cases/fourslash/renameJsThisProperty06.ts index ab773cc2764..de73d27180d 100644 --- a/tests/cases/fourslash/renameJsThisProperty06.ts +++ b/tests/cases/fourslash/renameJsThisProperty06.ts @@ -7,8 +7,8 @@ //// this.x = y; //// } ////} -////[|C.prototype.[|{| "declarationRangeIndex": 0 |}z|] = 1;|] +////[|C.prototype.[|{| "contextRangeIndex": 0 |}z|] = 1;|] ////var t = new C(12); -////[|t.[|{| "declarationRangeIndex": 2 |}z|] = 11;|] +////[|t.[|{| "contextRangeIndex": 2 |}z|] = 11;|] verify.rangesWithSameTextAreRenameLocations("z"); diff --git a/tests/cases/fourslash/renameLocationsForClassExpression01.ts b/tests/cases/fourslash/renameLocationsForClassExpression01.ts index b6bdb7eccb0..b7d8258b387 100644 --- a/tests/cases/fourslash/renameLocationsForClassExpression01.ts +++ b/tests/cases/fourslash/renameLocationsForClassExpression01.ts @@ -3,7 +3,7 @@ ////class Foo { ////} //// -////var x = [|class [|{| "declarationRangeIndex": 0 |}Foo|] { +////var x = [|class [|{| "contextRangeIndex": 0 |}Foo|] { //// doIt() { //// return [|Foo|]; //// } diff --git a/tests/cases/fourslash/renameLocationsForFunctionExpression01.ts b/tests/cases/fourslash/renameLocationsForFunctionExpression01.ts index f0ff6ee222d..976637271ae 100644 --- a/tests/cases/fourslash/renameLocationsForFunctionExpression01.ts +++ b/tests/cases/fourslash/renameLocationsForFunctionExpression01.ts @@ -1,6 +1,6 @@ /// -////var x = [|function [|{| "declarationRangeIndex": 0 |}f|](g: any, h: any) { +////var x = [|function [|{| "contextRangeIndex": 0 |}f|](g: any, h: any) { //// [|f|]([|f|], g); ////}|] diff --git a/tests/cases/fourslash/renameLocationsForFunctionExpression02.ts b/tests/cases/fourslash/renameLocationsForFunctionExpression02.ts index 0eb34d2baf9..e2eb6c02a3d 100644 --- a/tests/cases/fourslash/renameLocationsForFunctionExpression02.ts +++ b/tests/cases/fourslash/renameLocationsForFunctionExpression02.ts @@ -3,7 +3,7 @@ ////function f() { //// ////} -////var x = [|function [|{| "declarationRangeIndex": 0 |}f|](g: any, h: any) { +////var x = [|function [|{| "contextRangeIndex": 0 |}f|](g: any, h: any) { //// //// let helper = function f(): any { f(); } //// diff --git a/tests/cases/fourslash/renameObjectBindingElementPropertyName01.ts b/tests/cases/fourslash/renameObjectBindingElementPropertyName01.ts index b9f733e3bf5..079085b5875 100644 --- a/tests/cases/fourslash/renameObjectBindingElementPropertyName01.ts +++ b/tests/cases/fourslash/renameObjectBindingElementPropertyName01.ts @@ -1,12 +1,12 @@ /// ////interface I { -//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|] +//// [|[|{| "contextRangeIndex": 0 |}property1|]: number;|] //// property2: string; ////} //// ////var foo: I; -////[|var { [|{| "declarationRangeIndex": 2 |}property1|]: prop1 } = foo;|] +////[|var { [|{| "contextRangeIndex": 2 |}property1|]: prop1 } = foo;|] verify.rangesWithSameTextAreRenameLocations("property1"); diff --git a/tests/cases/fourslash/renameObjectSpread.ts b/tests/cases/fourslash/renameObjectSpread.ts index 389de34cfc5..945d7613bfc 100644 --- a/tests/cases/fourslash/renameObjectSpread.ts +++ b/tests/cases/fourslash/renameObjectSpread.ts @@ -1,7 +1,7 @@ /// -////interface A1 { [|[|{| "declarationRangeIndex": 0 |}a|]: number|] }; -////interface A2 { [|[|{| "declarationRangeIndex": 2 |}a|]?: number|] }; +////interface A1 { [|[|{| "contextRangeIndex": 0 |}a|]: number|] }; +////interface A2 { [|[|{| "contextRangeIndex": 2 |}a|]?: number|] }; ////let a1: A1; ////let a2: A2; ////let a12 = { ...a1, ...a2 }; diff --git a/tests/cases/fourslash/renameObjectSpreadAssignment.ts b/tests/cases/fourslash/renameObjectSpreadAssignment.ts index c326a38ce6c..4ff66fef99e 100644 --- a/tests/cases/fourslash/renameObjectSpreadAssignment.ts +++ b/tests/cases/fourslash/renameObjectSpreadAssignment.ts @@ -2,8 +2,8 @@ ////interface A1 { a: number }; ////interface A2 { a?: number }; -////[|let [|{| "declarationRangeIndex": 0 |}a1|]: A1;|] -////[|let [|{| "declarationRangeIndex": 2 |}a2|]: A2;|] +////[|let [|{| "contextRangeIndex": 0 |}a1|]: A1;|] +////[|let [|{| "contextRangeIndex": 2 |}a2|]: A2;|] ////let a12 = { ...[|a1|], ...[|a2|] }; const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges(); diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration1.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration1.ts index c3dfb37ca6f..08b9b5456d6 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration1.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration1.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|private [|{| "declarationRangeIndex": 0 |}privateParam|]: number|]) { +//// constructor([|private [|{| "contextRangeIndex": 0 |}privateParam|]: number|]) { //// let localPrivate = [|privateParam|]; //// this.[|privateParam|] += 10; //// } diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration2.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration2.ts index a4e8acc3074..0fc326cd116 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration2.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration2.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|public [|{| "declarationRangeIndex": 0 |}publicParam|]: number|]) { +//// constructor([|public [|{| "contextRangeIndex": 0 |}publicParam|]: number|]) { //// let publicParam = [|publicParam|]; //// this.[|publicParam|] += 10; //// } diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration3.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration3.ts index 3d8b5510c98..127b7350487 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration3.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration3.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|protected [|{| "declarationRangeIndex": 0 |}protectedParam|]: number|]) { +//// constructor([|protected [|{| "contextRangeIndex": 0 |}protectedParam|]: number|]) { //// let protectedParam = [|protectedParam|]; //// this.[|protectedParam|] += 10; //// } diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts index 02cd24d64b5..ce2b26a2fc8 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|protected { [|{| "declarationRangeIndex": 0 |}protectedParam|] }|]) { +//// constructor([|protected { [|{| "contextRangeIndex": 0 |}protectedParam|] }|]) { //// let myProtectedParam = [|protectedParam|]; //// } //// } diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration5.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration5.ts index 8cacfbad0fa..4bd9cd137bc 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration5.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration5.ts @@ -1,7 +1,7 @@ /// //// class Foo { -//// constructor([|protected [ [|{| "declarationRangeIndex": 0 |}protectedParam|] ]|]) { +//// constructor([|protected [ [|{| "contextRangeIndex": 0 |}protectedParam|] ]|]) { //// let myProtectedParam = [|protectedParam|]; //// } //// } diff --git a/tests/cases/fourslash/renamePropertyAccessExpressionHeritageClause.ts b/tests/cases/fourslash/renamePropertyAccessExpressionHeritageClause.ts index 32993d730e7..7967533faf0 100644 --- a/tests/cases/fourslash/renamePropertyAccessExpressionHeritageClause.ts +++ b/tests/cases/fourslash/renamePropertyAccessExpressionHeritageClause.ts @@ -2,7 +2,7 @@ //// class B {} //// function foo() { -//// return {[|[|{| "declarationRangeIndex": 0 |}B|]: B|]}; +//// return {[|[|{| "contextRangeIndex": 0 |}B|]: B|]}; //// } //// class C extends (foo()).[|B|] {} //// class C1 extends foo().[|B|] {} diff --git a/tests/cases/fourslash/renameReExportDefault.ts b/tests/cases/fourslash/renameReExportDefault.ts index 0e00a269b37..df544f6e87d 100644 --- a/tests/cases/fourslash/renameReExportDefault.ts +++ b/tests/cases/fourslash/renameReExportDefault.ts @@ -2,15 +2,15 @@ // @Filename: /a.ts ////export { default } from "./b"; -////[|export { default as [|{| "declarationRangeIndex": 0 |}b|] } from "./b";|] +////[|export { default as [|{| "contextRangeIndex": 0 |}b|] } from "./b";|] ////export { default as bee } from "./b"; -////[|import { default as [|{| "declarationRangeIndex": 2 |}b|] } from "./b";|] +////[|import { default as [|{| "contextRangeIndex": 2 |}b|] } from "./b";|] ////import { default as bee } from "./b"; -////[|import [|{| "declarationRangeIndex": 4 |}b|] from "./b";|] +////[|import [|{| "contextRangeIndex": 4 |}b|] from "./b";|] // @Filename: /b.ts -////[|const [|{| "declarationRangeIndex": 6 |}b|] = 0;|] -////[|export default [|{| "declarationRangeIndex": 8 |}b|];|] +////[|const [|{| "contextRangeIndex": 6 |}b|] = 0;|] +////[|export default [|{| "contextRangeIndex": 8 |}b|];|] const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4Def, r4] = test.ranges(); verify.renameLocations(r0, [r0]); diff --git a/tests/cases/fourslash/renameRest.ts b/tests/cases/fourslash/renameRest.ts index 8540586857b..a1bf56c737e 100644 --- a/tests/cases/fourslash/renameRest.ts +++ b/tests/cases/fourslash/renameRest.ts @@ -1,7 +1,7 @@ /// ////interface Gen { //// x: number; -//// [|[|{| "declarationRangeIndex": 0 |}parent|]: Gen;|] +//// [|[|{| "contextRangeIndex": 0 |}parent|]: Gen;|] //// millenial: string; ////} ////let t: Gen; diff --git a/tests/cases/fourslash/renameStringPropertyNames.ts b/tests/cases/fourslash/renameStringPropertyNames.ts index 609d45c62b3..5c7d761422e 100644 --- a/tests/cases/fourslash/renameStringPropertyNames.ts +++ b/tests/cases/fourslash/renameStringPropertyNames.ts @@ -1,11 +1,11 @@ /// ////var o = { -//// [|[|{| "declarationRangeIndex": 0 |}prop|]: 0|] +//// [|[|{| "contextRangeIndex": 0 |}prop|]: 0|] ////}; //// ////o = { -//// [|"[|{| "declarationRangeIndex": 2 |}prop|]": 1|] +//// [|"[|{| "contextRangeIndex": 2 |}prop|]": 1|] ////}; //// ////o["[|prop|]"]; diff --git a/tests/cases/fourslash/renameThis.ts b/tests/cases/fourslash/renameThis.ts index 82bfae820dc..b26a0255301 100644 --- a/tests/cases/fourslash/renameThis.ts +++ b/tests/cases/fourslash/renameThis.ts @@ -4,7 +4,7 @@ //// return [|this|]; ////} ////this/**/; -////const _ = { [|[|{| "declarationRangeIndex": 2 |}this|]: 0|] }.[|this|]; +////const _ = { [|[|{| "contextRangeIndex": 2 |}this|]: 0|] }.[|this|]; const [r0, r1, r2Def, r2, r3] = test.ranges() verify.rangesAreRenameLocations([r0, r1]); diff --git a/tests/cases/fourslash/renameUMDModuleAlias1.ts b/tests/cases/fourslash/renameUMDModuleAlias1.ts index 36c67241a10..04bc8a15489 100644 --- a/tests/cases/fourslash/renameUMDModuleAlias1.ts +++ b/tests/cases/fourslash/renameUMDModuleAlias1.ts @@ -4,7 +4,7 @@ //// export function doThing(): string; //// export function doTheOtherThing(): void; -//// [|export as namespace [|{| "declarationRangeIndex": 0 |}myLib|];|] +//// [|export as namespace [|{| "contextRangeIndex": 0 |}myLib|];|] // @Filename: 1.ts //// /// diff --git a/tests/cases/fourslash/server/jsdocCallbackTagRename01.ts b/tests/cases/fourslash/server/jsdocCallbackTagRename01.ts index 557d0d49298..e4cd7d06feb 100644 --- a/tests/cases/fourslash/server/jsdocCallbackTagRename01.ts +++ b/tests/cases/fourslash/server/jsdocCallbackTagRename01.ts @@ -4,7 +4,7 @@ // @Filename: jsDocCallback.js //// //// /** -//// * [|@callback [|{| "declarationRangeIndex": 0 |}FooCallback|] +//// * [|@callback [|{| "contextRangeIndex": 0 |}FooCallback|] //// * @param {string} eventName - Rename should work //// |]*/ //// diff --git a/tests/cases/fourslash/server/jsdocTypedefTagRename01.ts b/tests/cases/fourslash/server/jsdocTypedefTagRename01.ts index 8bfd04bda81..14f24b4c6ea 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTagRename01.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTagRename01.ts @@ -4,7 +4,7 @@ // @Filename: jsDocTypedef_form1.js //// //// /** @typedef {(string | number)} */ -//// [|var [|{| "declarationRangeIndex": 0 |}NumberLike|];|] +//// [|var [|{| "contextRangeIndex": 0 |}NumberLike|];|] //// //// [|NumberLike|] = 10; //// diff --git a/tests/cases/fourslash/server/jsdocTypedefTagRename02.ts b/tests/cases/fourslash/server/jsdocTypedefTagRename02.ts index dca1a21da9a..30c99deb0a8 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTagRename02.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTagRename02.ts @@ -3,7 +3,7 @@ // @allowNonTsExtensions: true // @Filename: jsDocTypedef_form2.js //// -//// /** [|@typedef {(string | number)} [|{| "declarationRangeIndex": 0 |}NumberLike|]|] */ +//// /** [|@typedef {(string | number)} [|{| "contextRangeIndex": 0 |}NumberLike|]|] */ //// //// /** @type {[|NumberLike|]} */ //// var numberLike; diff --git a/tests/cases/fourslash/server/jsdocTypedefTagRename03.ts b/tests/cases/fourslash/server/jsdocTypedefTagRename03.ts index 0540e9963e5..310235bc8e9 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTagRename03.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTagRename03.ts @@ -4,7 +4,7 @@ // @Filename: jsDocTypedef_form3.js //// //// /** -//// * [|@typedef /*1*/[|{| "declarationRangeIndex": 0 |}Person|] +//// * [|@typedef /*1*/[|{| "contextRangeIndex": 0 |}Person|] //// * @type {Object} //// * @property {number} age //// * @property {string} name diff --git a/tests/cases/fourslash/server/rename01.ts b/tests/cases/fourslash/server/rename01.ts index 871a70c763a..66afa70a8e8 100644 --- a/tests/cases/fourslash/server/rename01.ts +++ b/tests/cases/fourslash/server/rename01.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to [|Bar|] in a comment. //// "this is a reference to [|Bar|] in a string" ////}|] diff --git a/tests/cases/fourslash/server/renameInConfiguredProject.ts b/tests/cases/fourslash/server/renameInConfiguredProject.ts index da576bcb30f..f9e567fef04 100644 --- a/tests/cases/fourslash/server/renameInConfiguredProject.ts +++ b/tests/cases/fourslash/server/renameInConfiguredProject.ts @@ -1,7 +1,7 @@ /// // @Filename: referencesForGlobals_1.ts -////[|var [|{| "declarationRangeIndex": 0 |}globalName|] = 0;|] +////[|var [|{| "contextRangeIndex": 0 |}globalName|] = 0;|] // @Filename: referencesForGlobals_2.ts ////var y = [|globalName|]; diff --git a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts index fabe77c53ac..c3bb5fa8428 100644 --- a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts @@ -7,7 +7,7 @@ //// //// } //// -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){ +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|](){ //// return this; //// }|] //// diff --git a/tests/cases/fourslash/shims-pp/getRenameInfo.ts b/tests/cases/fourslash/shims-pp/getRenameInfo.ts index 2595a523f16..3f32093ca14 100644 --- a/tests/cases/fourslash/shims-pp/getRenameInfo.ts +++ b/tests/cases/fourslash/shims-pp/getRenameInfo.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to Bar in a comment. //// "this is a reference to Bar in a string" ////}|] diff --git a/tests/cases/fourslash/shims/getReferencesAtPosition.ts b/tests/cases/fourslash/shims/getReferencesAtPosition.ts index fabe77c53ac..c3bb5fa8428 100644 --- a/tests/cases/fourslash/shims/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims/getReferencesAtPosition.ts @@ -7,7 +7,7 @@ //// //// } //// -//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}start|](){ +//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}start|](){ //// return this; //// }|] //// diff --git a/tests/cases/fourslash/shims/getRenameInfo.ts b/tests/cases/fourslash/shims/getRenameInfo.ts index 2595a523f16..3f32093ca14 100644 --- a/tests/cases/fourslash/shims/getRenameInfo.ts +++ b/tests/cases/fourslash/shims/getRenameInfo.ts @@ -2,7 +2,7 @@ /////// -////[|function [|{| "declarationRangeIndex": 0 |}Bar|]() { +////[|function [|{| "contextRangeIndex": 0 |}Bar|]() { //// // This is a reference to Bar in a comment. //// "this is a reference to Bar in a string" ////}|] diff --git a/tests/cases/fourslash/transitiveExportImports.ts b/tests/cases/fourslash/transitiveExportImports.ts index f492f28862a..4fe92f5a528 100644 --- a/tests/cases/fourslash/transitiveExportImports.ts +++ b/tests/cases/fourslash/transitiveExportImports.ts @@ -1,15 +1,15 @@ /// // @Filename: a.ts -////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] { +////[|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] { ////}|] -////[|export = [|{| "declarationRangeIndex": 2 |}A|];|] +////[|export = [|{| "contextRangeIndex": 2 |}A|];|] // @Filename: b.ts -////[|export import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}b|] = require('./a');|] +////[|export import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}b|] = require('./a');|] // @Filename: c.ts -////[|import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}b|] = require('./b');|] +////[|import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}b|] = require('./b');|] ////var a = new [|b|]./**/[|b|](); goTo.marker(); diff --git a/tests/cases/fourslash/transitiveExportImports2.ts b/tests/cases/fourslash/transitiveExportImports2.ts index 8070ad73e04..387b2e5be19 100644 --- a/tests/cases/fourslash/transitiveExportImports2.ts +++ b/tests/cases/fourslash/transitiveExportImports2.ts @@ -1,16 +1,16 @@ /// // @Filename: a.ts -////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}A|] { +////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}A|] { //// export const x = 0; ////}|] // @Filename: b.ts -////[|export import [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}B|] = [|A|];|] +////[|export import [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}B|] = [|A|];|] ////[|B|].x; // @Filename: c.ts -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}B|] } from "./b";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |}B|] } from "./b";|] verify.noErrors(); diff --git a/tests/cases/fourslash/transitiveExportImports3.ts b/tests/cases/fourslash/transitiveExportImports3.ts index ab8c5e8ca1b..341e57003da 100644 --- a/tests/cases/fourslash/transitiveExportImports3.ts +++ b/tests/cases/fourslash/transitiveExportImports3.ts @@ -1,12 +1,12 @@ /// // @Filename: a.ts -////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|]() {}|] +////[|export function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|]() {}|] // @Filename: b.ts -////[|export { [|{| "declarationRangeIndex": 2 |}f|] as [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}g|] } from "./a";|] -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 5 |}f|] } from "./a";|] -////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 7 |}g|] } from "./b";|] +////[|export { [|{| "contextRangeIndex": 2 |}f|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}g|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 5 |}f|] } from "./a";|] +////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}g|] } from "./b";|] verify.noErrors(); diff --git a/tests/cases/fourslash/tsxFindAllReferences1.ts b/tests/cases/fourslash/tsxFindAllReferences1.ts index f5d0a2e7488..8e48057e4b6 100644 --- a/tests/cases/fourslash/tsxFindAllReferences1.ts +++ b/tests/cases/fourslash/tsxFindAllReferences1.ts @@ -4,14 +4,14 @@ //// declare module JSX { //// interface Element { } //// interface IntrinsicElements { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}div|]: { +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}div|]: { //// name?: string; //// isOpen?: boolean; //// };|] //// span: { n: string; }; //// } //// } -//// var x = [|<[|{| "declarationRangeIndex": 2 |}div|] />|]; +//// var x = [|<[|{| "contextRangeIndex": 2 |}div|] />|]; verify.singleReferenceGroup( `(property) JSX.IntrinsicElements.div: { diff --git a/tests/cases/fourslash/tsxFindAllReferences10.ts b/tests/cases/fourslash/tsxFindAllReferences10.ts index bbef12be7cc..97f58a8dbbc 100644 --- a/tests/cases/fourslash/tsxFindAllReferences10.ts +++ b/tests/cases/fourslash/tsxFindAllReferences10.ts @@ -15,7 +15,7 @@ //// className?: string; //// } //// interface ButtonProps extends ClickableProps { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}onClick|](event?: React.MouseEvent): void;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}onClick|](event?: React.MouseEvent): void;|] //// } //// interface LinkProps extends ClickableProps { //// goTo: string; @@ -25,8 +25,8 @@ //// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element; //// let opt = ; //// let opt = ; -//// let opt = {}}|] />; -//// let opt = {}}|] ignore-prop />; +//// let opt = {}}|] />; +//// let opt = {}}|] ignore-prop />; //// let opt = ; //// let opt = ; diff --git a/tests/cases/fourslash/tsxFindAllReferences2.ts b/tests/cases/fourslash/tsxFindAllReferences2.ts index 4c6dc5a81bf..62de0591ab6 100644 --- a/tests/cases/fourslash/tsxFindAllReferences2.ts +++ b/tests/cases/fourslash/tsxFindAllReferences2.ts @@ -5,12 +5,12 @@ //// interface Element { } //// interface IntrinsicElements { //// div: { -//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}name|]?: string;|] +//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}name|]?: string;|] //// isOpen?: boolean; //// }; //// span: { n: string; }; //// } //// } -//// var x =
; +//// var x =
; verify.singleReferenceGroup("(property) name?: string", "name"); diff --git a/tests/cases/fourslash/tsxFindAllReferences3.ts b/tests/cases/fourslash/tsxFindAllReferences3.ts index 299161bf1f0..d010c65a566 100644 --- a/tests/cases/fourslash/tsxFindAllReferences3.ts +++ b/tests/cases/fourslash/tsxFindAllReferences3.ts @@ -9,11 +9,11 @@ //// } //// class MyClass { //// props: { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}name|]?: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}name|]?: string;|] //// size?: number; //// } //// //// -//// var x = ; +//// var x = ; verify.singleReferenceGroup("(property) name?: string", "name"); diff --git a/tests/cases/fourslash/tsxFindAllReferences4.ts b/tests/cases/fourslash/tsxFindAllReferences4.ts index 38433bb7f21..42a5d44f453 100644 --- a/tests/cases/fourslash/tsxFindAllReferences4.ts +++ b/tests/cases/fourslash/tsxFindAllReferences4.ts @@ -7,13 +7,13 @@ //// } //// interface ElementAttributesProperty { props } //// } -//// [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}MyClass|] { +//// [|class [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}MyClass|] { //// props: { //// name?: string; //// size?: number; //// }|] //// //// -//// var x = [|<[|{| "declarationRangeIndex" : 2 |}MyClass|] name='hello'>|]; +//// var x = [|<[|{| "contextRangeIndex" : 2 |}MyClass|] name='hello'>|]; verify.singleReferenceGroup("class MyClass", "MyClass"); diff --git a/tests/cases/fourslash/tsxFindAllReferences5.ts b/tests/cases/fourslash/tsxFindAllReferences5.ts index 804943ec85d..7921e503dbc 100644 --- a/tests/cases/fourslash/tsxFindAllReferences5.ts +++ b/tests/cases/fourslash/tsxFindAllReferences5.ts @@ -15,12 +15,12 @@ //// propString: string //// optional?: boolean //// } -//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Opt|](attributes: OptionPropBag): JSX.Element;|] -//// let opt = [|<[|{| "declarationRangeIndex": 2 |}Opt|] />|]; -//// let opt1 = [|<[|{| "declarationRangeIndex": 4 |}Opt|] propx={100} propString />|]; -//// let opt2 = [|<[|{| "declarationRangeIndex": 6 |}Opt|] propx={100} optional/>|]; -//// let opt3 = [|<[|{| "declarationRangeIndex": 8 |}Opt|] wrong />|]; -//// let opt4 = [|<[|{| "declarationRangeIndex": 10 |}Opt|] propx={100} propString="hi" />|]; +//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Opt|](attributes: OptionPropBag): JSX.Element;|] +//// let opt = [|<[|{| "contextRangeIndex": 2 |}Opt|] />|]; +//// let opt1 = [|<[|{| "contextRangeIndex": 4 |}Opt|] propx={100} propString />|]; +//// let opt2 = [|<[|{| "contextRangeIndex": 6 |}Opt|] propx={100} optional/>|]; +//// let opt3 = [|<[|{| "contextRangeIndex": 8 |}Opt|] wrong />|]; +//// let opt4 = [|<[|{| "contextRangeIndex": 10 |}Opt|] propx={100} propString="hi" />|]; verify.singleReferenceGroup( "function Opt(attributes: OptionPropBag): JSX.Element", diff --git a/tests/cases/fourslash/tsxFindAllReferences7.ts b/tests/cases/fourslash/tsxFindAllReferences7.ts index c7e916cc8f1..3b82946fd17 100644 --- a/tests/cases/fourslash/tsxFindAllReferences7.ts +++ b/tests/cases/fourslash/tsxFindAllReferences7.ts @@ -11,14 +11,14 @@ //// interface ElementAttributesProperty { props; } //// } //// interface OptionPropBag { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}propx|]: number|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}propx|]: number|] //// propString: string //// optional?: boolean //// } //// declare function Opt(attributes: OptionPropBag): JSX.Element; //// let opt = ; -//// let opt1 = ; -//// let opt2 = ; +//// let opt1 = ; +//// let opt2 = ; //// let opt3 = ; verify.singleReferenceGroup("(property) OptionPropBag.propx: number", "propx"); diff --git a/tests/cases/fourslash/tsxFindAllReferences8.ts b/tests/cases/fourslash/tsxFindAllReferences8.ts index 6dcd94e726b..efed4141230 100644 --- a/tests/cases/fourslash/tsxFindAllReferences8.ts +++ b/tests/cases/fourslash/tsxFindAllReferences8.ts @@ -20,15 +20,15 @@ //// interface LinkProps extends ClickableProps { //// goTo: string; //// } -//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}MainButton|](buttonProps: ButtonProps): JSX.Element;|] -//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}MainButton|](linkProps: LinkProps): JSX.Element;|] -//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;|] -//// let opt = [|<[|{| "declarationRangeIndex": 6 |}MainButton|] />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 8 |}MainButton|] children="chidlren" />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 10 |}MainButton|] onClick={()=>{}} />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 12 |}MainButton|] onClick={()=>{}} ignore-prop />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 14 |}MainButton|] goTo="goTo" />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 16 |}MainButton|] wrong />|]; +//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}MainButton|](buttonProps: ButtonProps): JSX.Element;|] +//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}MainButton|](linkProps: LinkProps): JSX.Element;|] +//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;|] +//// let opt = [|<[|{| "contextRangeIndex": 6 |}MainButton|] />|]; +//// let opt = [|<[|{| "contextRangeIndex": 8 |}MainButton|] children="chidlren" />|]; +//// let opt = [|<[|{| "contextRangeIndex": 10 |}MainButton|] onClick={()=>{}} />|]; +//// let opt = [|<[|{| "contextRangeIndex": 12 |}MainButton|] onClick={()=>{}} ignore-prop />|]; +//// let opt = [|<[|{| "contextRangeIndex": 14 |}MainButton|] goTo="goTo" />|]; +//// let opt = [|<[|{| "contextRangeIndex": 16 |}MainButton|] wrong />|]; verify.singleReferenceGroup( "function MainButton(buttonProps: ButtonProps): JSX.Element (+2 overloads)", diff --git a/tests/cases/fourslash/tsxFindAllReferences9.ts b/tests/cases/fourslash/tsxFindAllReferences9.ts index ba55331d892..99f40cb3325 100644 --- a/tests/cases/fourslash/tsxFindAllReferences9.ts +++ b/tests/cases/fourslash/tsxFindAllReferences9.ts @@ -18,7 +18,7 @@ //// onClick(event?: React.MouseEvent): void; //// } //// interface LinkProps extends ClickableProps { -//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}goTo|]: string;|] +//// [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}goTo|]: string;|] //// } //// declare function MainButton(buttonProps: ButtonProps): JSX.Element; //// declare function MainButton(linkProps: LinkProps): JSX.Element; @@ -27,7 +27,7 @@ //// let opt = ; //// let opt = {}} />; //// let opt = {}} ignore-prop />; -//// let opt = ; +//// let opt = ; //// let opt = ; //// let opt = ; diff --git a/tests/cases/fourslash/tsxFindAllReferencesUnionElementType1.ts b/tests/cases/fourslash/tsxFindAllReferencesUnionElementType1.ts index 60b95f1b43e..2a1301a64f5 100644 --- a/tests/cases/fourslash/tsxFindAllReferencesUnionElementType1.ts +++ b/tests/cases/fourslash/tsxFindAllReferencesUnionElementType1.ts @@ -18,8 +18,8 @@ //// return

World

; //// } -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}SFCComp|] = SFC1 || SFC2;|] -//// [|<[|{| "declarationRangeIndex": 2 |}SFCComp|] x={ "hi" } />|] +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}SFCComp|] = SFC1 || SFC2;|] +//// [|<[|{| "contextRangeIndex": 2 |}SFCComp|] x={ "hi" } />|] verify.singleReferenceGroup(`var SFCComp: ((prop: { x: number; diff --git a/tests/cases/fourslash/tsxFindAllReferencesUnionElementType2.ts b/tests/cases/fourslash/tsxFindAllReferencesUnionElementType2.ts index cb4151aa3c5..684be599072 100644 --- a/tests/cases/fourslash/tsxFindAllReferencesUnionElementType2.ts +++ b/tests/cases/fourslash/tsxFindAllReferencesUnionElementType2.ts @@ -17,7 +17,7 @@ //// private method() { } //// } -//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}RCComp|] = RC1 || RC2;|] -//// [|<[|{| "declarationRangeIndex": 2 |}RCComp|] />|] +//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}RCComp|] = RC1 || RC2;|] +//// [|<[|{| "contextRangeIndex": 2 |}RCComp|] />|] verify.singleReferenceGroup("var RCComp: typeof RC1", "RCComp"); diff --git a/tests/cases/fourslash/tsxRename1.ts b/tests/cases/fourslash/tsxRename1.ts index e16c390f4e5..23deda61fff 100644 --- a/tests/cases/fourslash/tsxRename1.ts +++ b/tests/cases/fourslash/tsxRename1.ts @@ -4,12 +4,12 @@ //// declare module JSX { //// interface Element { } //// interface IntrinsicElements { -//// [|[|{| "declarationRangeIndex": 0 |}div|]: { +//// [|[|{| "contextRangeIndex": 0 |}div|]: { //// name?: string; //// isOpen?: boolean; //// };|] //// span: { n: string; }; //// } //// } -//// var x = [|<[|{| "declarationRangeIndex": 2 |}div|] />|]; +//// var x = [|<[|{| "contextRangeIndex": 2 |}div|] />|]; verify.rangesWithSameTextAreRenameLocations("div"); diff --git a/tests/cases/fourslash/tsxRename2.ts b/tests/cases/fourslash/tsxRename2.ts index c6cb9d16ca8..8cbb2b473ee 100644 --- a/tests/cases/fourslash/tsxRename2.ts +++ b/tests/cases/fourslash/tsxRename2.ts @@ -5,12 +5,12 @@ //// interface Element { } //// interface IntrinsicElements { //// div: { -//// [|[|{| "declarationRangeIndex": 0 |}name|]?: string;|] +//// [|[|{| "contextRangeIndex": 0 |}name|]?: string;|] //// isOpen?: boolean; //// }; //// span: { n: string; }; //// } //// } -//// var x =
; +//// var x =
; verify.rangesWithSameTextAreRenameLocations("name"); diff --git a/tests/cases/fourslash/tsxRename3.ts b/tests/cases/fourslash/tsxRename3.ts index c7c68abfa00..cb190f7d599 100644 --- a/tests/cases/fourslash/tsxRename3.ts +++ b/tests/cases/fourslash/tsxRename3.ts @@ -9,11 +9,11 @@ //// } //// class MyClass { //// props: { -//// [|[|{| "declarationRangeIndex": 0 |}name|]?: string;|] +//// [|[|{| "contextRangeIndex": 0 |}name|]?: string;|] //// size?: number; //// } //// //// -//// var x = ; +//// var x = ; verify.rangesWithSameTextAreRenameLocations("name"); diff --git a/tests/cases/fourslash/tsxRename4.ts b/tests/cases/fourslash/tsxRename4.ts index f9c33972ecd..cb561019c59 100644 --- a/tests/cases/fourslash/tsxRename4.ts +++ b/tests/cases/fourslash/tsxRename4.ts @@ -9,12 +9,12 @@ //// div: {}; //// } ////} -////[|class [|{| "declarationRangeIndex": 0 |}MyClass|] {}|] +////[|class [|{| "contextRangeIndex": 0 |}MyClass|] {}|] //// -////[|<[|{| "declarationRangeIndex": 2 |}MyClass|]>|]; -////[|<[|{| "declarationRangeIndex": 5 |}MyClass|]/>|]; +////[|<[|{| "contextRangeIndex": 2 |}MyClass|]>|]; +////[|<[|{| "contextRangeIndex": 5 |}MyClass|]/>|]; //// -////[|<[|{| "declarationRangeIndex": 7 |}div|]> |] +////[|<[|{| "contextRangeIndex": 7 |}div|]> |] verify.noErrors(); verify.rangesWithSameTextAreRenameLocations("MyClass", "div"); \ No newline at end of file diff --git a/tests/cases/fourslash/tsxRename5.ts b/tests/cases/fourslash/tsxRename5.ts index 953e950e6a6..0edc6f4f0db 100644 --- a/tests/cases/fourslash/tsxRename5.ts +++ b/tests/cases/fourslash/tsxRename5.ts @@ -13,7 +13,7 @@ //// size?: number; //// } //// -//// [|var [|{| "declarationRangeIndex": 0 |}nn|]: string;|] +//// [|var [|{| "contextRangeIndex": 0 |}nn|]: string;|] //// var x = ; verify.rangesWithSameTextAreRenameLocations("nn"); diff --git a/tests/cases/fourslash/tsxRename6.ts b/tests/cases/fourslash/tsxRename6.ts index 320f3e6ac6b..8c8d252bb00 100644 --- a/tests/cases/fourslash/tsxRename6.ts +++ b/tests/cases/fourslash/tsxRename6.ts @@ -15,11 +15,11 @@ //// propString: string //// optional?: boolean //// } -//// [|declare function [|{| "declarationRangeIndex": 0 |}Opt|](attributes: OptionPropBag): JSX.Element;|] -//// let opt = [|<[|{| "declarationRangeIndex": 2 |}Opt|] />|]; -//// let opt1 = [|<[|{| "declarationRangeIndex": 4 |}Opt|] propx={100} propString />|]; -//// let opt2 = [|<[|{| "declarationRangeIndex": 6 |}Opt|] propx={100} optional/>|]; -//// let opt3 = [|<[|{| "declarationRangeIndex": 8 |}Opt|] wrong />|]; -//// let opt4 = [|<[|{| "declarationRangeIndex": 10 |}Opt|] propx={100} propString="hi" />|]; +//// [|declare function [|{| "contextRangeIndex": 0 |}Opt|](attributes: OptionPropBag): JSX.Element;|] +//// let opt = [|<[|{| "contextRangeIndex": 2 |}Opt|] />|]; +//// let opt1 = [|<[|{| "contextRangeIndex": 4 |}Opt|] propx={100} propString />|]; +//// let opt2 = [|<[|{| "contextRangeIndex": 6 |}Opt|] propx={100} optional/>|]; +//// let opt3 = [|<[|{| "contextRangeIndex": 8 |}Opt|] wrong />|]; +//// let opt4 = [|<[|{| "contextRangeIndex": 10 |}Opt|] propx={100} propString="hi" />|]; verify.rangesWithSameTextAreRenameLocations("Opt"); diff --git a/tests/cases/fourslash/tsxRename7.ts b/tests/cases/fourslash/tsxRename7.ts index 13b16cf0ba5..8e23a7edef4 100644 --- a/tests/cases/fourslash/tsxRename7.ts +++ b/tests/cases/fourslash/tsxRename7.ts @@ -11,14 +11,14 @@ //// interface ElementAttributesProperty { props; } //// } //// interface OptionPropBag { -//// [|[|{| "declarationRangeIndex": 0 |}propx|]: number|] +//// [|[|{| "contextRangeIndex": 0 |}propx|]: number|] //// propString: string //// optional?: boolean //// } //// declare function Opt(attributes: OptionPropBag): JSX.Element; //// let opt = ; -//// let opt1 = ; -//// let opt2 = ; +//// let opt1 = ; +//// let opt2 = ; //// let opt3 = ; verify.rangesWithSameTextAreRenameLocations("propx"); diff --git a/tests/cases/fourslash/tsxRename9.ts b/tests/cases/fourslash/tsxRename9.ts index 0aa8ef8345f..0818c61cd73 100644 --- a/tests/cases/fourslash/tsxRename9.ts +++ b/tests/cases/fourslash/tsxRename9.ts @@ -15,20 +15,20 @@ //// className?: string; //// } //// interface ButtonProps extends ClickableProps { -//// [|[|{| "declarationRangeIndex": 0 |}onClick|](event?: React.MouseEvent): void;|] +//// [|[|{| "contextRangeIndex": 0 |}onClick|](event?: React.MouseEvent): void;|] //// } //// interface LinkProps extends ClickableProps { -//// [|[|{| "declarationRangeIndex": 2 |}goTo|]: string;|] +//// [|[|{| "contextRangeIndex": 2 |}goTo|]: string;|] //// } -//// [|declare function [|{| "declarationRangeIndex": 4 |}MainButton|](buttonProps: ButtonProps): JSX.Element;|] -//// [|declare function [|{| "declarationRangeIndex": 6 |}MainButton|](linkProps: LinkProps): JSX.Element;|] -//// [|declare function [|{| "declarationRangeIndex": 8 |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;|] -//// let opt = [|<[|{| "declarationRangeIndex": 10 |}MainButton|] />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 12 |}MainButton|] children="chidlren" />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 14 |}MainButton|] [|[|{| "declarationRangeIndex": 16 |}onClick|]={()=>{}}|] />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 18 |}MainButton|] [|[|{| "declarationRangeIndex": 20 |}onClick|]={()=>{}}|] [|ignore-prop|] />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 23 |}MainButton|] [|[|{| "declarationRangeIndex": 25 |}goTo|]="goTo"|] />|]; -//// let opt = [|<[|{| "declarationRangeIndex": 27 |}MainButton|] [|wrong|] />|]; +//// [|declare function [|{| "contextRangeIndex": 4 |}MainButton|](buttonProps: ButtonProps): JSX.Element;|] +//// [|declare function [|{| "contextRangeIndex": 6 |}MainButton|](linkProps: LinkProps): JSX.Element;|] +//// [|declare function [|{| "contextRangeIndex": 8 |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;|] +//// let opt = [|<[|{| "contextRangeIndex": 10 |}MainButton|] />|]; +//// let opt = [|<[|{| "contextRangeIndex": 12 |}MainButton|] children="chidlren" />|]; +//// let opt = [|<[|{| "contextRangeIndex": 14 |}MainButton|] [|[|{| "contextRangeIndex": 16 |}onClick|]={()=>{}}|] />|]; +//// let opt = [|<[|{| "contextRangeIndex": 18 |}MainButton|] [|[|{| "contextRangeIndex": 20 |}onClick|]={()=>{}}|] [|ignore-prop|] />|]; +//// let opt = [|<[|{| "contextRangeIndex": 23 |}MainButton|] [|[|{| "contextRangeIndex": 25 |}goTo|]="goTo"|] />|]; +//// let opt = [|<[|{| "contextRangeIndex": 27 |}MainButton|] [|wrong|] />|]; verify.rangesWithSameTextAreRenameLocations( "onClick", diff --git a/tests/cases/fourslash/untypedModuleImport.ts b/tests/cases/fourslash/untypedModuleImport.ts index 72452fac0ae..2e06c45107e 100644 --- a/tests/cases/fourslash/untypedModuleImport.ts +++ b/tests/cases/fourslash/untypedModuleImport.ts @@ -4,7 +4,7 @@ ////{} // @Filename: a.ts -////[|import /*foo*/[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}foo|] from /*fooModule*/"[|{| "isInString": true, "declarationRangeIndex": 0 |}foo|]";|] +////[|import /*foo*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}foo|] from /*fooModule*/"[|{| "isInString": true, "contextRangeIndex": 0 |}foo|]";|] ////[|foo|](); goTo.file("a.ts");