Skip to content

Conversation

@jdneo
Copy link
Member

@jdneo jdneo commented May 8, 2019

Resolve #269

demo

Need to release cli first.

@jdneo jdneo added this to the 0.14.2 milestone May 8, 2019
@jdneo jdneo requested review from Vigilans and poppinlp May 8, 2019 11:48
return;
}

const language: string | undefined = await fetchProblemLanguage();
Copy link
Contributor

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()) and shared.ts/langExt to determine the language, thus no need for re-selecting the language when showing solution from the code:

export const langExt: Map<string, string> = new Map([
    ["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.)

Copy link
Member Author

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 the extName

@jdneo jdneo merged commit 4ad07a8 into master May 10, 2019
@jdneo jdneo deleted the cs/solution branch May 10, 2019 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "show top solution" item to the right click menu, pls

3 participants