- Notifications
You must be signed in to change notification settings - Fork669
feat: Add 'show solution' in editor context menu & code lens#313
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
return; | ||
} | ||
const language: string | undefined = await fetchProblemLanguage(); |
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.
We could utilize file extension (path.extName()
) andshared.ts/langExt
to determine the language, thus no need for re-selecting the language when showing solution from the code:
exportconstlangExt:Map<string,string>=newMap([["bash","sh"],["c","c"],["cpp","cpp"],["csharp","cs"],["golang","go"],["java","java"],["javascript","js"],["kotlin","kt"],["mysql","sql"],["php","php"],["python","py"],["python3","py"],["ruby","rb"],["rust","rs"],["scala","scala"],["swift","swift"],]);
(Yet this choice comes with a risk: currently showing solution for languages like scala has a high probability to fail. This feature could be added in later PR when logic of solution plugin is improved.)
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.
another rick is that it's hard to differentiate py3 & py2 from theextName
Resolve#269
Need to release cli first.