Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Failed installations of tree-sitter grammars on Windows #22675

@tmatijevich

Description

@tmatijevich

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?

Steps to Reproduce

  1. Clone or Install language-hclrs to %userprofile%\.atom\packages
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions