[@typescript/api] Batch of Checker and Type APIs#2831
Draft
andrewbranch wants to merge 2 commits intomicrosoft:mainfrom
Draft
[@typescript/api] Batch of Checker and Type APIs#2831andrewbranch wants to merge 2 commits intomicrosoft:mainfrom
andrewbranch wants to merge 2 commits intomicrosoft:mainfrom
Conversation
- Add Symbol methods: getParent, getMembers, getExports - Add Type method: getSymbol - Add Signature type with flags, declaration, parameters, target - Add Checker methods: getSignaturesOfType, getTypeAtLocation, getTypeAtPosition - Add SignatureKind and SignatureFlags enums (.enum.ts pattern) - Fix RemoteSourceFile.id to use node handle format (pos.end.kind.path) - Remove unused base64 node id from binary encoder - Fix GetSymbolAtLocation to handle SourceFile nodes (remove early parent check) - Add comprehensive sync and async client tests
- Add 11 type sub-property endpoints (getTargetOfType, getTypesOfType, getTypeParametersOfType, etc.) to Go server and TS client - Add getDeclaredTypeOfSymbol endpoint for retrieving declared types of type alias symbols (vs getTypeOfSymbol which returns value types) - Add fetchType/fetchTypes helpers to TypeObject for lazy resolution of type handles with local cache support via ObjectRegistry.tryGetType - Remove handle-typed properties from public type interfaces, keeping handles as wire-format fields for client-side cache optimization - Rename tupleReadonly to readonly across Go JSON tags and TS interfaces - Add comprehensive tests for all type sub-property fetchers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checker query methods:
getDeclaredTypeOfSymbolgetTypeAtLocation/getTypeAtLocationsgetTypeAtPosition/getTypesAtPositionsgetSignaturesOfTypegetContextualTypegetBaseTypeOfLiteralTypegetShorthandAssignmentValueSymbolgetTypeOfSymbolAtLocationIntrinsic type getters:
getAnyType,getStringType,getNumberType,getBooleanType,getVoidType,getUndefinedType,getNullType,getNeverType,getUnknownType,getBigIntType,getESSymbolTypeSymbol property fetchers:
getMembers,getExports,getParentType hierarchy:
Type— base type (id,flags,getSymbol())LiteralType— string/number/bigint/boolean literals (value)ObjectType— object types (objectFlags)TypeReference— e.g.Array<string>(getTarget())InterfaceType— classes and interfaces (getTypeParameters(),getOuterTypeParameters(),getLocalTypeParameters())TupleType— tuple types (elementFlags,fixedLength,readonly)UnionOrIntersectionType— (getTypes())UnionTypeIntersectionTypeTypeParameterIndexType—keyof T(getTarget())IndexedAccessType—T[K](getObjectType(),getIndexType())ConditionalType—T extends U ? X : Y(getCheckType(),getExtendsType())SubstitutionType— (getBaseType(),getConstraint())TemplateLiteralType— template literals (texts,getTypes())StringMappingType—Uppercase<T>etc. (getTarget())New enums/flags exposed:
ObjectFlags,ElementFlags,SignatureFlags,SignatureKind