Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

When using lsp-find-references, I get error : The path is empty. (Parameter ’path’) #87

Closed
lyjdwh opened this issue Apr 1, 2020 · 1 comment
Labels
invalid This doesn't seem right

Comments

@lyjdwh
Copy link

lyjdwh commented Apr 1, 2020

Describe the bug
When using lsp-python-ms, I run the command xref-find-references emacs shows: eror The path is empty. (Parameter ’path’)
When using pyls, it 's all ok.

Environment
lsp-python-ms-20200223.2136
languageServer.0.5.45
emacs 27.0.90
manjaro kde spacemacs

Error callstack

Debugger entered--Lisp error: (error "The path is empty. (Parameter ’path’)")
  signal(error ("The path is empty. (Parameter ’path’)"))
  error("The path is empty. (Parameter 'path')")
  lsp-request("textDocument/references" (:textDocument (:uri "file:///home/liuyan/test/test.py") :position (:line 43 :character 0) :context (:includeDeclaration :json-false)))
  #f(compiled-function (backend identifier) #<bytecode 0x3af4e6d>)(xref-lsp #("hello" 0 5 (fontified t identifier-at-point t)))
  apply(#f(compiled-function (backend identifier) #<bytecode 0x3af4e6d>) xref-lsp #("hello" 0 5 (fontified t identifier-at-point t)))
  xref-backend-references(xref-lsp #("hello" 0 5 (fontified t identifier-at-point t)))
  xref--find-xrefs(#("hello" 0 5 (fontified t identifier-at-point t)) references #("hello" 0 5 (fontified t identifier-at-point t)) nil)
  xref-find-references(#("hello" 0 5 (fontified t identifier-at-point t)))
  funcall-interactively(xref-find-references #("hello" 0 5 (fontified t identifier-at-point t)))
  call-interactively(xref-find-references record nil)
  command-execute(xref-find-references record)
  counsel-M-x-action("xref-find-references")
  ivy-call()
  ivy-read("M-x " ("xref-find-references" "lsp-ui-peek-find-references" "toggle-debug-on-error" "lsp-ui-peek-jump-forward" "lsp-ui-peek-find-implementation" "lsp-ui-peek-enable" "lsp-describe-session" "lsp-ui-peek-find-workspace-symbol" "package-install" "zilongshanren/counsel-imenu" "company-tabnine" "lsp" "org-protocol-create" "helm-filtered-bookmarks" "link-hint-open-link" "eaf-open-browser" "eaf-open-bookmark" "eaf-open-external" "eaf-open-camera" "eaf-kill-process" "eaf-mode" "eaf-edit-buffer-switch-to-org-mode" "snails" "configuration-layer/describe-package" "spacemacs/deft" "terminal-here-project-launch" "terminal-here-launch" "terminal-here" "my-git-timemachine" "flyspell-mode" "ivy-yasnippet" "counsel-imenu" "flycheck-mode" "customize-group" "flycheck-verify-setup" "counsel-load-theme" "pdf-view-mode" "rotate-text" "company-mode" "eaf-open-demo" "eaf-open" "evilmi-select-items" "align-regexp" "eaf--kill-python-process" "markdown-preview" "eaf-open-terminal" "markdown-live-preview-mode" "grep-mode" "edebug-defun" "flymake-mode" ...) :predicate #f(compiled-function (x) #<bytecode 0x2a85c61>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

lsp-log-io

[Trace - 07:50:17 下午] Sending request 'textDocument/references - (215)'.
Params: {
  "textDocument": {
    "uri": "file:///home/liuyan/test/test.py"
  },
  "position": {
    "line": 9,
    "character": 3
  },
  "context": {
    "includeDeclaration": false
  }
}


[Trace - 07:50:17 下午] Received notification 'telemetry/event'.
Params: {
  "Measurements": {
    "elapsedMs": 1.3763
  },
  "Properties": {
    "plsVersion": "0.5.45.0",
    "method": "textDocument/references"
  },
  "EventName": "python_language_server/rpc.request"
}


[Trace - 07:50:17 下午] Received notification 'telemetry/event'.
Params: {
  "Measurements": {
  },
  "Properties": {
    "plsVersion": "0.5.45.0",
    "method": "textDocument/references",
    "stackTrace": "   at System.IO.Path.GetFullPath(String path)\n   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)\n   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)\n   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)\n   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)\n   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)\n   at Microsoft.Python.Core.IO.FileSystem.GetFiles(String path, String pattern, SearchOption option) in E:\\A\\_work\\1\\s\\src\\Core\\Impl\\IO\\FileSystem.cs:line 58\n   at Microsoft.Python.LanguageServer.Sources.ReferenceSource.ScanClosedFiles(String name, CancellationToken cancellationToken) in E:\\A\\_work\\1\\s\\src\\LanguageServer\\Impl\\Sources\\ReferenceSource.cs:line 117\n   at Microsoft.Python.LanguageServer.Sources.ReferenceSource.FindAllReferencesAsync(String name, IPythonModule declaringModule, ILocatedMember rootDefinition, SourceLocation location, DefinitionSource definitionSource, CancellationToken cancellationToken) in E:\\A\\_work\\1\\s\\src\\LanguageServer\\Impl\\Sources\\ReferenceSource.cs:line 82\n   at Microsoft.Python.LanguageServer.Sources.ReferenceSource.FindAllReferencesAsync(Uri uri, SourceLocation location, ReferenceSearchOptions options, CancellationToken cancellationToken) in E:\\A\\_work\\1\\s\\src\\LanguageServer\\Impl\\Sources\\ReferenceSource.cs:line 75\n   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.FindReferences(JToken token, CancellationToken cancellationToken) in E:\\A\\_work\\1\\s\\src\\LanguageServer\\Impl\\LanguageServer.cs:line 210",
    "name": "ArgumentException"
  },
  "EventName": "python_language_server/rpc.exception"
}


[Trace - 07:50:17 下午] Received response 'textDocument/references - (215)' in 9ms.
Result: null


[Trace - 07:50:17 下午] Sending notification '$/cancelRequest'.
Params: {
  "id": 215
}

It seems the argument that lsp sends to Microsoft LanguageServer is not right!

@lyjdwh
Copy link
Author

lyjdwh commented Apr 2, 2020

After I reinstall my spacemacs, the problem disappears!

@lyjdwh lyjdwh closed this as completed Apr 2, 2020
@seagle0128 seagle0128 added the invalid This doesn't seem right label Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants