OmniSharp / omnisharp-atom

Omnisharp support for the atom editor
https://atom.io/packages/omnisharp-atom
MIT License
318 stars 61 forks source link

atom.grammars.startIdForScope is not a function #1035

Open cephen opened 6 years ago

cephen commented 6 years ago

I have already gone through the steps mentioned in #1020 with no success.

Atom 1.32.2 x64 running on Manjaro Linux

Steps: Installed omnisharp-atom package via apm

atom.grammars.startIdForScope is not a function in /usr/lib/atom/node_modules/language-csharp/grammars/csharp.json

TypeError: atom.grammars.startIdForScope is not a function
    at grammarCb (/home/fluxx/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at GrammarRegistry.module.exports.GrammarRegistry.addGrammar (/usr/lib/atom/node_modules/first-mate/lib/grammar-registry.js:80:20)
    at Grammar.module.exports.Grammar.activate (/usr/lib/atom/node_modules/first-mate/lib/grammar.js:247:48)
    at grammarRegistry.readGrammar (/usr/lib/atom/src/package.js:611:47)
    at CSON.readFile (/usr/lib/atom/src/grammar-registry.js:515:9)
    at parseContents (/usr/lib/atom/node_modules/season/lib/cson.js:119:7)
    at /usr/lib/atom/node_modules/season/lib/cson.js:226:20
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
  at /usr/lib/atom/node_modules/language-csharp/grammars/csharp.json:1:1
atom.grammars.startIdForScope is not a function in /usr/lib/atom/node_modules/language-csharp/grammars/csx.json

TypeError: atom.grammars.startIdForScope is not a function
    at grammarCb (/home/fluxx/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at GrammarRegistry.module.exports.GrammarRegistry.addGrammar (/usr/lib/atom/node_modules/first-mate/lib/grammar-registry.js:80:20)
    at Grammar.module.exports.Grammar.activate (/usr/lib/atom/node_modules/first-mate/lib/grammar.js:247:48)
    at grammarRegistry.readGrammar (/usr/lib/atom/src/package.js:611:47)
    at CSON.readFile (/usr/lib/atom/src/grammar-registry.js:515:9)
    at parseContents (/usr/lib/atom/node_modules/season/lib/cson.js:119:7)
    at /usr/lib/atom/node_modules/season/lib/cson.js:226:20
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
  at /usr/lib/atom/node_modules/language-csharp/grammars/csx.json:1:1
brunnopleffken commented 5 years ago

Having this same issue on Atom 1.33.1 on MacOS Mojave. My stack trace:

TypeError: atom.grammars.startIdForScope is not a function
    at grammarCb (/Users/brunnopleffken/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
    at arrayEach (/Users/brunnopleffken/.atom/packages/omnisharp-atom/node_modules/lodash/lodash.js:516:11)
    at forEach (/Users/brunnopleffken/.atom/packages/omnisharp-atom/node_modules/lodash/lodash.js:9344:14)
    at OmniSharpAtom.activate (/Users/brunnopleffken/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:153:30)
    at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2951735)
    at measure (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2951147)
    at Package.measure (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2948778)
    at activationPromise.activationPromise.Promise (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2951007)
    at new Promise (<anonymous>)
    at Package.activate (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2950950)
    at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382657)
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:917626
    at r (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:912232)
    at o (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:1037481)
    at ChildProcess.n.process.on.e (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:1037687)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
HYAR7E commented 4 years ago

This solution worked for me https://github.com/OmniSharp/omnisharp-atom/issues/1020#issuecomment-570095290