Closed drom closed 4 years ago
What would the effective change be for these features you're talking about?
I did not quite get your question. If you are asking:
Tree-sitter is the full parser, so it sees the correct structure of the source file instead of RegExp guess about the structure. More about tree-sitter can be found here: http://tree-sitter.github.io/tree-sitter/ In fact most of Atom language highlighters already use tree-sitter https://github.com/drom/awesome-tree-sitter
You can see in my repo here: https://github.com/drom/language-verilog I can prepare PR if you are interested.
Tree-sitter is the full parser, so it sees the correct structure of the source file instead of RegExp guess about the structure.
I can prepare PR if you are interested.
Sounds great; please do!
Failed to load a language-systemverilog package grammar
Cannot find module './build/Release/tree_sitter_verilog_binding' in /Users/my_username/.atom/packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson
I'm not sure what to make of that. I made your changes, updated the dependencies, and now I'm seeing that error
Have you run apm rebuild
?
Yep, that's post-rebuild. Pre-rebuild I was getting a dependency problem from tree-sitter-verilog
Yep, I have not tested it under Windows :(
Me either; I'm on MacOS
do you have g++ installed somewhere?
Yep
could you try installing tree-sitter-verilog
by itself?
Like npm i tree-sitter-verilog
The module '/[...]/language-systemverilog/node_modules/tree-sitter-verilog/build/Release/tree_sitter_verilog_binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 64. Please try re-compiling or re-installing the module (for instance, using
npm rebuild
ornpm install
). in /Users/my_username/.atom/packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson
It's a different error at least, so we're probably moving in the right direction
node --version
?
v12.6.0
atom --version
?
Atom : 1.39.1 Electron: 3.1.10 Chrome : 66.0.3359.181 Node : 10.2.0
you need node v10.
nvm i 10
https://github.com/nvm-sh/nvm
😂😂
I thought "Ah nice everything's working now" but then the window didn't respond and eventually showed that ^
apm rebuild
Same problem I'm afraid
nvm i 10 gave me v10.16.0. I then tried nvm i 10.2.0 to match Atom's npm version exactly and got the following:
> npm i tree-sitter-verilog
> tree-sitter-verilog@0.16.0 install /[...]/language-systemverilog/node_modules/tree-sitter-verilog
> node bin/install.js
build
In file included from ../src/binding.cc:2:
/Users/peter/.node-gyp/10.2.0/include/node/node.h:53:10: fatal error: 'core.h' file not found
#include "core.h" // NOLINT(build/include_order)
^~~~~~~~
1 error generated.
make: *** [Release/obj.target/tree_sitter_verilog_binding/src/binding.o] Error 1
gyp
ERR! build error
gyp
ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/[...]/.nvm/versions/node/v10.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp
ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR!
stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR!
System Darwin 18.7.0
gyp ERR! command "/[...]/.nvm/versions/node/v10.2.0/bin/node" "/[...]/.nvm/versions/node/v10.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /[...]/language-systemverilog/node_modules/tree-sitter-verilog
gyp ERR!
node -v v10.2.0
gyp ERR! node-gyp -v v3.6.2
gyp
ERR! not ok
done
+ tree-sitter-verilog@0.16.0
updated 1 package in 15.903s
You need newer Node 10. nvm i 10
nvm i 10.16.0
?
Yep that's what I did the first time; that's when Atom crashed. Then I noticed the version mismatch and thought maybe going to 10.2.0 would solve it. Guess not
How did you installed my branch of the plugin?
apm -d link
?
do you run atom -d
?
apm link
. Didn't use the -d flag though
Try dev mode: apm link -d
then atom -d
-d isn't accepted as a valid flag on MacOS's apm. atom -d
does work, however
apm link -d
apm link -d
then atom -d
: it's crashing even sooner now; before it would open the GUI and it looked like I could just start typing. Now it opens a blank window and hangs for a while before showing that "crashed" dialog
apm rebuild
?
Same problem I'm afraid
ll ~/.atom/dev/packages/
lrwxr-xr-x 1 my_username staff 48 Jul 27 13:08 language-systemverilog -> /Users/my_username/scratch/language-systemverilog/
cd ~/.atom/dev/packages/language-systemverilog/
rm -rf node_modules/ package-lock.json
apm rebuild
atom -d
Failed to load a language-systemverilog package grammar
Cannot find module 'tree-sitter-verilog' in /Users/my_username/.atom/dev/packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson
cd ~/.atom/dev/packages/language-systemverilog/
git pull
rm -rf node_modules/ package-lock.json
nvm i 10
npm i
apm link -d
apm rebuild
atom -d
It runs through everything without problems but then when the GUI opens it hangs with a blank screen for a while before showing the "crashed" dialog
https://flight-manual.atom.io/hacking-atom/sections/debugging/
I like the idea of having an exact grammar parser rather than some regex matching but for now I'm going to leave it alone in favor of some higher-priority items on my TODO list.
Sure. Will try later.
@pistoletpierre I have installed it on MacOS ; Atom v1.40.1 without a problem. Could you give it a try again?
Same problem I'm afraid. apm link -d && apm install && atom -d: I get the output pasted below. If I try the nvm+npm stuff it crashes the editor and shows a dialog like the screencap I put in this response: https://github.com/pistoletpierre/language-systemverilog/issues/4#issuecomment-515698005.
Atom: 1.40.1 x64 Electron: 3.1.10 OS: Mac OS X 10.14.6 Thrown From: language-systemverilog package 0.12.2
Failed to load a language-systemverilog package grammar
At Cannot find module './build/Release/tree_sitter_verilog_binding' in ~/.atom/dev/packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson
Error: Cannot find module './build/Release/tree_sitter_verilog_binding'
at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._resolveFilename (/app.asar/src/module-cache.js:336:28)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (/app.asar/src/native-compile-cache.js:68:27)
at Object.<anonymous> (~/Dropbox/Code/language_systemverilog_treesitter/language-systemverilog/node_modules/tree-sitter-verilog/index.js:2:20)
at Object.<anonymous> (~/Dropbox/Code/language_systemverilog_treesitter/language-systemverilog/node_modules/tree-sitter-verilog/index.js:15:3)
at Module._compile (/app.asar/src/native-compile-cache.js:121:30)
at /app.asar/src/compile-cache.js:255:23)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (/app.asar/src/native-compile-cache.js:68:27)
at /app.asar/src/tree-sitter-grammar.js:61:27)
at GrammarRegistry.createGrammar (/app.asar/src/grammar-registry.js:604:14)
at CSON.readFile (/app.asar/src/grammar-registry.js:583:29)
at /app.asar/node_modules/season/lib/cson.js:219:59
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:440:3)
at /packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson:1:1
Hi, I have developed SystemVerilog 2017 parser: https://github.com/tree-sitter/tree-sitter-verilog Based on GitHub's Tree-Sitter parser generator infrastructure: http://tree-sitter.github.io/tree-sitter I also have SystemVerilog language plugin here: https://github.com/drom/language-verilog I would love to merge these features into your plugin.