Giter VIP home page Giter VIP logo

ac-js2's People

Contributors

dgutov avatar patapizza avatar purcell avatar raxod502 avatar scottyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ac-js2's Issues

Support company mode

It would be good to support company mode as well as auto-complete. The best idea so far is to remove auto-complete as a dependency with options to add either auto-complete or company mode front ends. Need to investigate the format required for a company mode backend before refactoring.

auto-completion not available with company-mode

I have no auto-completion with company. I write something like document. and then I wait for suggestions but I get none.

I'm using company 20150301.1814 from MELPA and js2-mode 20150301.337 from MELPA. Running GNU Emacs 24.4.1 (i686-pc-linux-gnu, GTK+ Version 3.14.7) of 2015-01-17 on bisson

Completion not showing function parameters.

Following the instructions to install ac-j2, I am able to get a popup showing functions names (which match what I've typed), which is great. But I'm not able to get the completion popup to show the functions' parameters.

Is there something I can try to debug and see why this is not happening?

BUG document.(complete) type error FIX

    buildCandidates = function(obj, items) { 

         if (obj["__lookupGetter__"] && ((obj.__lookupGetter__(key) || obj.__lookupSetter__(key)))) {
           var proto = obj.__lookupGetter__(key) || obj.__lookupSetter__(key); // test in moz 31.0
           values[key] = proto.toString();
       } else if (Object.prototype.toString.call(obj[key]) === "[object Function]") {

                values[key] = obj[key].toString();
            } else if (typeof obj[key] === "object"){

Completion fails sporadically

With the example code from the screenshot:

var moreMaths = {};

moreMaths.product = function(num1, num2) {
  return num1 * num2;
};

moreMaths.divide = function(numerator, denominator) {
  return numerator / denominator;
};

var someMath = math();

moreMaths.|
  1. Place point at |, press C-M-i => completion buffer pops up with expected contents, including product and divide.
  2. Type d, press C-M-i again => it completes to "document".
  3. backward-kill-word, type d again, press C-M-i => there's like 30% chance it will complete to divide, otherwise it will be document.
  4. Similarly with modeMaths.di, it will either say no match, or complete to divide, with the same buffer contents.

completion-at-point calls the completion function several times during one completion command, so maybe we're sometimes getting the response for the previous request, or something. EDIT: Nope, I can reproduce the same problem with calling (ac-js2-candidates) directly, or with my company back-end.

I tracked it down to ac-js2-get-object-properties, and yes, it returns different completion lists for the same value of name.

BUG document.Math. (complete) ac-js2-build-prop-name-list error: (wrong-type-argument arrayp )

(defun ac-js2-find-property (list-names)
  "Find the property definition that consists of LIST-NAMES.
Supports navigation to 'foo.bar = 3' and 'foo = {bar: 3}'."
  (catch 'prop-found
    (js2-visit-ast-root
     js2-mode-ast
     (lambda (node endp)
       (let ((parent (js2-node-parent node)))
         (unless endp
           (if (or (and (js2-prop-get-node-p node)
                    (not (or (js2-elem-get-node-p parent) (js2-call-node-p parent)))
                    ;;error: arrayp 
;;                    (equal list-names (ac-js2-build-prop-name-list node))
                    t
                    )
                   (and (js2-name-node-p node)
                        (js2-object-prop-node-p parent)
                        (string= (js2-name-node-name node)
                                 (first list-names))))
               (throw 'prop-found node))
           t))))))

Error (void-variable for)

My setup works pretty good except for this little detail, this keeps showing up, this just happens with ac-js2. Anyone knows how to fix this?

image

Here is the stacktrace...
image

Add an option to avoid continually reparsing

js2 provides an idle timer option that makes possible a more terse linting:

mooz/js2-mode#29

But ac-js2 plays bad with it as it's continually forcing a new reparse. Please add an option to supress this behavior, I don't care the AST to be a bit outdated but I do care about the distracting spurious messages the reparsing is triggering.

Doesn’t work with variable names with underscores

ac-js2 thinks an underscore isn’t part of a variable name. Changing (bounds-of-thing-at-point 'word) to (bounds-of-thing-at-point 'sexp) in ac-js2-completion-function fixes this, but I don’t know what potential other problems it might introduce.

Installation instructions don't work in emacs 24?

I followed the instructions as specified on emacs 24.1.1 and got the error when package-installing skewer-mode: 'Package emacs 24.1 not available'. If I try to install ac-js without skewer-mode I get the same error. Any ideas?

Thanks...

problem with auto-compilation on Firefox 26.0 (latest)

Hello,

I've consider that ac-js2 only work with webkit browsers (i just tried latest version of Chromium on Linux), I tried it on Firefox with no success.

It's true or I'm doing something wrong? I've read skewer-addon.js and try to debug that, found that buildCandidates function won't return correct answer so result.value in Firefox return always null... different story in chromium which return result with correct value.

error: (invalid-function ac-define-source)

in the update of last versión of auto-complete-mode I get this error when I try to enable ac-js2

Debugger entered--Lisp error: (invalid-function ac-define-source)
  ac-define-source("js2" ((candidates . ac-js2-ac-candidates) (document . ac-js2-ac-document) (prefix . ac-js2-ac-prefix) (requires . -1)))
  ac-js2-setup-auto-complete-mode()
  ac-js2-mode(toggle)
  #<subr call-interactively>(ac-js2-mode record nil)
  ad-Advice-call-interactively(#<subr call-interactively> ac-js2-mode record nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (ac-js2-mode record nil))
  call-interactively(ac-js2-mode record nil)
  command-execute(ac-js2-mode record)
  execute-extended-command(nil "ac-js2-mode")
  #<subr call-interactively>(execute-extended-command nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> execute-extended-command nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (execute-extended-command nil nil))
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I think that is solved with (eval '(ac-define-source "js2" on line 285

ac-source-js2 breaks every following source in ac-sources

When ac-source-js2 returns one or more matches to auto-complete, every other following source in ac-sources seems to be broken. That is, none of them will return any matches (although there are matches when I remove ac-source-js2).

Error: No JavaScript AST available

Hi Guys!

I'm with some problem using ac-js2, while I'm coding js and I try to use auto complete the following error happens:

Ac-Js2 mode enabled in current buffer
Error running timer ‘ac-update-greedy’: (error "No JavaScript AST available") [2 times]
Error running timer ‘ac-show-menu’: (error "No JavaScript AST available")

Someone knows what can be?

My emacs version: GNU Emacs 25.1.1 (x86_64-apple-darwin15.0.0, NS appkit-1404.11 Version 10.11 (Build 15A284)) of 2016-10-03

Void: cache-table-get

When I try to load the ac-js2 mode I get an error:
require: Symbol's value as variable is void: cache-table-get

My Emacs version is:

GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.6.4)

I made sure that I had the dependencies installed:

skewer-mode (MELPA)
js2-mode (ELPA)

(I installed ac-js2 using the package manager, but also tried to load the ac-js2.el file from the master branch with the same error as result).

Best Regards
Jeppe

No drop down menu

Hi, I believe I have this installed just the readme says, but I am still not getting a drop down window when I type a previously-typed function: i.e.

screen shot 2015-04-14 at 8 48 13 pm

I have in my .emacs:

(add-to-list 'auto-mode-alist (cons (rx ".js" eos) 'js2-mode)) 
(add-hook 'js-mode-hook 'ac-js2-mode) 

So I do not know what is wrong. Any ideas?

Readme.md

Experimental yansippet integration isn't supposed to be Yasnippet?

Freezes Emacs when asked for completion

I was able to get Skrewer and HTTP server working but when I try to use ac-js2 together with company-mode and ask for next completion the Emacs freezes and I have to run keyboard-quit.

My config below.

(eval-after-load 'ac-js2
  '(progn
     (setq ac-js2-evaluate-calls nil)
     (add-to-list 'company-backends 'ac-js2-company)

     (add-hook 'js2-mode-hook 'jarfar/js2-init t)
     (add-hook 'js2-mode-hook 'skewer-mode t)
     (add-hook 'js2-mode-hook 'ac-js2-mode t)

     (defun jarfar/js2-init ()
       (message "jarfar/js2-init run")
       (setq-local browse-url-browser-function 'browse-url-chrome))
     ))

When I invoke run-skewer together with ac-js2 I also get error 500 in browser.

I use macOS 10.15.7, Emacs 26.3.

Request: split company support out into a separate package

auto-complete and company are alternatives to each other, so it doesn't really make sense to support both in ac-js2. For a start, the reference to company-* symbols causes byte-compilation warnings on systems which don't have company installed, which simply wouldn't be present if you could (require 'company). The naming is also confusing, because I doubt any company users would expect an ac-* package to be useful to them.

As a result, I'd strongly suggest splitting out a separate company-js2.el in either the same repo or a fresh one, which would then form a separate easy-to-find and logically-named package in MELPA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.