Skip to content

Commit

Permalink
Merge branch 'main' into feat/value-expression
Browse files Browse the repository at this point in the history
  • Loading branch information
bterlson authored Jan 15, 2025
2 parents 0a5a638 + 90fd943 commit 5566704
Show file tree
Hide file tree
Showing 6 changed files with 1,269 additions and 648 deletions.
27 changes: 14 additions & 13 deletions packages/core/src/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,12 @@ export interface Binder {
): Ref<TScope | undefined>;

/**
* Resolve a fully qualified name to a symbol. The syntax for a fully
* qualified name is as follows:
* Resolve a fully qualified name to a symbol. Access a nested scope by name
* with `::`, a nested static member with `.` and a nested instance member
* with `#`.
*
* * `::` accesses a nested scope
* * `.` accesses a nested static member
* * `#` accesses a nested instance member
*
* Per-language packages may provide their own resolveFQN function
* that uses syntax more natural to that language.
* Per-language packages may provide their own resolveFQN function that uses
* syntax more natural to that language.
*/
resolveFQN<
TScope extends OutputScope = OutputScope,
Expand Down Expand Up @@ -365,11 +362,15 @@ export interface Binder {
* When we resolve the refkey for `bar` from within `namespace scope 2`, we will get the following
* resolution result:
*
* * **targetDeclaration**: symbol bar, the symbol we resolved.
* * **commonScope**: global scope, because this is the most specific scope that contains both the declaration and the reference.
* * **pathUp**: [namespace scope 2], because this is the scope between the reference and the common scope.
* * **pathDown**: [namespace scope 1], because this is the scope between the common scope and the declaration
* * **memberPath**: [foo, bar], because we resolved a member symbol and these are the symbols that lead from the base declaration to the member symbol.
* **targetDeclaration**: symbol bar, the symbol we resolved.
*
* **commonScope**: global scope, because this is the most specific scope that contains both the declaration and the reference.
*
* **pathUp**: [namespace scope 2], because this is the scope between the reference and the common scope.
*
* **pathDown**: [namespace scope 1], because this is the scope between the common scope and the declaration
*
* **memberPath**: [foo, bar], because we resolved a member symbol and these are the symbols that lead from the base declaration to the member symbol.
*/
export interface ResolutionResult<
TScope extends OutputScope,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/components/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ export function Output(props: OutputProps) {
}

return <BinderContext.Provider value={binder}>
{() => { extensionEffects.forEach(e => e())}}
{
{() => { extensionEffects.forEach(e => e())}}{
props.namePolicy ?
<NamePolicyContext.Provider value={props.namePolicy}>
{dir}
Expand Down
15 changes: 0 additions & 15 deletions packages/core/test/components/source-file.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,3 @@ it("can change its indent level", () => {
indented
`);
});

it.only("does things", () => {
function DebugMe() {
debug.component.stack();
}

const tree = render(
<Output>
<SourceFile path="hi.txt" filetype="text">
base
<DebugMe />
</SourceFile>
</Output>,
);
});
12 changes: 6 additions & 6 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.27.0",
"astro": "^4.15.3",
"@astrojs/check": "^0.9.4",
"@astrojs/starlight": "^0.31.0",
"astro": "^5.1.6",
"astro-expressive-code": "^0.36.1",
"sharp": "^0.32.5",
"typescript": "^5.5.4"
},
"devDependencies": {
"@alloy-js/core": "workspace:~",
"@alloy-js/csharp": "workspace:~",
"@alloy-js/java": "workspace:~",
"@alloy-js/typescript": "workspace:~",
"@microsoft/api-extractor": "^7.47.7",
"@microsoft/api-extractor-model": "^7.29.6",
"@microsoft/tsdoc": "^0.15.0",
"@alloy-js/typescript": "workspace:~",
"@alloy-js/java": "workspace:~",
"@alloy-js/csharp": "workspace:~",
"redent": "^4.0.0"
}
}
16 changes: 9 additions & 7 deletions packages/docs/scripts/components/InterfaceMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ export function InterfaceMembers(props: InterfaceMembersProps) {
<td>\`(${method.parameters
.map((param) => param.parameterTypeExcerpt.text)
.join(", ")}) => ${method.returnTypeExcerpt.text}\`</td>
<td>${
method.tsdocComment?.summarySection &&
TsDoc({
node: method.tsdocComment.summarySection,
context: method,
})
}</td>
<td>
${
method.tsdocComment?.summarySection &&
TsDoc({
node: method.tsdocComment.summarySection,
context: method,
})
}
</td>
</tr>
`;
}
Expand Down
Loading

0 comments on commit 5566704

Please sign in to comment.