nobuhito / vscode.printcode

PrintCode added printing function to VS Code!!
https://marketplace.visualstudio.com/items?itemName=nobuhito.printcode
MIT License
73 stars 26 forks source link

Print mode for shell scripts does not work #30

Open ray-yin opened 5 years ago

ray-yin commented 5 years ago

mode equals undefined when printing shell scripts. Looking through the source, the issue lies in how VS Code reports back the languageId.

VS Code uses shellscript for the languageId while CodeMirror expects it to be shell. This mismatch causes the language to be returned as undefined.

Adding the following in funcs.js after line 3 fixes the immediate issue but I'm sure there are other languages with similar mapping issues:

  if (language == 'shellscript') {
    language = 'shell';
  }

Let me know if you want me to submit a PR for this fix.