language-javascript-semantic icon indicating copy to clipboard operation
language-javascript-semantic copied to clipboard

Semantic Highlighter not working in latest build of Atom? 1.0.11

Open sylvesterworks opened this issue 10 years ago • 4 comments
trafficstars

I just updated my Atom version from 1.0.7 (i think) to 1.0.11, and lost the semantic highlighting in the process. no other packages seem to be affected. I restarted my machine, restarted Atom multiple times, event attempted to run with Shadow DOM off.

sylvesterworks avatar Sep 09 '15 23:09 sylvesterworks

Apparently, Atom modified its internal line representation again. I'm getting tired of adapting my code to match an ever-changing, poorly documented internal format. Please add your voice to https://github.com/atom/atom/issues/8669 and push for a proper API that will enable packages like this to become stable and reliable.

p-e-w avatar Sep 12 '15 06:09 p-e-w

I agree. It's very frustrating. My Package jumpy greatly slowed down recently due to the tiling changes. (It's broken countless times before from changes, although more stable now). I know we're supposed to really stick strictly to the API and less DOM manip, but I mean that's part of the appeal of doing a web tech Editor right? For example, I pretty much have to utilize markers/decorations now. That's cool, I was already using it in my new one, so I know how, but that I have to is a little weird.

BTW, I'm currently working on something very similar to this. A friend pointed me to your project here :) !!! Here's a link if you're curious: https://github.com/DavidLGoldberg/qolor

Really big shame I can't use your highlighter now :-( (working on some Redux stuff, and it's probably the PERFECT use case heh) I've clicked subscribe to get notified when it's fixed, but let me know if you think I can help!

Few other things:

  • I have to go through your architecture for ideas :) Although, I don't have a parser like Acorn so I just kind of hacked up an MVP :\
  • I'm going to steal your "Prior Art" Section of the readme hope you don't mind (and add yours of course)

DavidLGoldberg avatar Nov 07 '15 00:11 DavidLGoldberg

latest error with the package is has something to do with building, and with oniguruma. i've seen a bunch of other people adding their voice over the past few months to atom/atom#8669, but things are still not working on my end. debug included in case it helps.

In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: ../node_modules/nan/nan.h:260:25: error: redefinition of '_NanEnsureLocal' NAN_INLINE v8::Local<T> NanEnsureLocal(v8::Local<T> val) { ^ ../node_modules/nan/nan.h:255:25: note: previous definition is here NAN_INLINE v8::Local<T> NanEnsureLocal(v8::Handle<T> val) { ^ ../node_modules/nan/nan.h:660:13: error: no member named 'smalloc' in namespace 'node' , node::smalloc::FreeCallback callback ~~~~~~^ ../node_modules/nan/nan.h:671:12: error: no matching function for call to 'New' return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); ^~~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node_buffer.h:41:40: note: candidate function not viable: no known conversion from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node_buffer.h:53:40: note: candidate function not viable: 2nd argument ('const char ') would lose const qualifier NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate isolate, ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node_buffer.h:38:40: note: candidate function not viable: requires 2 arguments, but 3 were provided NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, size_t length); ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node_buffer.h:46:40: note: candidate function not viable: requires 5 arguments, but 3 were provided NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, ^ In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: ../node_modules/nan/nan.h:675:12: error: no viable conversion from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' return node::Buffer::New(v8::Isolate::GetCurrent(), size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::MaybeLocalv8::Object' to 'const v8::Localv8::Object &' for 1st argument class Local { ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object &&' for 1st argument class Local { ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:214:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal' V8_INLINE Local(Local<S> that) ^ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:326:13: note: candidate template ignored: could not match 'S ' against 'v8::MaybeLocalv8::Object' V8_INLINE Local(S that) ^ In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: ../node_modules/nan/nan.h:682:26: error: no member named 'Use' in namespace 'node::Buffer' return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); ~~~~~~~~~~~~~~^ In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: In file included from ../node_modules/nan/nan.h:24: In file included from /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node.h:42: /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible type 'v8::Value *' TYPE_CHECK(T, S); ^~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:180:37: note: expanded from macro 'TYPE_CHECK' (static_cast<T volatile>(0)) = static_cast<S>(0);
^ ~~~~~~~~~~~~~~~~~~ ../node_modules/nan/nan.h:413:12: note: in instantiation of function template specialization 'v8::Localv8::Primitive::Localv8::Value' requested here return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent()))); ^ ../node_modules/nan/nan.h:397:30: note: expanded from macro 'NanEscapeScope'

define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))

                         ^

In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: In file included from ../node_modules/nan/nan.h:24: In file included from /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node.h:42: /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:221:5: error: assigning to 'v8::Boolean volatile' from incompatible type 'v8::Value *' TYPE_CHECK(T, S); ^~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:180:37: note: expanded from macro 'TYPE_CHECK' *(static_cast<T volatile_>(0)) = static_cast<S_>(0);
^ ~~~~~~~~~~~~~~~~~~ ../node_modules/nan/nan.h:423:12: note: in instantiation of function template specialization 'v8::Localv8::Boolean::Localv8::Value' requested here return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent()))); ^ ../node_modules/nan/nan.h:397:30: note: expanded from macro 'NanEscapeScope'

define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))

                         ^

In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: In file included from ../node_modules/nan/nan.h:24: In file included from /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node.h:42: /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:221:5: error: assigning to 'v8::Function volatile' from incompatible type 'v8::Value *' TYPE_CHECK(T, S); ^~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:180:37: note: expanded from macro 'TYPE_CHECK' *(static_cast<T volatile_>(0)) = static_cast<S_>(0);
^ ~~~~~~~~~~~~~~~~~~ ../node_modules/nan/nan.h:1513:12: note: in instantiation of function template specialization 'v8::Localv8::Function::Localv8::Value' requested here return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex) ^ ../node_modules/nan/nan.h:397:30: note: expanded from macro 'NanEscapeScope'

define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))

                         ^

In file included from ../src/onig-cache.cc:1: In file included from ../src/onig-cache.h:4: In file included from ../src/onig-reg-exp.h:7: In file included from ../node_modules/nan/nan.h:24: In file included from /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/src/node.h:42: /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:221:5: error: assigning to 'v8::Object volatile' from incompatible type 'v8::Value *' TYPE_CHECK(T, S); ^~~~~~~~~~~~~~~~ /Users/josh/.atom/.node-gyp/.node-gyp/0.34.3/deps/v8/include/v8.h:180:37: note: expanded from macro 'TYPE_CHECK' *(static_cast<T volatile_>(0)) = static_cast<S_>(0);
^ ~~~~~~~~~~~~~~~~~~ ../node_modules/nan/nan.h:1631:12: note: in instantiation of function template specialization 'v8::Localv8::Object::Localv8::Value' requested here return NanEscapeScope(handle->Get(NanNew(key)).Asv8::Object()); ^ ../node_modules/nan/nan.h:397:30: note: expanded from macro 'NanEscapeScope'

define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))

                         ^

9 errors generated. make: *** [Release/obj.target/onig_scanner/src/onig-cache.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12) gyp ERR! System Darwin 15.0.0 gyp ERR! command "node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/josh/.atom/packages/language-javascript-semantic/node_modules/first-mate/node_modules/oniguruma gyp ERR! node -v v0.10.40 gyp ERR! node-gyp -v v2.0.2 gyp ERR! not ok

npm ERR! Darwin 15.0.0 npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/josh/.atom/.apm/.apmrc" "--userconfig" "/Users/josh/.atom/.apmrc" "rebuild" "--target=0.34.3" "--arch=x64" npm ERR! node v0.10.40 npm ERR! npm v2.13.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the oniguruma package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls oniguruma npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/josh/.atom/packages/language-javascript-semantic/npm-debug.log

sylvesterworks avatar Dec 16 '15 23:12 sylvesterworks

Atom.io updated to 1.4.1 - and the default colors for js highlighting (i think that came as part of 1.4.0) are even worse than before. atom.io is really screwing the pooch here... i miss the semantic highlighter more and more.

at current, i'm still on v0.2.1 of the language-javascript-semantic, with no errors to report, no errors being reported that i can tell, yet it's still not working. i've tried uninstalling and reinstalling to no avail.

i've done as others have suggested in #33 and updated my config.cson file to include the customFileTypes setting, which also does nothing to help the situation.

  core:
    customFileTypes:
      "source.js-semantic": [
        "js"
      ]
   ...

still no semantic highlighting, and enduring crappy atom.io highlighting... which seems to thing everything should be one of 5 colors lately... which is painful to look at.

edit nevermind - i noticed the little red icon in the bottom of the atom window, which prompted a rebuild of the package, which was actually successful. then reloading Atom, and highlighting is back. cheer!

sylvesterworks avatar Jan 26 '16 21:01 sylvesterworks