-
Notifications
You must be signed in to change notification settings - Fork 23
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
Static type inspection. #156
Conversation
|
||
export type TriedType = Result<Type.TType, CommonError.CommonError>; | ||
|
||
export function tryScopeType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns typing for each item in the given scope.
return ResultUtils.ensureResult(getLocalizationTemplates(settings.locale), () => inspectScopeType(state, nodeId)); | ||
} | ||
|
||
export function tryType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns typing for a single node.
@@ -141,6 +112,103 @@ export function letKeyValuePairs( | |||
return maybeArrayWrapper === undefined ? [] : keyValuePairs(nodeIdMapCollection, maybeArrayWrapper); | |||
} | |||
|
|||
export function fieldProjectionFieldSelectors( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several new helper functions for iterating over TXorNodes.
@@ -735,7 +735,7 @@ export function readRecursivePrimaryExpression<S extends IParserState = IParserS | |||
const recursiveArrayNodeKind: Ast.NodeKind.ArrayWrapper = Ast.NodeKind.ArrayWrapper; | |||
IParserStateUtils.startContext(state, recursiveArrayNodeKind); | |||
|
|||
const recursiveExpressions: Ast.TRecursivePrimaryExpression[] = []; | |||
const recursiveExpressions: (Ast.InvokeExpression | Ast.ItemAccessExpression | Ast.TFieldAccessExpression)[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stricter typing.
@@ -1368,7 +1370,7 @@ export function readFieldSpecificationList<S extends IParserState = IParserState | |||
); | |||
const fields: Ast.ICsv<Ast.FieldSpecification>[] = []; | |||
let continueReadingValues: boolean = true; | |||
let maybeOpenRecordMarkerConstant: Ast.IConstant<Ast.MiscConstantKind.Ellipsis> | undefined = undefined; | |||
let isOnOpenRecordMarker: boolean = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix where the open record constant marked as the child of the inccorrect node.
@@ -93,95 +107,3 @@ function functionParameterXorNodes( | |||
? [] | |||
: NodeIdMapIterator.arrayWrapperCsvXorNodes(nodeIdMapCollection, maybeWrappedContent); | |||
} | |||
|
|||
function examineParameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to TypeUtils
Extends the existing POC for static type inspection.