Skip to content
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

Callback must be a function when using a custom tagged template grammar #525

Open
pfgithub opened this issue Jan 20, 2019 · 13 comments
Open

Comments

@pfgithub
Copy link

Setting a custom tagged template grammar like csscustom:source.css and using it on a file

let csscustom = () => {};
csscustom`
a{
  color:#fff;
}
`;

produces a warning Callback must be a function and does not highlight the text differently

settings page with template literal grammar set
image of code above
callback must be a function

@lasbian
Copy link

lasbian commented Aug 18, 2019

Same issue...

@tujoworker
Copy link

By installing Node v10 (LTS) instead of using v12, I got rid of the warning message Callback must be a function. But my custom tagged template grammar extensions are currently not working on my new mac/atom setup.

@lasbian
Copy link

lasbian commented Aug 22, 2019

Was already running the v10 (LTS) :/

@pyrou
Copy link

pyrou commented Sep 6, 2019

Same issue here.
Possible related issue: are gql code highlighted on your setup with following example ?

const typeDefs = gql`
  type Query {
    test: String
  }
`;

This highlight should be working without custom tagged template grammar, because shipped by default with the plugin, but is also not working anymore on my setup (OSX, tested with node 10, 11, 12).

@waspeer
Copy link

waspeer commented Sep 14, 2019

Same!

@christiaanwesterbeek
Copy link

christiaanwesterbeek commented Oct 15, 2019

Just for good measure, here's the error stack of Atom:

Uncaught (in promise) NodeError: Callback must be a function
at makeCallback (fs.js:165:11)
at Object.fs.unlink (fs.js:1048:14)
at getTtlGrammarFiles.then.ttlGrammarFiles (/.../.atom/packages/language-babel/lib/create-ttl-grammar.js:260:12)

  NodeError @ internal/errors.js:157
  makeCallback @ fs.js:165
  fs.unlink @ fs.js:1048
  getTtlGrammarFiles.then.ttlGrammarFiles @ create-ttl-grammar.js? [sm]:271
  Promise.catch (async)    
  doesGrammarFileExist.then.ifFileExists @ create-ttl-grammar.js? [sm]:54
  Promise.then (async)    
  Promise @ create-ttl-grammar.js? [sm]:48
  createGrammar @ create-ttl-grammar.js? [sm]:46
  configChangedTimer.setTimeout @ create-ttl-grammar.js? [sm]:222

Related: gruntjs/grunt-contrib-jasmine#266

VincentGuinaudeau added a commit to VincentGuinaudeau/language-babel that referenced this issue Oct 22, 2019
VincentGuinaudeau added a commit to VincentGuinaudeau/language-babel that referenced this issue Oct 22, 2019
VincentGuinaudeau added a commit to VincentGuinaudeau/language-babel that referenced this issue Jan 15, 2020
@Axedyson
Copy link

The same problem occurs for me when setting the following tagged template grammar:

Anmærkning 2020-02-14 000454

@paulobarcelos
Copy link

paulobarcelos commented Aug 26, 2020

This is still the case today... super frustrating. Having the same problem on a new mac, fresh installation of Atom and up to date language-babel package.

@Navigatron
Copy link

I am experiencing the same issue. Setting:

html:text.html.basic

Versions:

screenshot

@tiffting
Copy link

tiffting commented Nov 4, 2020

The same problem occurs for me when setting the following tagged template grammar:

Anmærkning 2020-02-14 000454

Experiencing similar issue with /* @html */:text.html.basic

@eminvegan
Copy link

I have the same issue with .mjs files using template literals.
My plugin list is:
atom-beautify
busy-signal
docblockr
file-icons
highlight-selected
hyperclick
ide-css
intentions
language-babel
language-javascript-plus
linter (maybe incompatible?)
linter-eslint (maybe incompatible?)
linter-jshint (maybe incompatible?)
linter-ui-default (maybe incompatible?)
remember-folds
remote-ftp

@bruns8234
Copy link

Problem still exists since now more than 2 years. Does anybody think it will be solved? I appreciate to get a solution because changing from VS Code to Atom does not get easier with such problems (I code in js and html and want to use this feature as an replacement for the ES6-html Plugin of VS-Code (which marks html in template strings).

@tinbka
Copy link

tinbka commented Mar 31, 2022

Same there since 3 years

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

No branches or pull requests