-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Failed installations of tree-sitter grammars on Windows #22675
Description
Description
Language packages with exclusive tree-sitter parsers (type: 'tree-sitter' in grammars/mylanguage.cson) are unable to successfully install on Windows.
Failed to load a language-mylanguage package grammer
Cannot find module 'tree-sitter-mylanguage'
This can be observed with any community tree-sitter grammar package, such as:
Atom core packages seem to contain both the newer tree-sitter grammar file and older legacy (textmate) grammar file. It is possible that these core packages are defaulting to the legacy grammar when Windows users do not have node/node-gyp/tree-sitter installed? If so, how do you use tree-sitter grammars on windows?
- atom/language-c
grammars/c.csongrammars/tree-sitter-c.cson
- atom/language-javascript
grammars/javascript.csongrammars/tree-sitter-javascript.cson
Steps to Reproduce
- Clone or Install language-hclrs to
%userprofile%\.atom\packages - Launch Atom
Expected behavior:
Atom launches with the installed packages.
Actual behavior:
Failed to load package grammar. This has happened to me for every community package with a tree-sitter grammar.
Stack Trace
Failed to load a language-hclrs package grammar.
At Cannot find module 'tree-sitter-hclrs'
Require stack:
- C:\Users\b\.atom\packages\language-hclrs\grammars\hclrs.cson in C:\Users\b\.atom\packages\language-hclrs\grammars\hclrs.cson
Error: Cannot find module 'tree-sitter-hclrs'
Require stack:
- C:\Users\b\.atom\packages\language-hclrs\grammars\hclrs.cson
at Module._resolveFilename (internal/modules/cjs/loader.js:797:17)
at o._resolveFilename (electron/js2c/renderer_init.js:43:689)
at Function.get_Module._resolveFilename (~/AppData/Local/atom/app-1.56.0/resources/app/static/<embedded>:11:157820)
at new TreeSitterGrammar (~/AppData/Local/atom/app-1.56.0/resources/app/static/<embedded>:11:3408385)
at GrammarRegistry.createGrammar (~/AppData/Local/atom/app-1.56.0/resources/app/static/<embedded>:11:362405)
at ~/AppData/Local/atom/app-1.56.0/resources/app/static/<embedded>:11:362246
at ~/AppData/Local/atom/app-1.56.0/resources/app/static/<embedded>:11:584869
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
at /packages/language-hclrs/grammars/hclrs.cson:1:1
Non-Core Packages
Delete-Whitelines 0.6.4
highlight-selected 0.17.0
language-as-structured-text 0.2.2
language-batchfile 0.7.5
language-hclrs 0.0.1
language-ignore 1.8.0
language-matlab 0.2.1
language-matlab-octave 1.0.5
minimap 4.39.10
minimap-find-and-replace 5.0.8
minimap-highlight-selected 4.6.5
multi-cursor 3.0.0
sort-lines 0.19.0
split-diff 1.6.1
tabs-to-spaces 1.0.5
zentabs 0.8.9
Reproduces how often:
100%
Versions
Atom : 1.56.0
Electron: 9.4.4
Chrome : 83.0.4103.122
Node : 12.14.1
Windows Home/Pro/Enterprise
Additional Information
Is it a prerequisite to install node, node-gyp (windows build tools) in order to use Atom tree-sitter grammars on Windows downloaded from atom.io/packages?
Here is the log when trying to install language-tree-test from Settings -> Install
2021-06-30T01_44_59_486Z-debug.log