Skip to content

Commit

Permalink
fix: regex match to show decl schema string (#3189)
Browse files Browse the repository at this point in the history
This fixes the 2 issues we saw this morning:
* `compliance.Case` showed the schema for `compliance.CaseToken` instead
of its own
* `typealias` decl pages don't show the schema at all
  • Loading branch information
deniseli authored Oct 25, 2024
1 parent 8e83180 commit 42bf1d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/console/src/features/modules/decls/DeclPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const DeclPanel = () => {
return <SubscriptionPanel {...commonProps} value={decl as Subscription} />
case 'topic':
return <TopicPanel {...commonProps} value={decl as Topic} />
case 'typeAlias':
case 'typealias':
return <TypeAliasPanel {...commonProps} value={decl as TypeAlias} />
case 'verb':
return <VerbPage {...nameProps} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function declFromModuleSchemaString(declName: string, schema: string) {
}

function findDeclLinkIdx(declName: string, lines: string[]) {
const regex = new RegExp(`^ (export )?\\w+ ${declName}`)
const regex = new RegExp(`^ (export )?\\w+ ${declName}[ (<:]`)
const foundIdx = lines.findIndex((line) => line.match(regex))
if (foundIdx !== -1) {
return foundIdx
Expand Down

0 comments on commit 42bf1d8

Please sign in to comment.