microsoft / vscode-generator-code

Visual Studio Code extension generator
Other
1.29k stars 222 forks source link

Reference Error when converting language #37

Closed ChrisJefferson closed 7 years ago

ChrisJefferson commented 8 years ago

I am trying to convert https://github.com/ChrisJefferson/gap-tmbundle, which I have previously successfully converted to atom.

When running it through yo code, I get the following backtrace:

events.js:154
      throw er; // Unhandled 'error' event
      ^

ReferenceError: /usr/local/lib/node_modules/generator-code/generators/app/templates/ext-language/package.json:22
    20|         "grammars": [{
    21|             "language": <%- JSON.stringify(languageId) %>,
 >> 22|             "scopeName": <%- JSON.stringify(languageScopeName) %>,
    23|             "path": <%- JSON.stringify("./syntaxes/" + languageId + ".tmLanguage") %>
    24|         }]
    25|     }

languageScopeName is not defined
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/generator-code/node_modules/ejs/lib/ejs.js:485:12), <anonymous>:43:31)
    at returnedFn (/usr/local/lib/node_modules/generator-code/node_modules/ejs/lib/ejs.js:514:17)
    at Object.exports.render (/usr/local/lib/node_modules/generator-code/node_modules/ejs/lib/ejs.js:316:37)
    at copy.process (/usr/local/lib/node_modules/generator-code/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:14:18)
    at applyProcessingFunc (/usr/local/lib/node_modules/generator-code/node_modules/mem-fs-editor/lib/actions/copy.js:13:16)
    at EditionInterface.exports._copySingle (/usr/local/lib/node_modules/generator-code/node_modules/mem-fs-editor/lib/actions/copy.js:51:16)
    at EditionInterface.exports.copy (/usr/local/lib/node_modules/generator-code/node_modules/mem-fs-editor/lib/actions/copy.js:23:17)
    at EditionInterface.module.exports [as copyTpl] (/usr/local/lib/node_modules/generator-code/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:12:8)
    at template (/usr/local/lib/node_modules/generator-code/node_modules/yeoman-generator/lib/actions/actions.js:134:11)
    at module.exports.yeoman.generators.Base.extend._writingLanguage (/usr/local/lib/node_modules/generator-code/generators/app/index.js:560:14)
ChrisJefferson commented 8 years ago

Figured out the problem.. I pointed it at the base info.plist in the tmbundle, instead of GAP.tmLanguage. Could still be a more helpful error! Will leave this open, but feel free to close it if it is not a bug.