Skip to content

Commit

Permalink
feat(plugin/ts): error querying version match
Browse files Browse the repository at this point in the history
  • Loading branch information
RSS1102 committed Dec 2, 2023
1 parent 37a8da3 commit c8f722a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/plugins/typescript/statusbar/Versions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ export const Versions: React.ComponentType<BarItemProps<TypeScriptPluginX['ExtSh
</>))
}
if ('text' in result) {
// TODO resolve this case
console.log('text', result)
const matchVersion = suggestedVersions.filter(({ id }) => id.includes(result.text))
matchVersion.length > 0
? onChange?.(matchVersion[0]?.value.toString())
: messenger.then(m => m.display('error', <>
<h3>Invalid TypeScript Version</h3>
<p>Version <code>{matchVersion[0]?.id}</code> is not available.</p>
{/* TODO support help jump */}
<p>Click <a href='/TODO'>it</a> and find help.</p>
</>))
}
} catch (e) {
console.error(e)
Expand Down

0 comments on commit c8f722a

Please sign in to comment.