-
Notifications
You must be signed in to change notification settings - Fork 14
chore: added Cursor to the extensions page #504
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
base: main
Are you sure you want to change the base?
Conversation
… will be available soon).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Cursor extension in this repo: Please clone it from my repo and make it available. |
src/app/[locale]/authorize/page.tsx
Outdated
| const loginUrl = | ||
| editor == "vscode" | ||
| ? `/login?redirect=${encodeURIComponent("/authorize?editor=vscode")}` | ||
| : editor == "" |
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.
Should it be cursor instead?
| : editor == "" | |
| : editor == "cursor" |
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.
Also could use something like this so it's easier to extend in the future
const loginUrls = new Map(Object.entries({
vscode: `/login?redirect=${encodeURIComponent("/authorize?editor=vscode")}`,
cursor: `/login?redirect=${encodeURIComponent("/authorize?editor=cursor")}`
}))
const loginUrl = loginUrls.get(editor)
if (loginUrl === undefined) {
// Make this prettier
return <div>Unsupported editor</div>
}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.
it would be better in my opinion.
src/app/[locale]/extensions/page.tsx
Outdated
| <ExtensionBlock | ||
| logo="/images/cursor.svg" | ||
| alt="Cursor logo" | ||
| downloadLink="https://marketplace.visualstudio.com/items?itemName=testausserveri-ry.testaustime" |
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.
This is the VS Code extension
| logo="/images/cursor.svg" | ||
| alt="Cursor logo" | ||
| downloadLink="https://marketplace.visualstudio.com/items?itemName=testausserveri-ry.testaustime" | ||
| sourceCodeLink="https://github.com/Testausserveri/testaustime-cursor" |
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.
Is the repo in process of being moved under Testaustime (or at least Testausserveri) organization? At least I didn't see any messages in Discord about that
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.
yes. we'll talk about that in discord.
src/app/[locale]/authorize/page.tsx
Outdated
|
|
||
| const { username } = me; | ||
|
|
||
| const editorName = editor == "vscode" ? "Visual Studio Code" : "Cursor"; |
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.
Similar change here as I commented above
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.
yeah. that wasn't better thing, but I did that anyway.
src/app/[locale]/authorize/page.tsx
Outdated
| href={`vscode://testausserveri-ry.testaustime/authorize?token=${token}`} | ||
| href={ | ||
| editor == "vscode" | ||
| ? `vscode://testausserveri-ry.testaustime/authorize?token=${token}` |
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.
And here too
src/app/[locale]/authorize/page.tsx
Outdated
| <Button | ||
| component="a" | ||
| href={`vscode://testausserveri-ry.testaustime/authorize?token=${token}`} | ||
| href={loginUrl} |
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.
This is not correct, loginUrl is a path in the frontend, not a path in the extension. You need to create a new map for the extension urls too.
src/app/[locale]/authorize/page.tsx
Outdated
|
|
||
| if (loginUrl === undefined) { | ||
| // Make this prettier | ||
| return <div>Unsupported editor</div>; |
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.
Add translation
src/app/[locale]/authorize/page.tsx
Outdated
| const editorName = editorNames.get(editor ?? "vscode"); | ||
|
|
||
| if (editorName === undefined) { | ||
| return <div>Invalid editor</div>; |
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.
This should be the same text as above, with translation
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.
ok. it should be fixed now.
Cursor support added for Testaustime extension. I made this modification because VS Code is not the only code editor in the market. There's is plenty of them out there. Nothing else to add here.