OmniSharp / omnisharp-emacs

Troll coworkers - use Emacs at work for csharp!
GNU General Public License v3.0
515 stars 94 forks source link

wrong-type-argument listp 69 #158

Closed zfsword closed 9 years ago

zfsword commented 9 years ago

I use omnisharp-emacs that can start server, stop server and show complete for example System ,UnityEngine classes, check-alive-status, rename Class name, And a Omnisharp.exe is running with the solution file.

The Omnisharp Server work fine with GVIM 7.4 on the same machine.

But when I try to complete Console. or some self defined varibles , it show "wrong-type-argument listp 69"

Here is the debug error info: " Debugger entered--Lisp error: (wrong-type-argument listp 69) assoc(CompletionText 69) (cdr (assoc (quote CompletionText) item)) omnisharp--completion-result-item-get-completion-text(69) omnisharp--make-company-completion(69) mapcar(omnisharp--make-company-completion "Error communicating to the OmniSharpServer instance") omnisharp--get-company-candidates("") company-omnisharp(candidates "") apply(company-omnisharp (candidates ""))

[0 "\302 !\203

" I can't paste all the text, because some "^K^@" ,"^H" charactor in it.

omnisharp-debug info:

2015-03-31T11:32:48+0800
(:command "d:/Emacs/home/curl/curl.exe" :arguments ("--silent" "-H" "Content-type: application/json" "--data-binary" "@D:/Emacs/home/temp/omnisharp-tmp-file.cs" "http://localhost:2000/autocomplete"))

2015-03-31T11:32:49+0800
omnisharp--json-read-from-string error: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
  <title>500</title>
  <style type=\"text/css\">
  body {
    font: 13.34px Arial, Helvetica, Sans-Serif;
    margin:50px 0px; padding:0px;
    text-align:center;
  }

  h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0; 
    padding: 0;
  }

  #mainContainer {
    margin: 0px auto;
    width: 500px;
    text-align:left;
  }

it is a error page too long to paste.

I have read Issue #117, #90, #72, #76,#80,#129, #109, #97。

I have tried to change the paths many ways, but the resault is same.

;(setq omnisharp--curl-executable-path "D:\\Emacs\\home\\curl\\curl.exe")
    ;(setq omnisharp--curl-executable-path "D:\\Program Files\\PortableGit\\bin\\curl.exe")
    (setq omnisharp--curl-executable-path "d:/Emacs/home/curl/curl.exe")
    ;(setq omnisharp--curl-executable-path "~/curl/curl.exe")

    ;(setq omnisharp-server-executable-path "D:/Vim/vimfiles/pathogen/bundle/omnisharp-vim/server/OmniSharp/bin/Release/OmniSharp.exe ")
    (setq omnisharp-server-executable-path "D:/OmniSharp/Release/OmniSharp.exe")
    ;(setq omnisharp-server-executable-path "D:\\OmniSharp\\Release\\OmniSharp.exe")

    ;(setq omnisharp--windows-curl-tmp-file-path "~/temp/omnisharp-tmp-file.cs")
    (setq omnisharp--windows-curl-tmp-file-path "D:/Emacs/home/temp/omnisharp-tmp-file.cs")
    ;(setq omnisharp--windows-curl-tmp-file-path "/omnisharp-tmp-file.cs")
    ;(setq omnisharp--windows-curl-tmp-file-path "D:\\Emacs\\home\\temp\\omnisharp-tmp-file.cs")

every path I've test.

I also tried change the config.json , remove all comments in it.

   {
          "From":"/",
          "To":"\\"
    },
    {
      "From":"/cygdrive/c/",
      "To":"c:\\"
    }

no matter change backslash or not , the same.

my work environment: windows 7 SP1 32bit, Chinese D:\emacs\emacs-24.4-bin-i686-pc-mingw32, native not cygwin emacs D:\emacs\home.emacs.d\elpa\omnisharp-20150107.850, D:\emacs\home\curl\curl.exe // I have Test curl win32 v7.4.1 and 7.4.0 native not cygwin

by the way, I tried change the emacs encoding with utf-8, but not influence.

mikavilpas commented 9 years ago

Hi, sorry you're having trouble. It looks like the server is returning the error and your emacs side paths are fine.

Try starting the server manually with -v Verbose. It will log incoming and outgoing stuff to the terminal. See if the autocomplete request sows up there.

You can also try to use curl directly with the arguments emacs logs for you to make sure emacs is not messing up - just make sure the temp file doesn't change by another request when you try it. 31.3.2015 7.32 kirjoitti "zfsword" notifications@github.com:

I use omnisharp-emacs that can start server, stop server and show complete for example System ,UnityEngine classes, check-alive-status, rename Class name, And a Omnisharp.exe is running with the solution file.

The Omnisharp Server work fine with GVIM 7.4 on the same machine.

But when I try to complete Console. or some self defined varibles , it show "wrong-type-argument listp 69"

Here is the debug error info: " Debugger entered--Lisp error: (wrong-type-argument listp 69) assoc(CompletionText 69) (cdr (assoc (quote CompletionText) item)) omnisharp--completion-result-item-get-completion-text(69) omnisharp--make-company-completion(69) mapcar(omnisharp--make-company-completion "Error communicating to the OmniSharpServer instance") omnisharp--get-company-candidates("") company-omnisharp(candidates "") apply(company-omnisharp (candidates ""))

[0 "\302 !\203

" I can't paste all the text, because some "^K^@" ,"^H" charactor in it.

omnisharp-debug info:

2015-03-31T11:32:48+0800 (:command "d:/Emacs/home/curl/curl.exe" :arguments ("--silent" "-H" "Content-type: application/json" "--data-binary" "@D:/Emacs/home/temp/omnisharp-tmp-file.cs" "http://localhost:2000/autocomplete"))

2015-03-31T11:32:49+0800 omnisharp--json-read-from-string error: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">

500

500 - InternalServerError

Something went horribly, horribly wrong while servicing your request.

We're sorry :-(

Graphics courtesy of the awesome Matthew Inman

Error Details

Error details are currently disabled. Please set StaticConfiguration.DisableErrorTraces = false; to enable.

A 豢 at the beginning of html file

— Reply to this email directly or view it on GitHub https://github.com/OmniSharp/omnisharp-emacs/issues/158#issuecomment-87964553 .

zfsword commented 9 years ago

In English is Invalid path. maybe the json encode error? maybe the slash and back slash in omnisharp-auto-complete-actions.el or omnisharp.el, omnisharp-utils.el. At 2014 August, I tried omnisharp based on curl in Vim on winXP32 , also have the Illegal path error. Now I think the vim use the urllib of python

************ Headers ************
Connection - close
Content-Length - 463
Content-Type - application/json
Accept-Encoding - identity
Host - localhost:2000
User-Agent - **Python-urllib/2.7**
************  Body ************

And the Vim works all right on the same server.

mikavilpas commented 9 years ago

@nosami do you think this could be a PathReplacement thing in the server's config? 31.3.2015 11.53 kirjoitti "zfsword" notifications@github.com:

In English is Invalid path. maybe the json encode error? maybe the slash and back slash in omnisharp-auto-complete-actions.el or o mnisharp.el, omnisharp-utils.el. At 2014 August, I tried omnisharp based on curl in Vim on winXP32 , also have the Illegal path error. Now I think the vim use the urllib of python

\ Headers ** Connection - close Content-Length - 463 Content-Type - application/json Accept-Encoding - identity Host - localhost:2000 User-Agent - Python-urllib/2.7 \ Body **

And the Vim works all right on the same server.

— Reply to this email directly or view it on GitHub https://github.com/OmniSharp/omnisharp-emacs/issues/158#issuecomment-87999766 .

zfsword commented 9 years ago

Maybe , I 'm not sure.

nosami commented 9 years ago

Looks like the PathReplacement is configured correctly looking at the first comment in this thread.

00069712 System.ArgumentException: 路径的形式不合法。
   在 System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   在 System.IO.Path.GetDirectoryName(String path)
   在 ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider.GetLocalizedName(String fileName, String language)
   在 ICSharpCode.NRefactory.Documentation.XmlDocumentationProvider.LookupLocalizedXmlDoc(String fileName)
   在 OmniSharp.Documentation.XmlDocumentationProviderFactory.Get(IProject project, String assemblyName) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\Documentation\XmlDocumentationProviderFactory.cs:行号 26
   在 OmniSharp.Documentation.DocumentationFetcher.GetDocumentation(IProject project, IEntity entity, OmniSharpConfiguration config) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\Documentation\DocumentationFetcher.cs:行号 30
   在 OmniSharp.AutoComplete.CompletionDataFactory.CompletionData(IEntity entity) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\AutoComplete\CompletionDataFactory.cs:行号 172
   在 OmniSharp.AutoComplete.CompletionDataFactory.CreateEntityCompletionData(IEntity entity) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\AutoComplete\CompletionDataFactory.cs:行号 104
   在 ICSharpCode.NRefactory.CSharp.Completion.CompletionDataWrapper.AddMember(IMember member)
   在 ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngine.CreateCompletionData(TextLocation location, ResolveResult resolveResult, AstNode resolvedNode, CSharpResolver state, Func`2 typePred)
   在 ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngine.HandleMemberReferenceCompletion(ExpressionResult expr)
   在 ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngine.MagicKeyCompletion(Char completionChar, Boolean controlSpace, Boolean& isComplete)
   在 ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngine.GetCompletionData(Int32 offset, Boolean controlSpace)
   在 OmniSharp.AutoComplete.AutoCompleteHandler.CreateProvider(AutoCompleteRequest request) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\AutoComplete\AutoCompleteHandler.cs:行号 63
   在 OmniSharp.AutoComplete.AutoCompleteModule.<>c__DisplayClass3.<.ctor>b__0(Object x) 位置 d:\OmniSharp\OmniSharpServer\OmniSharp\AutoComplete\AutoCompleteModule.cs:行号 14
   在 CallSite.Target(Closure , CallSite , Func`2 , Object )
   在 Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)

^^ this looks like there is an error trying to fetch the path to the xml documentation files.

mikavilpas commented 9 years ago

This seems like it could be some issue with the environment. Perhaps something is configured improperly in it. I don't know what to do, sorry. Perhaps you could try it on a different system? I know it's a lot of work but I'm out of ideas.