Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Uncaught TypeError: atom.grammars.startIdForScope is not a function #717

Closed
penn-z opened this issue Dec 16, 2017 · 16 comments
Closed

Uncaught TypeError: atom.grammars.startIdForScope is not a function #717

penn-z opened this issue Dec 16, 2017 · 16 comments
Labels

Comments

@penn-z
Copy link

penn-z commented Dec 16, 2017

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0-beta1 x64
Electron: 1.6.15
OS: Mac OS X 10.13.2
Thrown From: git-plus package 7.10.0

Stack Trace

Uncaught TypeError: atom.grammars.startIdForScope is not a function

At /Users/penn/.atom/packages/git-plus/lib/grammars/diff.js:130

TypeError: atom.grammars.startIdForScope is not a function
    at runCodeGrammar (/packages/git-plus/lib/grammars/diff.js:130:41)
    at Grammar.tokenizeLine (/packages/git-plus/lib/grammars/diff.js:64:17)
    at TextMateLanguageMode.buildTokenizedLineForRowWithText (/Applications/Atom Beta.app/Contents/Resources/app/src/text-mate-language-mode.js:407:50)
    at TextMateLanguageMode.buildTokenizedLineForRow (/Applications/Atom Beta.app/Contents/Resources/app/src/text-mate-language-mode.js:402:23)
    at TextMateLanguageMode.tokenizeNextChunk (/Applications/Atom Beta.app/Contents/Resources/app/src/text-mate-language-mode.js:290:47)
    at _.defer (/Applications/Atom Beta.app/Contents/Resources/app/src/text-mate-language-mode.js:274:63)
    at /Applications/Atom Beta.app/Contents/Resources/app/node_modules/underscore/underscore.js:666:53

Commands

     -0:19.8.0 intentions:highlight (input.hidden-input)
     -0:19.3.0 datatip:toggle (input.hidden-input)
     -0:17.8.0 core:undo (input.hidden-input)
     -0:16.1.0 core:save (input.hidden-input)
     -0:13.9.0 command-palette:toggle (input.hidden-input)
     -0:12.6.0 core:confirm (input.hidden-input)
     -0:12.6.0 git-plus:diff (input.hidden-input)
     -0:08.8.0 command-palette:toggle (input.hidden-input)
     -0:06.9.0 editor:consolidate-selections (input.hidden-input)
     -0:06.9.0 core:cancel (input.hidden-input)
     -0:04.4.0 core:save (input.hidden-input)
     -0:04.0 command-palette:toggle (input.hidden-input)
     -0:03.2.0 core:confirm (input.hidden-input)
     -0:03.2.0 git-plus:diff (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-bootstrap3 1.2.12 
atom-ide-ui 0.7.0 
atom-languageclient 1.0.7 
autocomplete-paths 2.12.1 
busy-signal 1.4.3 
docblockr 0.13.4 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.15 
fonts 3.0.3 
git-blame 1.4.0 
git-plus 7.10.0 
ide-php 0.7.4 
intentions 1.1.5 
linter 2.2.0 
linter-php 1.5.1 
linter-ui-default 1.6.10 
minimap 4.29.7 
monokai 0.24.0 
project-manager 3.3.5 
sync-settings 0.8.3 
@akonwi akonwi added the bug label Jan 20, 2018
@akonwi akonwi assigned akonwi and unassigned akonwi Jan 20, 2018
@Bjoernsen
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0-beta3 x64
Electron: 1.6.15
OS: Ubuntu 14.04.2
Thrown From: git-plus package 7.10.0

Stack Trace

Uncaught TypeError: atom.grammars.startIdForScope is not a function

At /home/bjoernsen/data/.atom/packages/git-plus/lib/grammars/diff.js:130

TypeError: atom.grammars.startIdForScope is not a function
    at runCodeGrammar (/packages/git-plus/lib/grammars/diff.js:130:41)
    at Grammar.tokenizeLine (/packages/git-plus/lib/grammars/diff.js:64:17)
    at TextMateLanguageMode.buildTokenizedLineForRowWithText (/usr/share/atom-beta/resources/app/src/text-mate-language-mode.js:407:50)
    at TextMateLanguageMode.buildTokenizedLineForRow (/usr/share/atom-beta/resources/app/src/text-mate-language-mode.js:402:23)
    at TextMateLanguageMode.tokenizeNextChunk (/usr/share/atom-beta/resources/app/src/text-mate-language-mode.js:290:47)
    at _.defer (/usr/share/atom-beta/resources/app/src/text-mate-language-mode.js:274:63)
    at /usr/share/atom-beta/resources/app/node_modules/underscore/underscore.js:666:53

Commands

     -4:31.4.0 command-palette:toggle (input.hidden-input)
     -4:29.7.0 core:confirm (input.hidden-input)
     -4:29.7.0 linter-rubocop:fix-file (input.hidden-input)
     -4:23.7.0 intentions:highlight (input.hidden-input)
     -4:23.6.0 core:save (input.hidden-input)
  4x -4:04.7.0 git-plus:fetch-all (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-syntax.theme-atom-dark-ui)
     -1:01.1.0 intentions:highlight (input.hidden-input)
     -1:00.9.0 fuzzy-finder:toggle-file-finder (input.hidden-input)
     -1:00.6.0 core:paste (input.hidden-input)
     -1:00.1.0 core:confirm (input.hidden-input)
     -0:40.1.0 intentions:highlight (input.hidden-input)
     -0:39.8.0 command-palette:toggle (input.hidden-input)
     -0:38.4.0 core:move-down (input.hidden-input)
     -0:38.1.0 core:confirm (input.hidden-input)
     -0:38.1.0 git-plus:diff-all (input.hidden-input)
     -0:04.7.0 git-plus:fetch-all (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-syntax.theme-atom-dark-ui)

Non-Core Packages

busy-signal 1.4.3 
file-icons 2.1.16 
git-plus 7.10.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-docker 1.1.8 
language-haml 0.25.2 
linter 2.2.0 
linter-docker 0.3.0 
linter-haml 2.0.2 
linter-rubocop 2.2.2 
linter-ui-default 1.6.10 
merge-conflicts 1.4.5 
minimap 4.29.7 
minimap-git-diff 4.3.1 

@ashthespy
Copy link

[Enter steps to reproduce:]

  1. Open a file
  2. Toggle Git-pluss --> Diff

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Microsoft Windows 10 Pro
Thrown From: git-plus package 7.10.0

Stack Trace

Uncaught TypeError: atom.grammars.startIdForScope is not a function

At C:\Users\~\.atom\packages\git-plus\lib\grammars\diff.js:130

TypeError: atom.grammars.startIdForScope is not a function
    at runCodeGrammar (/packages/git-plus/lib/grammars/diff.js:130:41)
    at Grammar.tokenizeLine (/packages/git-plus/lib/grammars/diff.js:64:17)
    at TextMateLanguageMode.buildTokenizedLineForRowWithText (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-mate-language-mode.js:407:50)
    at TextMateLanguageMode.buildTokenizedLineForRow (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-mate-language-mode.js:402:23)
    at TextMateLanguageMode.tokenizeNextChunk (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-mate-language-mode.js:290:47)
    at _.defer (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-mate-language-mode.js:274:63)
    at ~/AppData/Local/atom/app-1.24.0/resources/app/node_modules/underscore/underscore.js:666:53

Commands

     -0:48.6.0 editor:toggle-line-comments (input.hidden-input)
     -0:47 core:save (input.hidden-input)
     -0:42.1.0 git-plus:menu (input.hidden-input)
     -0:41.4.0 core:confirm (input.hidden-input)
     -0:19 git-plus:menu (input.hidden-input)
     -0:18 core:confirm (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-latex 0.8.4 
atom-live-server 2.2.0 
atom-typescript 12.1.2 
file-icons 2.1.16 
git-plus 7.10.0 
highlight-selected 0.13.1 
language-docker 1.1.8 
language-matlab 0.2.1 
language-rust 0.4.12 
minimap 4.29.7 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
node-debugger 1.10.1 
pdf-view 0.65.0 
remote-ftp 2.1.4 
script 3.17.3 
split-diff 1.5.2 
Sublime-Style-Column-Selection 1.7.4 

@irrationalistic
Copy link

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

@sharedprophet
Copy link
Contributor

sharedprophet commented Feb 20, 2018

This is the PR that fixed it for semanticolor: digitallyserviced/semanticolor#27 I will submit a PR to fix soon if no one else beats me to it.

@ccjmne
Copy link
Contributor

ccjmne commented Feb 22, 2018

Thanks, @sharedprophet!
Your PR on the other project is super straightforward and I'd love for you to submit the same here.

I could do it though if you're busy! Just don't wanna take credit for your work.

@sharedprophet
Copy link
Contributor

@ccjmne I am not actually the submitter of that PR, just the maintainer of that project who merged it. :) And I am a bit busy, though the real issue is that the computer I would use for this is out of order at the moment. Long story short, if you could do it that would be great. :D

@ccjmne
Copy link
Contributor

ccjmne commented Feb 22, 2018

@sharedprophet Ha! Gotcha :)
A'ight, I just spent a fair amount of time trying to contribute to this project but the tests, right after cloning, won't pass for me. That's annoying... and some of them are probably related to my environment.

Thing is, I just don't have nearly enough experience with Atom packages and JS test suites; I just spent a couple hours catching up and that's really interesting, but I gotta drop the ball here and just PR the fix with no test implemented.

@dhniels
Copy link

dhniels commented Feb 28, 2018

im having this bug as well when i do a diff with git-plus.

@ChenXiyu
Copy link

ChenXiyu commented Mar 2, 2018

When I trying to run Git Plus: Diff All, this error occurred, seems we already have solutions, can someone explain what’s going on on this issue?
Stack Trace shows below:
[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Mac OS X 10.13.3
Thrown From: git-plus package 7.10.0

Stack Trace

Uncaught TypeError: atom.grammars.startIdForScope is not a function

At /Users/xyChen/.atom/packages/git-plus/lib/grammars/diff.js:130

TypeError: atom.grammars.startIdForScope is not a function
    at runCodeGrammar (/packages/git-plus/lib/grammars/diff.js:130:41)
    at Grammar.tokenizeLine (/packages/git-plus/lib/grammars/diff.js:64:17)
    at TextMateLanguageMode.buildTokenizedLineForRowWithText (/Applications/Atom.app/Contents/Resources/app/src/text-mate-language-mode.js:407:50)
    at TextMateLanguageMode.buildTokenizedLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-mate-language-mode.js:402:23)
    at TextMateLanguageMode.tokenizeNextChunk (/Applications/Atom.app/Contents/Resources/app/src/text-mate-language-mode.js:290:47)
    at _.defer (/Applications/Atom.app/Contents/Resources/app/src/text-mate-language-mode.js:274:63)
    at /Applications/Atom.app/Contents/Resources/app/node_modules/underscore/underscore.js:666:53

Commands

 13x -0:50.1.0 vim-mode-plus:move-up (input.hidden-input)
 12x -0:49.4.0 vim-mode-plus:move-down (input.hidden-input)
  9x -0:48.8.0 vim-mode-plus:move-up (input.hidden-input)
     -0:48.3.0 vim-mode-plus:move-down (input.hidden-input)
     -0:48.1.0 vim-mode-plus:move-up (input.hidden-input)
  5x -0:48.1.0 vim-mode-plus:move-down (input.hidden-input)
     -0:47.2.0 command-palette:toggle (input.hidden-input)
     -0:45.7.0 core:confirm (input.hidden-input)
     -0:45.7.0 git-plus:diff-all (input.hidden-input)
 10x -0:44.2.0 vim-mode-plus:move-down (input.hidden-input)
     -0:43.4.0 vim-mode-plus:move-up (input.hidden-input)
 11x -0:43.3.0 vim-mode-plus:move-down (input.hidden-input)
  7x -0:42.6.0 vim-mode-plus:move-up (input.hidden-input)
 37x -0:41.9.0 vim-mode-plus:move-down (input.hidden-input)
  2x -0:40.4.0 vim-mode-plus:move-up (input.hidden-input)
     -0:39.6.0 core:close (input.hidden-input)

Non-Core Packages

atom-ide-ui 0.9.2 
better-git-blame 0.3.2 
cursor-history 0.13.0 
emmet 2.4.3 
file-icons 2.1.17 
git-plus 7.10.0 
go-plus 5.8.2 
highlight-selected 0.13.1 
ide-flowtype 0.21.0 
ide-go 0.6.1 
ide-ruby 0.1.9 
ide-typescript 0.7.5 
language-babel 2.84.0 
minimap 4.29.8 
minimap-bookmarks 0.4.2 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-selection 4.5.0 
open-this 0.5.0 
split-diff 1.5.2 
sync-settings 0.8.5 
vim-mode-plus 1.29.0 
vim-mode-plus-keymaps-for-surround 0.2.1 

@sharedprophet
Copy link
Contributor

sharedprophet commented Mar 2, 2018

Please merge in and release one of the PRs that fixes this...

@ChenXiyu
Copy link

I like this extension very much, but the error raised by this bug is really annoying, Please merge PRs to fix this, Thank you

@ashthespy
Copy link

@ChenXiyu It takes 30 seconds to copy paste the fix into your own version of atom, just saying ;-)

@ChenXiyu
Copy link

Awesome! Thank you @ashthespy for mention that.
one question: is the modification influence the update of this package?

@jorgedferreira
Copy link

jorgedferreira commented Mar 13, 2018

@ashthespy woke up to this and cant seem to find where do update the code. No lib/semanticolor-grammar.js to edit... any ideas?

Edit: found the file, edited and still not working :(

Nevermind, i've just fixed it following https://github.com/akonwi/git-plus/pull/729/files

Thanks, back to work...

@ashthespy
Copy link

ashthespy commented Mar 13, 2018

@ChenXiyu Nope, the new update will rewrite the files:
PSA for those who can't wait for the PR:

  1. Head to Settingsgit-plusView Code
  2. Patch lib/grammars/diff.js with the diff from the open PR
  3. Reload Atom (ctr+shift+F5)
  4. Profit!? :-)

@ChenXiyu
Copy link

@ashthespy Make senses, Thanks

@akonwi akonwi closed this as completed in 721f187 Mar 15, 2018
akonwi added a commit that referenced this issue Mar 15, 2018
Fix #717 (registry.startIdForScope is not a function)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants