Open corydeppen opened 6 years ago
Hi.
I get the same error message in Atom 1.24.0-beta3 x64 / Windows 10 Pro x64.
I've also tried Atom 1.23.3 x64 / Windows 10 Pro x64... and I get different error.
And package is omnisharp-atom 0.31.2
Either way, can't get OmniSharp icon turn green, and of course, intellisense etc doesn't work.
However, with Sublime Text 3 I can get omnisharp working, however, I have no idea what the difference or similarities between Atom and Sublime Text omnisharp are... if there are any similarities or such.
I'm pretty noob in anything coding, not even sure what .Net should be installed for omnisharp to work, I was going to try using atom as alternative IDE for Unity + C# use.
Same on released production version 1.24 on Mac OS X:
[Enter steps to reproduce:]
Atom: 1.24.0 x64 Electron: 1.6.16 OS: Mac OS X 10.13.3 Thrown From: omnisharp-atom package 0.31.2
Uncaught TypeError: atom.grammars.startIdForScope is not a function
At ~/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:145
TypeError: atom.grammars.startIdForScope is not a function
at grammarCb (/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at GrammarRegistry.module.exports.GrammarRegistry.addGrammar (/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar-registry.js:80:26)
at Grammar.module.exports.Grammar.activate (/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar.js:259:54)
at grammarRegistry.readGrammar (/Applications/Atom.app/Contents/Resources/app/src/package.js:617:53)
at /Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar-registry.js:126:61
at parseContents (/Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:123:13)
at /Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:230:26
at ELECTRON_ASAR.js:498:9
at FSReqWrap.wrapper [as oncomplete] (fs.js:603:17)
angular-2-typeScript-snippets 0.7.0
angular2-snippets 0.4.0
atom-ide-ui 0.8.1
atom-material-syntax-light 0.4.6
atom-material-ui 2.1.1
atom-typescript 12.1.2
atom-yii2 0.4.0
autocomplete-clang 0.11.4
build 0.70.0
busy-signal 1.4.3
docblockr 0.13.6
editorconfig 2.2.2
file-icons 2.1.16
hyperclick 0.0.0
ide-csharp 0.6.1
ide-json 0.2.0
ide-php 0.7.5
ide-python 0.7.0
intentions 1.1.5
language-ini 1.19.0
language-matlab 0.2.1
linter 2.2.0
linter-eslint 8.4.1
linter-gcc 0.7.1
linter-php 1.5.1
linter-tidy 2.3.1
linter-tslint 1.9.0
linter-ui-default 1.6.10
nativescript-ng2-atom-snippets 1.2.0
omnisharp-atom 0.31.2
php-composer-completion 0.3.4
php-cs-fixer 4.1.1
php-integrator-annotations 1.2.0
php-integrator-autocomplete-plus 1.6.2
php-integrator-base 3.2.1
php-integrator-refactoring 1.4.1
platformio-ide-debugger 1.2.5
platformio-ide-terminal 2.8.0
prettier-atom undefined
project-manager 3.3.5
symbols-tree-view 0.14.0
tool-bar 1.1.6
webbox-color 0.5.9
I'm not sure if this is related, but I have a similar issue in my own package and have started a discussion on atom.io to see if there's any support: https://discuss.atom.io/t/function-this-registry-startidforscope-is-not-a-function/52441
I'm having the same issue.
Steps to reproduce:
Atom: 1.24.0 x64 Electron: 1.6.16 OS: Mac OS X 10.12.6 Thrown From: omnisharp-atom package 0.31.2
Failed to activate the omnisharp-atom package
At atom.grammars.startIdForScope is not a function
TypeError: atom.grammars.startIdForScope is not a function
at grammarCb (/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
at arrayEach (/packages/omnisharp-atom/node_modules/lodash/lodash.js:508:11)
at forEach (/packages/omnisharp-atom/node_modules/lodash/lodash.js:9334:14)
at OmniSharpAtom.activate (/packages/omnisharp-atom/dist/omnisharp-atom.js:153:30)
at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:230:33)
at measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:206:33)
at Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:88:25)
at activationPromise.Promise (/Applications/Atom.app/Contents/Resources/app/src/package.js:200:20)
at Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:198:38)
at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:695:42)
at /Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:535:35
at exit (/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-manager.js:128:22)
at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:338:17)
at /Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:359:17
at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:220:15)
at emitOne (events.js:101:20)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
-1:13.9.0 core:select-all (input.hidden-input)
-1:12.9.0 core:backspace (input.hidden-input)
5x -1:03.9.0 core:move-left (input.hidden-input)
-1:01.4.0 core:select-all (input.hidden-input)
-0:59.3.0 core:move-right (input.hidden-input)
-0:58.6.0 editor:move-to-beginning-of-word (input.hidden-input)
-0:58.2.0 core:backspace (input.hidden-input)
-0:57.9.0 core:confirm (input.hidden-input)
busy-signal 1.4.3
intentions 1.1.5
linter 2.2.0
linter-ui-default 1.6.10
omnisharp-atom 0.31.2
Im having the same issue, but i have Linux(Ubuntu), i have this problem since 2 weeks, and i was looking for solved this for all that time, this is what drop: [Enter steps to reproduce:]
Atom: 1.24.0 x64 Electron: 1.6.16 OS: Ubuntu 16.04.3 Thrown From: omnisharp-atom package 0.31.2
Uncaught TypeError: atom.grammars.startIdForScope is not a function
At /home/fenix/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js:145
TypeError: atom.grammars.startIdForScope is not a function
at grammarCb (/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at GrammarRegistry.module.exports.GrammarRegistry.addGrammar (/usr/share/atom/resources/app/node_modules/first-mate/lib/grammar-registry.js:80:26)
at Grammar.module.exports.Grammar.activate (/usr/share/atom/resources/app/node_modules/first-mate/lib/grammar.js:259:54)
at grammarRegistry.readGrammar (/usr/share/atom/resources/app/src/package.js:617:53)
at /usr/share/atom/resources/app/node_modules/first-mate/lib/grammar-registry.js:126:61
at parseContents (/usr/share/atom/resources/app/node_modules/season/lib/cson.js:123:13)
at /usr/share/atom/resources/app/node_modules/season/lib/cson.js:230:26
at ELECTRON_ASAR.js:498:9
at FSReqWrap.wrapper [as oncomplete] (fs.js:603:17)
-8:05.3.0 application:open-folder (atom-pane.pane.active)
-0:41.3.0 editor:newline (input.hidden-input)
3x -0:38 core:backspace (input.hidden-input)
3x -0:33 editor:newline (input.hidden-input)
busy-signal 1.4.3
intentions 1.1.5
linter 2.2.0
linter-ui-default 1.6.10
omnisharp-atom 0.31.2
Ok i was searching the error and i found there is in the line 145 of the omnisharp-atom.js file, so we khow where is the error but... what is? I dont know about JS, maybe is a server error because the build is failing so....
Same issue here [Enter steps to reproduce:]
Atom: 1.24.0 x64 Electron: 1.6.16 OS: Mac OS X 10.12.6 Thrown From: omnisharp-atom package 0.31.2
Failed to activate the omnisharp-atom package
At atom.grammars.startIdForScope is not a function
TypeError: atom.grammars.startIdForScope is not a function
at grammarCb (/packages/omnisharp-atom/dist/omnisharp-atom.js:145:35)
at arrayEach (/packages/omnisharp-atom/node_modules/lodash/lodash.js:508:11)
at forEach (/packages/omnisharp-atom/node_modules/lodash/lodash.js:9334:14)
at OmniSharpAtom.activate (/packages/omnisharp-atom/dist/omnisharp-atom.js:153:30)
at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:230:33)
at measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:206:33)
at Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:88:25)
at activationPromise.Promise (/Applications/Atom.app/Contents/Resources/app/src/package.js:200:20)
at Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:198:38)
at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:695:42)
at config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:670:36)
at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app/src/config.js:367:24)
at PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:668:23)
at PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:647:50)
at loadStatePromise.loadState.then (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:841:27)
-0:50.5.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
busy-signal 1.4.3
intentions 1.1.5
linter 2.2.0
linter-ui-default 1.7.0
nuclide 0.245.0
omnisharp-atom 0.31.2
Not meaning to be rude, but just wondering if this project has been dropped in favour of https://github.com/OmniSharp/omnisharp-vscode, as there hasn't been a commit here in over 10 months, and issues don't seem to be getting addressed?
I'd be possibly interested in helping move it from DNVM to DotNet CLI, which seems to be the cause of the latest build fail, but not if it's being deprecated.
Replace 140 line of omnisharp-atom.js from:
var grammars = atom.grammars;
to
var grammars = atom.grammars.textmateRegistry || atom.grammars;
Didn't work for me.
Didn't work for me neither :/
@koxu1996 's solution is really close
The startIdForScope
call references atom.grammars
directly, so you need to switch it to just grammars
as well.
It seems to solve that problem, thanks for both of you!
I have another error to start the package, though, which seems to be unrelated. I will open a new issue for that one.
Simple solution
Replace 140 line of omnisharp-atom.js from:
var grammars = atom.grammars;
tovar grammars = atom.grammars.textmateRegistry || atom.grammars;
@koxu1996 's solution is really close The startIdForScope call references atom.grammars directly, so you need to switch it to just grammars as well.
Thank you!! It worked for me!
Can you post the updated solution? I'm having trouble understanding.
@theslyprofessor I might be a little late, but I have gotten it to work by finding the file omnisharp-atom.js. It's located in the your-username/.atom/packages/omnisharp-atom/dist folder. If you don't find it there, try letting explorer search for omnisharp-atom.js in the whole drive, and it should find it ...
Anyway, find it and open it in a text editor, then search for "var grammars = atom.grammars;". This will take you to line 140. Replace that whole line with "var grammars = atom.grammars.textmateRegistry || atom.grammars;".
Then you shall move on to line 145, "atom.grammars.startIdForScope(grammar.scopeName);" and replace it with "grammars.startIdForScope(grammar.scopeName);". Then you save the file and relaunch Atom. Good luck and hope it works now!
@theslyprofessor is right but then if you have installed linder-ui-default it sends you and error like its something ilegal, u have to uninstall then it runs, but it someone knows how to avoid uninstall, please contact me thanks
Steps to reproduce:
Atom: 1.24.0-beta1 x64 Electron: 1.6.15 OS: Microsoft Windows 10 Enterprise Thrown From: omnisharp-atom package 0.31.2
Stack Trace
Uncaught TypeError: atom.grammars.startIdForScope is not a function
Non-Core Packages