Using a custom Tree-sitter grammar


#1

I created a Tree-sitter grammar for a language called “manuscript” and also created a language package for Atom. The package is now listed in my Installed Packages. My grammars/manuscript.cson file looks like this:

'name': 'ManuScript'
'scopeName': 'manuscript'
'type': 'tree-sitter'
'parser': 'tree-sitter-manuscript'
'fileTypes': ['mss']

When I open a file with .mss extension and look at the Dev Tools, I do not see any syntax--* classes added yet. The Flight Manual seems to suggest that I have to add a scopes field to the manuscript.cson file to map the defined syntax nodes to classes. I’m not exactly sure how that works, but here’s what I tried:

'nodes':
  'program identifier': 'name'

I hoped to see some syntax--name classes on all the identifier nodes, but I do not see anything. Am I expecting or doing something wrong here? How can I find out whether Atom at all associates the grammar with the file I’m opening?

Just in case it helps to identify what I did wrong – here are (hopefully) all the steps I performed to create the package:

  • I enabled Tree-sitter in the preferences
  • I wrote a grammar named tree-sitter-manuscript
  • I made all tests pass
  • I installed it on my machine with npm install -g
  • I created a package called language-manuscriptwith “Package Generator: Generate Package”
  • I created a grammars/manuscript.cson file
  • I added my grammar as a dependency to package.json as
    "tree-sitter-manuscript": "file:/usr/local/lib/node_modules/tree-sitter-manuscript"
  • I did npm install in the language-manuscript folder
  • I reloaded the Atom window (Ctrl+Shift+F5)

The grammar itself seems to be loaded. At least when I deliberately mess up the manuscript.cson file, the console complains “Failed to load grammer: …”, which it otherwise does not do.


#2

Try scopes instead of nodes

Also see the language-javascript repo for an example of a working grammar

https://github.com/atom/language-javascript/blob/master/grammars/tree-sitter-javascript.cson


#3

How embarrassing… Talking about scopes in the text and writing nodes in the code. Many thanks, @Aerijo. I think I’m getting there.

Is there a list of classes that are recognized by default somewhere?


#4

No scopes are applied by default. It’s up to you how you want to translate the nodes to scopes.

Node names aren’t standardized either, but I did raise an issue for it on one of the Tree-sitter repos.


#5

But there are pre-defined styles for e.g. .syntax--entity.syntax--name.syntax--function or .syntax--string. I wonder where they are defined.

Bildschirmfoto%20von%202018-09-24%2009-21-16


#6

I realize I can look at the syntax.less file of some syntax style to see which syntax classes there are.


#7

Yes, the scopes are standardized. Google TextMate section 12


#8

Great - found it.


#9

Styling works nicely now, but whenever I want to edit the file, I get an error like this:

commitCommentView_item.graphql.js:112 Error reporting uncaught exception TypeError: Cannot read property 'replace' of null
    at Reporter.normalizePath (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:122:36)
    at Reporter.scrubPath (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:128:37)
    at /usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:111:29
    at Array.map (<anonymous>)
    at Reporter.buildStackTraceJSON (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:109:48)
    at Reporter.buildExceptionJSON (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:101:32)
    at Reporter.buildNotificationJSON (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:79:35)
    at Reporter.reportUncaughtException (/usr/share/atom/resources/app/node_modules/exception-reporting/lib/reporter.js:292:38)
    at /usr/share/atom/resources/app/node_modules/exception-reporting/lib/main.js:38:29
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:27:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:156:34)
    at window.onerror (/usr/share/atom/resources/app/src/atom-environment.js:953:26)
(anonymous) @ commitCommentView_item.graphql.js:112
module.exports.Emitter.simpleDispatch @ commitCommentView_item.graphql.js:112
module.exports.Emitter.emit @ commitCommentView_item.graphql.js:112
window.onerror @ commitCommentView_item.graphql.js:112
commitCommentView_item.graphql.js:112 Uncaught TypeError: Cannot read property 'split' of undefined
    at BracketMatcherView.module.exports.BracketMatcherView.isScopeCommentedOrString (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:458:29)
    at BracketMatcherView.module.exports.BracketMatcherView.findMatchingStartPair (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:235:47)
    at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:121:38)
    at /usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:3:65
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:27:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:156:34)
    at TextEditor.selectionRangeChanged (/usr/share/atom/resources/app/src/text-editor.js:3490:24)
    at Selection.markerDidChange (/usr/share/atom/resources/app/src/selection.js:1041:23)
    at Selection.marker.onDidChange.e (/usr/share/atom/resources/app/src/selection.js:21:45)
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:27:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:156:34)
    at DisplayMarker.module.exports.DisplayMarker.notifyObservers (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-marker.js:248:33)
    at /usr/share/atom/resources/app/node_modules/text-buffer/lib/display-marker.js:53:32
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:27:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:156:34)
    at Marker.module.exports.Marker.emitChangeEvent (/usr/share/atom/resources/app/node_modules/text-buffer/lib/marker.js:441:26)
    at /usr/share/atom/resources/app/node_modules/text-buffer/lib/marker-layer.js:348:31
    at Set.forEach (<anonymous>)
    at MarkerLayer.module.exports.MarkerLayer.emitChangeEvents (/usr/share/atom/resources/app/node_modules/text-buffer/lib/marker-layer.js:345:52)
    at TextBuffer.module.exports.TextBuffer.emitMarkerChangeEvents (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1774:40)
    at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:999:18)
    at TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:2002:30)
    at mergeIntersectingSelections (/usr/share/atom/resources/app/src/text-editor.js:1429:25)
    at TextEditor.mergeSelections (/usr/share/atom/resources/app/src/text-editor.js:3416:53)
    at TextEditor.mergeIntersectingSelections (/usr/share/atom/resources/app/src/text-editor.js:3390:42)
    at TextEditor.mutateSelectedText (/usr/share/atom/resources/app/src/text-editor.js:1428:23)
    at TextEditor.insertText (/usr/share/atom/resources/app/src/text-editor.js:1381:31)
    at /usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher.js:111:25
    at TextBuffer.module.exports.TextBuffer.transact (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:975:24)
    at TextEditor.transact (/usr/share/atom/resources/app/src/text-editor.js:2002:30)
    at BracketMatcher.module.exports.BracketMatcher.insertText (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher.js:109:27)
    at TextEditor.<anonymous> (/usr/share/atom/resources/app/node_modules/bracket-matcher/lib/bracket-matcher.js:3:65)
    at TextEditor.object.(anonymous function) [as insertText] (/usr/share/atom/resources/app/node_modules/underscore-plus/lib/underscore-plus.js:76:26)
    at TextEditorComponent.didTextInput (/usr/share/atom/resources/app/src/text-editor-component.js:1650:30)

How can I find out who’s to blame (me, Tree-sitter or Atom)? My Tree-sitter grammar and the Atom package can be found on GitHub.


#10

I need more help on this. I don’t know what caused this. I can still do npm install for my tree-sitter-manuscript and successfully run tests with

node_modules/.bin/tree-sitter generate && npm install && node_modules/.bin/tree-sitter test

But when I do sudo npm install -g, I get errors:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '-g' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData .
8 silly fetchDirectoryPackageData .
9 silly install normalizeTree
10 silly loadCurrentTree Finishing
11 silly loadIdealTree Starting
12 silly install loadIdealTree
13 silly cloneCurrentTree Starting
14 silly install cloneCurrentTreeToIdealTree
15 silly cloneCurrentTree Finishing
16 silly loadShrinkwrap Starting
17 silly install loadShrinkwrap
18 silly loadShrinkwrap Finishing
19 silly loadAllDepsIntoIdealTree Starting
20 silly install loadAllDepsIntoIdealTree
21 silly resolveWithNewModule tree-sitter-manuscript@0.0.0 checking installable status
22 silly cache add args [ '.', null ]
23 verbose cache add spec .
24 silly cache add parsed spec Result {
24 silly cache add   raw: '.',
24 silly cache add   scope: null,
24 silly cache add   name: null,
24 silly cache add   rawSpec: '.',
24 silly cache add   spec: '/home/xxx/devel/tree-sitter-manuscript',
24 silly cache add   type: 'directory' }
25 verbose addLocalDirectory /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package.tgz not in flight; packing
26 info lifecycle tree-sitter-manuscript@0.0.0~prepublish: tree-sitter-manuscript@0.0.0
27 silly lifecycle tree-sitter-manuscript@0.0.0~prepublish: no script for prepublish, continuing
28 verbose tar pack [ '/home/xxx/.npm/tree-sitter-manuscript/0.0.0/package.tgz',
28 verbose tar pack   '/home/xxx/devel/tree-sitter-manuscript' ]
29 verbose tarball /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package.tgz
30 verbose folder /home/xxx/devel/tree-sitter-manuscript
31 verbose addLocalTarball adding from inside cache /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package.tgz
32 silly cache afterAdd tree-sitter-manuscript@0.0.0
33 verbose afterAdd /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package/package.json not in flight; writing
34 verbose afterAdd /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package/package.json written
35 silly fetchNamedPackageData nan
36 silly mapToRegistry name nan
37 silly mapToRegistry using default registry
38 silly mapToRegistry registry https://registry.npmjs.org/
39 silly mapToRegistry uri https://registry.npmjs.org/nan
40 verbose request uri https://registry.npmjs.org/nan
41 verbose request no auth needed
42 info attempt registry request try #1 at 22:13:18
43 verbose request id 871ae6395b6915ce
44 verbose etag W/"07b67d31eac50b501e4eb4f5b0dcc2f1"
45 verbose lastModified Sat, 25 Aug 2018 12:43:49 GMT
46 http request GET https://registry.npmjs.org/nan
47 http 304 https://registry.npmjs.org/nan
48 verbose headers { date: 'Mon, 24 Sep 2018 20:13:18 GMT',
48 verbose headers   connection: 'keep-alive',
48 verbose headers   'set-cookie':
48 verbose headers    [ '__cfduid=dcae154daa4a6ae63baea9ef00c7789ac1537819998; expires=Tue, 24-Sep-19 20:13:18 GMT; path=/; domain=.registry.npmjs.org; HttpOnly' ],
48 verbose headers   'cf-cache-status': 'HIT',
48 verbose headers   'cache-control': 'max-age=300',
48 verbose headers   'cf-ray': '45f7e92f4aa696ac-FRA',
48 verbose headers   etag: '"07b67d31eac50b501e4eb4f5b0dcc2f1"',
48 verbose headers   'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
48 verbose headers   'last-modified': 'Sat, 25 Aug 2018 12:43:49 GMT',
48 verbose headers   vary: 'accept-encoding, accept',
48 verbose headers   server: 'cloudflare' }
49 silly get cb [ 304,
49 silly get   { date: 'Mon, 24 Sep 2018 20:13:18 GMT',
49 silly get     connection: 'keep-alive',
49 silly get     'set-cookie':
49 silly get      [ '__cfduid=dcae154daa4a6ae63baea9ef00c7789ac1537819998; expires=Tue, 24-Sep-19 20:13:18 GMT; path=/; domain=.registry.npmjs.org; HttpOnly' ],
49 silly get     'cf-cache-status': 'HIT',
49 silly get     'cache-control': 'max-age=300',
49 silly get     'cf-ray': '45f7e92f4aa696ac-FRA',
49 silly get     etag: '"07b67d31eac50b501e4eb4f5b0dcc2f1"',
49 silly get     'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
49 silly get     'last-modified': 'Sat, 25 Aug 2018 12:43:49 GMT',
49 silly get     vary: 'accept-encoding, accept',
49 silly get     server: 'cloudflare' } ]
50 verbose etag https://registry.npmjs.org/nan from cache
51 verbose get saving nan to /home/xxx/.npm/registry.npmjs.org/nan/.cache.json
52 silly resolveWithNewModule nan@2.11.0 checking installable status
53 silly cache add args [ 'nan@^2.11.0', null ]
54 verbose cache add spec nan@^2.11.0
55 silly cache add parsed spec Result {
55 silly cache add   raw: 'nan@^2.11.0',
55 silly cache add   scope: null,
55 silly cache add   name: 'nan',
55 silly cache add   rawSpec: '^2.11.0',
55 silly cache add   spec: '>=2.11.0 <3.0.0',
55 silly cache add   type: 'range' }
56 silly addNamed nan@>=2.11.0 <3.0.0
57 verbose addNamed ">=2.11.0 <3.0.0" is a valid semver range for nan
58 silly addNameRange { name: 'nan', range: '>=2.11.0 <3.0.0', hasData: false }
59 silly mapToRegistry name nan
60 silly mapToRegistry using default registry
61 silly mapToRegistry registry https://registry.npmjs.org/
62 silly mapToRegistry uri https://registry.npmjs.org/nan
63 verbose addNameRange registry:https://registry.npmjs.org/nan not in flight; fetching
64 verbose get https://registry.npmjs.org/nan not expired, no request
65 silly addNameRange number 2 { name: 'nan', range: '>=2.11.0 <3.0.0', hasData: true }
66 silly addNameRange versions [ 'nan',
66 silly addNameRange   [ '0.3.0-wip',
66 silly addNameRange     '0.3.0-wip2',
66 silly addNameRange     '0.3.0',
66 silly addNameRange     '0.3.1',
66 silly addNameRange     '0.3.2',
66 silly addNameRange     '0.4.0',
66 silly addNameRange     '0.4.1',
66 silly addNameRange     '0.4.2',
66 silly addNameRange     '0.4.3',
66 silly addNameRange     '0.4.4',
66 silly addNameRange     '0.5.0',
66 silly addNameRange     '0.5.1',
66 silly addNameRange     '0.5.2',
66 silly addNameRange     '0.6.0',
66 silly addNameRange     '0.7.0',
66 silly addNameRange     '0.7.1',
66 silly addNameRange     '0.8.0',
66 silly addNameRange     '1.0.0',
66 silly addNameRange     '1.1.0',
66 silly addNameRange     '1.1.1',
66 silly addNameRange     '1.1.2',
66 silly addNameRange     '1.2.0',
66 silly addNameRange     '1.3.0',
66 silly addNameRange     '1.4.0',
66 silly addNameRange     '1.4.1',
66 silly addNameRange     '1.5.0',
66 silly addNameRange     '1.4.2',
66 silly addNameRange     '1.4.3',
66 silly addNameRange     '1.5.1',
66 silly addNameRange     '1.5.2',
66 silly addNameRange     '1.6.0',
66 silly addNameRange     '1.5.3',
66 silly addNameRange     '1.6.1',
66 silly addNameRange     '1.6.2',
66 silly addNameRange     '1.7.0',
66 silly addNameRange     '1.8.0',
66 silly addNameRange     '1.8.1',
66 silly addNameRange     '1.8.2',
66 silly addNameRange     '1.8.3',
66 silly addNameRange     '1.8.4',
66 silly addNameRange     '1.9.0',
66 silly addNameRange     '2.0.0',
66 silly addNameRange     '2.0.1',
66 silly addNameRange     '2.0.2',
66 silly addNameRange     '2.0.3',
66 silly addNameRange     '2.0.4',
66 silly addNameRange     '2.0.5',
66 silly addNameRange     '2.0.6',
66 silly addNameRange     '2.0.7',
66 silly addNameRange     '2.0.8',
66 silly addNameRange     '2.0.9',
66 silly addNameRange     '2.1.0',
66 silly addNameRange     '2.2.0',
66 silly addNameRange     '2.2.1',
66 silly addNameRange     '2.3.0',
66 silly addNameRange     '2.3.1',
66 silly addNameRange     '2.3.2',
66 silly addNameRange     '2.3.3',
66 silly addNameRange     '2.3.4',
66 silly addNameRange     '2.3.5',
66 silly addNameRange     '2.4.0',
66 silly addNameRange     '2.5.0',
66 silly addNameRange     '2.5.1',
66 silly addNameRange     '2.6.0',
66 silly addNameRange     '2.6.1',
66 silly addNameRange     '2.6.2',
66 silly addNameRange     '2.7.0',
66 silly addNameRange     '2.8.0',
66 silly addNameRange     '2.9.1',
66 silly addNameRange     '2.9.2',
66 silly addNameRange     '2.10.0',
66 silly addNameRange     '2.11.0' ] ]
67 silly addNamed nan@2.11.0
68 verbose addNamed "2.11.0" is a plain semver version for nan
69 silly cache afterAdd nan@2.11.0
70 verbose afterAdd /home/xxx/.npm/nan/2.11.0/package/package.json not in flight; writing
71 verbose afterAdd /home/xxx/.npm/nan/2.11.0/package/package.json written
72 silly loadAllDepsIntoIdealTree Finishing
73 silly idealTree:prePrune lib
73 silly idealTree:prePrune └─┬ tree-sitter-manuscript@0.0.0
73 silly idealTree:prePrune   └── nan@2.11.0
74 silly loadIdealTree Finishing
75 silly currentTree lib
76 silly idealTree lib
76 silly idealTree └─┬ tree-sitter-manuscript@0.0.0
76 silly idealTree   └── nan@2.11.0
77 silly generateActionsToTake Starting
78 silly install generateActionsToTake
79 silly generateActionsToTake Finishing
80 silly diffTrees action count 2
81 silly diffTrees add nan@2.11.0
82 silly diffTrees add tree-sitter-manuscript@0.0.0
83 silly decomposeActions action count 16
84 silly decomposeActions fetch nan@2.11.0
85 silly decomposeActions extract nan@2.11.0
86 silly decomposeActions test nan@2.11.0
87 silly decomposeActions preinstall nan@2.11.0
88 silly decomposeActions build nan@2.11.0
89 silly decomposeActions install nan@2.11.0
90 silly decomposeActions postinstall nan@2.11.0
91 silly decomposeActions finalize nan@2.11.0
92 silly decomposeActions fetch tree-sitter-manuscript@0.0.0
93 silly decomposeActions extract tree-sitter-manuscript@0.0.0
94 silly decomposeActions test tree-sitter-manuscript@0.0.0
95 silly decomposeActions preinstall tree-sitter-manuscript@0.0.0
96 silly decomposeActions build tree-sitter-manuscript@0.0.0
97 silly decomposeActions install tree-sitter-manuscript@0.0.0
98 silly decomposeActions postinstall tree-sitter-manuscript@0.0.0
99 silly decomposeActions finalize tree-sitter-manuscript@0.0.0
100 silly executeActions Starting
101 silly install executeActions
102 silly doSerial global-install 0
103 silly doParallel fetch 2
104 verbose lock using /home/xxx/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
105 silly doParallel extract 2
106 silly extract nan@2.11.0
107 silly extract tree-sitter-manuscript@0.0.0
108 verbose unbuild lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
109 verbose unbuild lib/node_modules/.staging/nan-bd669914
110 silly gentlyRm /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd is being purged from base /usr/local
111 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
112 verbose tar unpack /home/xxx/.npm/tree-sitter-manuscript/0.0.0/package.tgz
113 verbose tar unpacking to /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
114 silly gentlyRm /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd is being purged
115 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
116 silly gentlyRm /usr/local/lib/node_modules/.staging/nan-bd669914 is being purged from base /usr/local
117 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/nan-bd669914
118 silly gunzTarPerm modes [ '755', '644' ]
119 verbose tar unpack /home/xxx/.npm/nan/2.11.0/package.tgz
120 verbose tar unpacking to /usr/local/lib/node_modules/.staging/nan-bd669914
121 silly gentlyRm /usr/local/lib/node_modules/.staging/nan-bd669914 is being purged
122 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/nan-bd669914
123 silly gunzTarPerm modes [ '755', '644' ]
124 silly gunzTarPerm extractEntry package.json
125 silly gunzTarPerm extractEntry package.json
126 silly gunzTarPerm modified mode [ 'package.json', 436, 420 ]
127 silly gunzTarPerm extractEntry .npmignore
128 silly gunzTarPerm extractEntry README.md
129 silly gunzTarPerm extractEntry CHANGELOG.md
130 silly gunzTarPerm modified mode [ 'CHANGELOG.md', 436, 420 ]
131 silly gunzTarPerm extractEntry include_dirs.js
132 silly gunzTarPerm modified mode [ 'include_dirs.js', 436, 420 ]
133 silly gunzTarPerm extractEntry LICENSE
134 silly gunzTarPerm extractEntry grammar.js
135 silly gunzTarPerm extractEntry LICENSE.md
136 silly gunzTarPerm modified mode [ 'LICENSE.md', 436, 420 ]
137 silly gunzTarPerm extractEntry nan_callbacks_12_inl.h
138 silly gunzTarPerm modified mode [ 'nan_callbacks_12_inl.h', 436, 420 ]
139 silly gunzTarPerm extractEntry nan_callbacks_pre_12_inl.h
140 silly gunzTarPerm modified mode [ 'nan_callbacks_pre_12_inl.h', 436, 420 ]
141 silly gunzTarPerm extractEntry nan_callbacks.h
142 silly gunzTarPerm modified mode [ 'nan_callbacks.h', 436, 420 ]
143 silly gunzTarPerm extractEntry index.js
144 silly gunzTarPerm extractEntry corpus/expressions.txt
145 silly gunzTarPerm extractEntry nan_converters_43_inl.h
146 silly gunzTarPerm modified mode [ 'nan_converters_43_inl.h', 436, 420 ]
147 silly gunzTarPerm extractEntry nan_converters_pre_43_inl.h
148 silly gunzTarPerm modified mode [ 'nan_converters_pre_43_inl.h', 436, 420 ]
149 silly gunzTarPerm extractEntry corpus/statements.txt
150 silly gunzTarPerm extractEntry nan_converters.h
151 silly gunzTarPerm modified mode [ 'nan_converters.h', 436, 420 ]
152 silly gunzTarPerm extractEntry nan_define_own_property_helper.h
153 silly gunzTarPerm modified mode [ 'nan_define_own_property_helper.h', 436, 420 ]
154 silly gunzTarPerm extractEntry binding.gyp
155 silly gunzTarPerm extractEntry nan_implementation_12_inl.h
156 silly gunzTarPerm modified mode [ 'nan_implementation_12_inl.h', 436, 420 ]
157 silly gunzTarPerm extractEntry nan_implementation_pre_12_inl.h
158 silly gunzTarPerm modified mode [ 'nan_implementation_pre_12_inl.h', 436, 420 ]
159 silly gunzTarPerm extractEntry nan_json.h
160 silly gunzTarPerm modified mode [ 'nan_json.h', 436, 420 ]
161 silly gunzTarPerm extractEntry nan_maybe_43_inl.h
162 silly gunzTarPerm modified mode [ 'nan_maybe_43_inl.h', 436, 420 ]
163 silly gunzTarPerm extractEntry nan_maybe_pre_43_inl.h
164 silly gunzTarPerm modified mode [ 'nan_maybe_pre_43_inl.h', 436, 420 ]
165 silly gunzTarPerm extractEntry nan_new.h
166 silly gunzTarPerm modified mode [ 'nan_new.h', 436, 420 ]
167 silly gunzTarPerm extractEntry nan_object_wrap.h
168 silly gunzTarPerm modified mode [ 'nan_object_wrap.h', 436, 420 ]
169 silly gunzTarPerm extractEntry nan_persistent_12_inl.h
170 silly gunzTarPerm modified mode [ 'nan_persistent_12_inl.h', 436, 420 ]
171 silly gunzTarPerm extractEntry nan_persistent_pre_12_inl.h
172 silly gunzTarPerm modified mode [ 'nan_persistent_pre_12_inl.h', 436, 420 ]
173 silly gunzTarPerm extractEntry nan_private.h
174 silly gunzTarPerm modified mode [ 'nan_private.h', 436, 420 ]
175 silly gunzTarPerm extractEntry nan_string_bytes.h
176 silly gunzTarPerm modified mode [ 'nan_string_bytes.h', 436, 420 ]
177 silly gunzTarPerm extractEntry nan_typedarray_contents.h
178 silly gunzTarPerm modified mode [ 'nan_typedarray_contents.h', 436, 420 ]
179 silly gunzTarPerm extractEntry nan_weak.h
180 silly gunzTarPerm modified mode [ 'nan_weak.h', 436, 420 ]
181 silly gunzTarPerm extractEntry nan.h
182 silly gunzTarPerm modified mode [ 'nan.h', 436, 420 ]
183 silly gunzTarPerm extractEntry README.md
184 silly gunzTarPerm modified mode [ 'README.md', 436, 420 ]
185 silly gentlyRm /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd/node_modules is being purged
186 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd/node_modules
187 silly gunzTarPerm extractEntry doc/asyncworker.md
188 silly gunzTarPerm modified mode [ 'doc/asyncworker.md', 436, 420 ]
189 silly gunzTarPerm extractEntry doc/buffers.md
190 silly gunzTarPerm modified mode [ 'doc/buffers.md', 436, 420 ]
191 silly gunzTarPerm extractEntry doc/callback.md
192 silly gunzTarPerm modified mode [ 'doc/callback.md', 436, 420 ]
193 silly gunzTarPerm extractEntry doc/converters.md
194 silly gunzTarPerm modified mode [ 'doc/converters.md', 436, 420 ]
195 silly gunzTarPerm extractEntry doc/errors.md
196 silly gunzTarPerm modified mode [ 'doc/errors.md', 436, 420 ]
197 silly gunzTarPerm extractEntry doc/json.md
198 silly gunzTarPerm modified mode [ 'doc/json.md', 436, 420 ]
199 silly gunzTarPerm extractEntry doc/maybe_types.md
200 silly gunzTarPerm modified mode [ 'doc/maybe_types.md', 436, 420 ]
201 silly gunzTarPerm extractEntry doc/methods.md
202 silly gunzTarPerm modified mode [ 'doc/methods.md', 436, 420 ]
203 silly gunzTarPerm extractEntry doc/new.md
204 silly gunzTarPerm modified mode [ 'doc/new.md', 436, 420 ]
205 silly gunzTarPerm extractEntry doc/node_misc.md
206 silly gunzTarPerm modified mode [ 'doc/node_misc.md', 436, 420 ]
207 silly gunzTarPerm extractEntry doc/object_wrappers.md
208 silly gunzTarPerm modified mode [ 'doc/object_wrappers.md', 436, 420 ]
209 silly gunzTarPerm extractEntry doc/persistent.md
210 silly gunzTarPerm modified mode [ 'doc/persistent.md', 436, 420 ]
211 silly gunzTarPerm extractEntry doc/scopes.md
212 silly gunzTarPerm modified mode [ 'doc/scopes.md', 436, 420 ]
213 silly gunzTarPerm extractEntry doc/script.md
214 silly gunzTarPerm modified mode [ 'doc/script.md', 436, 420 ]
215 silly gunzTarPerm extractEntry doc/string_bytes.md
216 silly gunzTarPerm modified mode [ 'doc/string_bytes.md', 436, 420 ]
217 silly gunzTarPerm extractEntry doc/v8_internals.md
218 silly gunzTarPerm modified mode [ 'doc/v8_internals.md', 436, 420 ]
219 silly gunzTarPerm extractEntry doc/v8_misc.md
220 silly gunzTarPerm modified mode [ 'doc/v8_misc.md', 436, 420 ]
221 silly gunzTarPerm extractEntry tools/1to2.js
222 silly gunzTarPerm modified mode [ 'tools/1to2.js', 509, 493 ]
223 silly gunzTarPerm extractEntry tools/package.json
224 silly gunzTarPerm modified mode [ 'tools/package.json', 436, 420 ]
225 silly gunzTarPerm extractEntry tools/README.md
226 silly gunzTarPerm modified mode [ 'tools/README.md', 436, 420 ]
227 silly gentlyRm /usr/local/lib/node_modules/.staging/nan-bd669914/node_modules is being purged
228 verbose gentlyRm don't care about contents; nuking /usr/local/lib/node_modules/.staging/nan-bd669914/node_modules
229 silly doParallel preinstall 2
230 silly preinstall nan@2.11.0 /usr/local/lib/node_modules/.staging/nan-bd669914
231 info lifecycle nan@2.11.0~preinstall: nan@2.11.0
232 silly preinstall tree-sitter-manuscript@0.0.0 /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
233 info lifecycle tree-sitter-manuscript@0.0.0~preinstall: tree-sitter-manuscript@0.0.0
234 silly lifecycle nan@2.11.0~preinstall: no script for preinstall, continuing
235 silly lifecycle tree-sitter-manuscript@0.0.0~preinstall: no script for preinstall, continuing
236 silly doReverseSerial remove 0
237 silly doSerial move 0
238 silly doSerial finalize 2
239 silly finalize /usr/local/lib/node_modules/tree-sitter-manuscript/node_modules/nan
240 silly finalize /usr/local/lib/node_modules/tree-sitter-manuscript
241 silly doSerial build 2
242 silly build nan@2.11.0
243 info linkStuff nan@2.11.0
244 silly linkStuff nan@2.11.0 has /usr/local/lib/node_modules/tree-sitter-manuscript/node_modules as its parent node_modules
245 silly linkStuff nan@2.11.0 is part of a global install
246 silly linkStuff nan@2.11.0 is installed into a global node_modules
247 verbose linkBins nan@2.11.0
248 verbose linkMans nan@2.11.0
249 silly build tree-sitter-manuscript@0.0.0
250 info linkStuff tree-sitter-manuscript@0.0.0
251 silly linkStuff tree-sitter-manuscript@0.0.0 has /usr/local/lib/node_modules as its parent node_modules
252 silly linkStuff tree-sitter-manuscript@0.0.0 is part of a global install
253 silly linkStuff tree-sitter-manuscript@0.0.0 is installed into a global node_modules
254 silly linkStuff tree-sitter-manuscript@0.0.0 is installed into the top-level global node_modules
255 verbose linkBins tree-sitter-manuscript@0.0.0
256 verbose linkMans tree-sitter-manuscript@0.0.0
257 silly doSerial global-link 0
258 silly doParallel update-linked 0
259 silly doSerial install 2
260 silly install nan@2.11.0 /usr/local/lib/node_modules/.staging/nan-bd669914
261 info lifecycle nan@2.11.0~install: nan@2.11.0
262 silly lifecycle nan@2.11.0~install: no script for install, continuing
263 silly install tree-sitter-manuscript@0.0.0 /usr/local/lib/node_modules/.staging/tree-sitter-manuscript-53c724fd
264 info lifecycle tree-sitter-manuscript@0.0.0~install: tree-sitter-manuscript@0.0.0
265 verbose lifecycle tree-sitter-manuscript@0.0.0~install: unsafe-perm in lifecycle false
266 verbose lifecycle tree-sitter-manuscript@0.0.0~install: PATH: /usr/share/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/tree-sitter-manuscript/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
267 verbose lifecycle tree-sitter-manuscript@0.0.0~install: CWD: /usr/local/lib/node_modules/tree-sitter-manuscript
268 silly lifecycle tree-sitter-manuscript@0.0.0~install: Args: [ '-c', 'node-gyp rebuild' ]
269 silly lifecycle tree-sitter-manuscript@0.0.0~install: Returned: code: 1  signal: null
270 info lifecycle tree-sitter-manuscript@0.0.0~install: Failed to exec install script
271 verbose unlock done using /home/xxx/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
272 silly rollbackFailedOptional Starting
273 silly rollbackFailedOptional Finishing
274 silly runTopLevelLifecycles Starting
275 silly runTopLevelLifecycles Finishing
276 silly install printInstalled
277 verbose stack Error: tree-sitter-manuscript@0.0.0 install: `node-gyp rebuild`
277 verbose stack Exit status 1
277 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
277 verbose stack     at emitTwo (events.js:126:13)
277 verbose stack     at EventEmitter.emit (events.js:214:7)
277 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
277 verbose stack     at emitTwo (events.js:126:13)
277 verbose stack     at ChildProcess.emit (events.js:214:7)
277 verbose stack     at maybeClose (internal/child_process.js:925:16)
277 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
278 verbose pkgid tree-sitter-manuscript@0.0.0
279 verbose cwd /home/xxx/devel/tree-sitter-manuscript
280 error Linux 4.15.0-34-generic
281 error argv "/usr/bin/node" "/usr/bin/npm" "install" "-g"
282 error node v8.10.0
283 error npm  v3.5.2
284 error code ELIFECYCLE
285 error tree-sitter-manuscript@0.0.0 install: `node-gyp rebuild`
285 error Exit status 1
286 error Failed at the tree-sitter-manuscript@0.0.0 install script 'node-gyp rebuild'.
286 error Make sure you have the latest version of node.js and npm installed.
286 error If you do, this is most likely a problem with the tree-sitter-manuscript package,
286 error not with npm itself.
286 error Tell the author that this fails on your system:
286 error     node-gyp rebuild
286 error You can get information on how to open an issue for this project with:
286 error     npm bugs tree-sitter-manuscript
286 error Or if that isn't available, you can get their info via:
286 error     npm owner ls tree-sitter-manuscript
286 error There is likely additional logging output above.
287 verbose exit [ 1, true ]

When I try to do npm install for language-manuscript, I also get errors, even if I change the dependency path to tree-sitter-manuscript in my home folder where things still work.

Any help is very appreciated.


#11

Turns out I have to remove src from my .gitignore file. I didn’t expect npm to even care about the .gitignore file.

However, the problem with editing that I described above remains.


#12

Updating to Atom 1.31 solved the problem.