-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added members to BscType
, and adds ReferenceType (future lookups)
#794
Merged
markwpearce
merged 7 commits into
rokucommunity:typing-phase1
from
markwpearce:bsctypes_have_members
Apr 20, 2023
Merged
Added members to BscType
, and adds ReferenceType (future lookups)
#794
markwpearce
merged 7 commits into
rokucommunity:typing-phase1
from
markwpearce:bsctypes_have_members
Apr 20, 2023
Conversation
This file contains 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
markwpearce
commented
Apr 19, 2023
markwpearce
commented
Apr 19, 2023
markwpearce
commented
Apr 19, 2023
TwitchBronBron
approved these changes
Apr 20, 2023
TwitchBronBron
added a commit
that referenced
this pull request
Jun 6, 2023
* Add abstract TypeExpression class * Convert type tokens to TypeExpressions (#785) * Convert type tokens to TypeExpressions * Fixed all tests * Rebased and fixed any other merge issues * Further work on SymbolTypeFlags * Lint fixes * Fixed issue with using enums as variables * Uses complete TypeName as Custom type for TypeExpression.getType() * Removed commented out code, fixed tests * Fixes from PR review * Fixed lint issues --------- Co-authored-by: Mark Pearce <[email protected]> * Removes Parsetime Static Type Setting (#791) * Refactors statically set type to use a function * Lint fixes * Removed symbolTable getter from function scope - not used * Adds ReferenceType (#792) * Added ReferenceType and some tests * Added scope linking for hovers * Removed catch in try/finally in hoverprocessor * Reverted typo * Removed commented out code * Changed to using Proxy, fixed circular references * Fixed lint, added proper isReferencetype reflection * Added members to `BscType`, and adds ReferenceType (future lookups) (#794) * Large update to move BscType to a class and add ReferenceTypes * Fixes validation errors when calling a dynamicType like a function * Correctly resolves return types after a function call. * Removed some commented out or dead code * Fixed build errors * BscType.symbolTable -> memberTable, PropertyReferenceType->TypePropertyReferenceType * Fixed test that should fail * Fix enum transpile crash * Refactored `getType` to correctly use `SymbolTypeFlags` (#798) * Fixed issues with namespaces and invalid things being used as types * Removed unneeded method * Ran npm install with latest code * Removed commented and vestigal code, and added TODOs * Removed additional commented code * ClassType and InterfaceType refactor and Inheritance (#800) * Changed CustomType to ClassType * Adds BscType.equals(), and ClassType tests for inheritance * Fixes issue when looking for members of classes with supertypes that were originally ReferenceTypes * Rerfactor of InterfaceStatement and InetrfaceType work more similar to Classes * Added tests, changed parentClass/Interface to use TypeExpression * Fixes issue when classes and namespaces extend from a namespaced parent * Changes from code review * Type chain refactor (#802) * Changed getType() methods to use an options parameter * Refactors getType() to add opttions, and can find all the types in a chain of types * Fixed lint errors * Updated Tests * Update src/interfaces.ts Co-authored-by: Bronley Plumb <[email protected]> * name change --------- Co-authored-by: Bronley Plumb <[email protected]> * Adds Union types (#803) * initial commit * Adds UnionType and associated tests * Added helper functions to get the most general type from a list of types, including Union types * Started working on Uniontype.membersTypes * Started working on Uniontype.membersTypes * Refactor of types to use instead of * Fixed lint errors * Reverted benchmark package changes * Removes `NamespacedVariableNamedExpressions` (#801) * Removes NamespacedVariabledNamedExpressions * Fixed rest of tests * Fixes ignored parameter value in Parser.identifyingExpression * UnionType Improvements (#806) * Reworked type uniqness checking * Changed logic of InterfaceType.isEqual * Able to get member types from a UnionType * Fixed lint errors * Starting to add UnionExpression and parsing * Added pipe token * Added test for if inner type does not include member in UnionType.getMmeberTypes * Updated UnionExpression transpile logic * Re-added whitespace * removed pipe in favor of 'or' for declaring/displaying union types * Fix lint/build issues * TypeExpressions more narrowly look for what they can accept * Whitespace and typo fixes * Adds unionType validation tests and allows uniontypes innertypes to be late defined * fixed lint error * Fixes issue with ReferenceTypes not displaying a full name * Fix self references in unions (#808) * Fixes issue with self-referencing symbols in unions * Fixed lint error * Type performance improvements (#811) * Fixes issue with self-referencing symbols in unions * Fixed lint error * Starting performance benchmarking * Starting performance benchmarking * getType -> ZgetType() * Reverse getType removal * Removes double validation in ScopeValidator * Trying out type caching * Some benchmark thing * Removes TypeCache * Made the in typeExpression function more robust * Removed unneeded code * removed bad imports * Fixes issue with potential crash when checking types * Adds `enableTypeValidation` flag and documentation (#812) * Added bsConfig option for enhancedTypingValidation * Reverted any benchmark changes * Added docs for 'enhancedTypingValidation' option * Adds documentation * In an effort to increase non-enhancedtypeValidation, old methods were re-added to short circuit getType() calls * Changed flag to enableTypeValidation * Fixed docs * Fixed readme formatting * Fixes from PR review * Adds SymbolTable.getSymbolType() to wrap caching and ReferenceType creation (#813) * Adds SymbolTable.getSymbolType() to wrap caching and ReferenceType creation * Removed commented out code * Add SymbolTable exports for plugins, etc * Added exports from ./types * Adds Type Casting (#814) * Adds TypeCastExpression * Adds TypeCast expression * fix lint issue --------- Co-authored-by: Bronley Plumb <[email protected]> --------- Co-authored-by: Mark Pearce <[email protected]> Co-authored-by: Mark Pearce <[email protected]>
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.
Members of a type are possible symbols that can be referenced after the 'dot' ... eg, a class's fields and methods
ReferenceType
(andPropertyReferenceType
)ReferenceType
is a Proxy for a type that will be established later. eg. a Class that is defined later in the code (or in a different file), or a Namespace that hasn't been walked in the AST yet.PropertyReferenceType
is used when we need to accessreturnType
on a BscType, but we're not sure if the type has been defined yet.Changes the
getType()
method of many Statements and Expressions so that the result is more accurate.Eg. On
DottedGetExpression.getType()
, the expression is "walked back" and the code takes into account the type'sgetMemberType
method to find the correct type of code like(new NameSpaceA.Klass()).method().property
Adds
NamespaceType
andEnumType
sogetMemberType
can be called on them.