Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on running lsp-ivy-workspace-symbol #18

Open
KarthikNayak opened this issue Aug 3, 2020 · 3 comments · May be fixed by #24
Open

Error on running lsp-ivy-workspace-symbol #18

KarthikNayak opened this issue Aug 3, 2020 · 3 comments · May be fixed by #24

Comments

@KarthikNayak
Copy link

Debugger entered--Lisp error: (wrong-type-argument stringp #<hash-table equal 5/65 0x1ba8015>)
  substring-no-properties(#<hash-table equal 5/65 0x1ba8015>)
  prescient-remember(#<hash-table equal 5/65 0x1ba8015>)
  #f(compiled-function (x) #<bytecode 0x3bfcb15>)(#<hash-table equal 5/65 0x1ba8015>)
  ivy-call()
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x3b7b50d>)("Workspace symbol: " #f(compiled-function (user-input) #<bytecode 0x15a5d55>) :dynamic-collection t :require-match t :initial-input nil :action lsp-ivy--workspace-symbol-action :caller lsp-ivy-workspace-symbol :sort t)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x3b7b50d>) ("Workspace symbol: " #f(compiled-function (user-input) #<bytecode 0x15a5d55>) :dynamic-collection t :require-match t :initial-input nil :action lsp-ivy--workspace-symbol-action :caller lsp-ivy-workspace-symbol :sort t))
  ivy-read("Workspace symbol: " #f(compiled-function (user-input) #<bytecode 0x15a5d55>) :dynamic-collection t :require-match t :initial-input nil :action lsp-ivy--workspace-symbol-action :caller lsp-ivy-workspace-symbol)
  lsp-ivy--workspace-symbol((#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 19/65 0x1c86249> :registered-server-capabilities (#s(lsp--registered-capability :id "5ff1518e-3402-4f27-abf9-90de61677b13" :method "textDocument/rangeFormatting" :options #<hash-table equal 1/65 0x30b69a9>) #s(lsp--registered-capability :id "720bd6aa-3950-46dc-871b-5bc460108783" :method "textDocument/formatting" :options #<hash-table equal 1/65 0x143f965>) #s(lsp--registered-capability :id "9dec01f6-535e-460d-aeba-23ff29969670" :method "workspace/didChangeWorkspaceFolders" :options #<hash-table equal 0/65 0x347cd55>)) :root "/home/karthik/deliveryhero/pd-archimedes" :client #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode 0x1763de9>) :test\? #f(compiled-function () #<bytecode 0x1763dd1>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x2cb3189> :request-handlers #<hash-table equal 0/65 0x2ccbf2d> :response-handlers #<hash-table eql 0/65 0x2ccfac1> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x2cdfeb5> :action-handlers #<hash-table equal 0/65 0x2d20285> :major-modes (php-mode) :activation-fn nil :priority -1 :server-id iph :multi-root t :initialization-options #f(compiled-function () #<bytecode 0x1763e71>) :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn nil :remote? nil :completion-in-comments? t :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x2d30585> :download-server-fn nil :download-in-progress? nil :buffers nil) :host-root nil :proc #<process iph> :cmd-proc #<process iph> :buffers (#<buffer AppCache.php> #<buffer CheckoutServiceInterface.php> #<buffer CartSkeleton.php> #<buffer OrderController.php> #<buffer OrderMetaData.php> #<buffer CheckoutCart.php> #<buffer ApiResponseListener.php> #<buffer ApiTotalAmountMismatchException.php> #<buffer ApiOrderProviderInterface.php> #<buffer CheckoutService.php> #<buffer ApiOrderProvider.php> #<buffer .#ApiOrderProvider.php>) :semantic-highlighting-faces nil :semantic-highlighting-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x106efa1> :watches #<hash-table equal 0/65 0x10529dd> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 2/65 0x105297d> :work-done-tokens #<hash-table equal 0/65 0x128e6d5>)) "Workspace symbol: " nil)
  lsp-ivy-workspace-symbol(nil)
  funcall-interactively(lsp-ivy-workspace-symbol nil)
  call-interactively(lsp-ivy-workspace-symbol nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1d1b0b>)(lsp-ivy-workspace-symbol nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1d1b0b>) lsp-ivy-workspace-symbol)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1d1b0b>) lsp-ivy-workspace-symbol)
  command-execute(lsp-ivy-workspace-symbol)

I'm not sure if this is the right place for this, happy to report this elsewhere.

@leungbk
Copy link
Member

leungbk commented Aug 7, 2020

lsp-ivy-workspace-symbol doesn't work well with ivy-prescient's sorting. I have this in my config to make prescient ignore certain ivy-read callers:

(setq ivy-prescient-sort-commands '(:not swiper
                                           swiper-isearch
                                           counsel-imenu
                                           ivy-switch-buffer
                                           lsp-ivy-workspace-symbol
                                           ivy-resume
                                           ivy--restore-session
                                           counsel-switch-buffer))

Hopefully this should resolve your problem.

@KarthikNayak
Copy link
Author

lsp-ivy-workspace-symbol doesn't work well with ivy-prescient's sorting. I have this in my config to make prescient ignore certain ivy-read callers:

(setq ivy-prescient-sort-commands '(:not swiper
                                           swiper-isearch
                                           counsel-imenu
                                           ivy-switch-buffer
                                           lsp-ivy-workspace-symbol
                                           ivy-resume
                                           ivy--restore-session
                                           counsel-switch-buffer))

Hopefully this should resolve your problem.

Thanks this fixes it :D

@nbfalcon
Copy link
Member

nbfalcon commented Nov 4, 2020

This is probably because it abuses :display-transformer-fn. I'll fix this.

nbfalcon added a commit to nbfalcon/lsp-ivy that referenced this issue Nov 4, 2020
nbfalcon added a commit to nbfalcon/lsp-ivy that referenced this issue Nov 6, 2020
nbfalcon added a commit to nbfalcon/lsp-ivy that referenced this issue Nov 11, 2020
nbfalcon added a commit to nbfalcon/lsp-ivy that referenced this issue Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants