Closed pervezfunctor closed 10 years ago
Hi, thanks for reporting these. I've been meaning to set up omnisharp-emacs for a windows development environment.
I'll see into these when I do, and leave this open until then. If you notice something else, please report them too. :)
I created a pull request that should solve the issue you described last. https://github.com/sp3ctum/omnisharp-emacs/pull/99
I'm diying to see omnisharp-emacs working on my dear machines but it seems that I'm doing something wrong.
I use windows at the office and debian at home and just pulled the last version of omnisharp-emacs and OmniSharpServer and run them on both machines. I get diferent errors in both machines. The error in debian seems to be a mono problem in the OmniSharpServer side (so I know here is not the place).
But the error I get on the windows machine at the office seems like an omnisharp-emacs error to me. Making a call to "omnisharp-add-dot-and-auto-complete" makes emacs complain about some p-list with a 69 something number. The server also complains about the "line" parameter, something like "the line paremeter should be betwen 1 and 1 the actual value is 0". I thougt it had something to do with the end line characters so I tested diferent characters on the omnisharp-temp-file.c end lines chars and faking a call calling curl directly from the command line, but got the same error. The "Line" parameter is there on the omnisharp-temp-file.cs and it has a 20 something value.
What should I do?
(tomorrow I'll add some real error messages and stuff from the office machine)
Thanks for this fantastic project! where is the "invite me a beer / donate / help me out" button!?
See https://github.com/nosami/OmniSharpServer/issues/99 for the server issue.
Make sure you are using the version of curl from here http://curl.haxx.se/download.html for windows and not cygwin or gow or mingw or some other.
mmm ... I'd like it to work with cygwin so I woldn't need two different versions of the same program on my system.
BUT! I did tried using the native windows version of curl and the error about the line doesn't show! the server is working, my dear emacs is the problem now it freezes waiting for some respose from curl. If I kill curl emacs shows an error similar to the one I had before:
Debugger entered--Lisp error: (wrong-type-argument listp 69)
assoc(DisplayText 69)
(cdr (assoc (quote DisplayText) element))
(popup-make-item (cdr (assoc (quote DisplayText) element)) :value (omnisharp--completion-result-item-get-completion-text element) :document (cdr (assoc (quote Description) element)))
(closure ((json-result-alist . "Error communicating to the OmniSharpServer instance") t) (element) (popup-make-item (cdr (assoc (quote DisplayText) element)) :value (omnisharp--completion-result-item-get-completion-text element) :document (cdr (assoc (quote Description) element))))(69)
mapcar((closure ((json-result-alist . "Error communicating to the OmniSharpServer instance") t) (element) (popup-make-item (cdr (assoc (quote DisplayText) element)) :value (omnisharp--completion-result-item-get-completion-text element) :document (cdr (assoc (quote Description) element)))) "Error communicating to the OmniSharpServer instance")
omnisharp--convert-auto-complete-json-to-popup-format("Error communicating to the OmniSharpServer instance")
(let* ((display-list (omnisharp--convert-auto-complete-json-to-popup-format json-result-alist)) (completion-texts (mapcar (quote omnisharp--completion-result-item-get-display-text) json-result-alist)) (max-width (omnisharp--get-max-item-length completion-texts)) (result (popup-menu* display-list :width max-width :keymap omnisharp-auto-complete-popup-keymap :margin-left 1 :margin-right 1 :scroll-bar t :isearch omnisharp-auto-complete-popup-want-isearch :help-delay omnisharp-auto-complete-popup-help-delay))) (omnisharp--replace-symbol-in-buffer-with (omnisharp--current-word-or-empty-string) result))
(if (equalp 0 (length json-result-alist)) (progn (message "No completions.") nil) (let* ((display-list (omnisharp--convert-auto-complete-json-to-popup-format json-result-alist)) (completion-texts (mapcar (quote omnisharp--completion-result-item-get-display-text) json-result-alist)) (max-width (omnisharp--get-max-item-length completion-texts)) (result (popup-menu* display-list :width max-width :keymap omnisharp-auto-complete-popup-keymap :margin-left 1 :margin-right 1 :scroll-bar t :isearch omnisharp-auto-complete-popup-want-isearch :help-delay omnisharp-auto-complete-popup-help-delay))) (omnisharp--replace-symbol-in-buffer-with (omnisharp--current-word-or-empty-string) result)))
omnisharp--auto-complete-display-function-popup("Error communicating to the OmniSharpServer instance")
funcall(omnisharp--auto-complete-display-function-popup "Error communicating to the OmniSharpServer instance")
(let* ((json-false :json-false) (params (omnisharp--get-auto-complete-params)) (display-function (omnisharp--get-auto-complete-display-function)) (json-result-auto-complete-response (omnisharp-auto-complete-worker params))) (funcall display-function json-result-auto-complete-response))
omnisharp-auto-complete()
omnisharp-add-dot-and-auto-complete()
call-interactively(omnisharp-add-dot-and-auto-complete t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
I'll make some tests! and tell you later! thank you! I think I'm in the right path here thanks to you!
I haven't tested emacs under cygwin yet. Vim on cygwin works fine though.
Did you follow the instructions here? https://github.com/sp3ctum/omnisharp-emacs#using-cygwin-on-windows You need to translate between cygwin and Windows paths
You can either edit the config.json in the project root and rebuild (it gets copied to /bin/Debug).... or just edit the file in /bin/Debug directly and restart the server.
I just tried this out for the first time on cygwin. Works fine :)
I've made some tests, cygwin's emacs makes me sad, it freezes over and over. I've always use nt-emacs for that reason. I was using nt-emacs in the previous tests. This time I installed cygwin's emacs and it did the same thing that nt-emacs with the native curl, it did send the code to the server the server seems that did his job and returned the autocomplete information but emacs stoped waiting for curl. I went to the task manager killed curl and emacs returned the same error from the last time.
I guess that emacs is expecting some kind of EOF from curl and its getting it wrong in my config.
I'll keep triying, but please could you tell me the versions you used, cygwin version, 32/64 ?, configs, etc just the relevant information.
About the server I didn't made any changes to the config, but I used "-c Cygwin" switch, do I have to use the config any way?
Sorry for all the bothering. And thanks for the help and the great project!
I used the prebuilt version of cygwin that you can find here http://babun.github.io I got it running on my work machine which I don't have access to right now so not sure if it's 32 or 64 bit. I used emacs from the cygwin package manager which I believe was 24.3.something
I typically use the gui version from here http://www.gnu.org/software/emacs/.... and I've also used 24.4 from here without any issues http://sourceforge.net/projects/emacs-bin/ . When at home, I use this http://emacsformacosx.com
I think the relevant part is the server side config. Use -config /path/to/config-cygwin.json
if you are using Cygwin emacs.
If you have further problems add -v Verbose
to the server command line and paste your output.
fwiw, I got exactly the same error that you did when I didn't use the config-cygwin.json config file.
VICTORY!!! :angry:
guess what was the problem!?
the mighty cntlm!! he is the one to blame!
As I told you before curl kept waiting for some kind of signal from the server, so I decided to concentrate on making manual tests calling curl from the shell, and the same thing happened, the server made its job fine but curl kept waiting for something, denying me the prompt back. So I run with verbose and look what I saw:
Then I remembered "aaah! I got cnlm running, and a http_proxy varible" (I use it so programs like wget, curl and the like can authenticate in our dear windows network proxy server). So the only thing I had to do was to erase the http_proxy variable from emacs environment. just "C-u M-x setenv" then "http_proxy", try again with omnisharp-emacs and BOOOM!! HAPPINESS INVADE ME!
thanks for all the help! where is that donation button!?! :smile:
Well done. Glad you got it working! :thumbsup:
Great you got it working. Sorry for not checking in earlier.
I like how you documented your progress with pictures. Let's hope someone else benefits from these.
There is no donation button, at least for this emacs plugin.
It's more of a freely ye have received, freely give
community project.
Looking at this, I wonder if there is some performance improvement to be had by using http://127.0.0.1:2000 instead of localhost.
mmm ... maybe but I think that its very small, I don't think that we could notice it. I think that "localhost" is resolve through the local machine's "hosts" file (both in windows and linux). So I don't think that using directly "127.0.0.1" instead of "localhost" would make any diference.
But we can measure from emacs. That should be interesting!
I also get the error starting the server from a solution file. The way cmdproxy.exe parses quotes seems to create a problem when quoting both the exe name and solution file name. I tried using combine-and-quote-strings instead of shell-quote-argument. This helps by not quoting parts that don't need it, but I haven't found a solution that works if both the exe and solution file have spaces.
If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:
1. If all of the following conditions are met, then quote characters
on the command line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
two quote characters
- the string between the two quote characters is the name
of an executable file.
2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line, preserving
any text after the last quote character.
Hi Omnisharp people!
My attempt of running omnisharp on emacs-nt + cygwin was still missing one piece if you remember, I wasn't able to make it use the cygwin's curl. Now I know why!! I had my settings wrong.
That is what I was doing! That's why the native windows curl did work and cygwin's didn't.
I'm sure that omnisharp gurus know this, I'm posting for the cluless newbies like myself.
Thanks again!
Thanks @programingfrik ! I've never used curl like that but am glad it works. I hope it helps others.
Still TODO: should test and see if the tmp-file can be used on windows if it's at a path that contains spaces.
Ok, I Made some test with spaces and an acute letter. I had no problems with spaces neither with cygwin's curl nor with the native curl. Didn't had to use any special escape string on neither. I couldn't made the thing work with the acuted letter.
By the way I'm using the Melpa's OmniSharp-Emacs package named "omnisharp-20140807.1207". I don't know If there are newer versions in git. And a very important thing I'm using "setup-cygwin" and "cygwin-mount" in my emacs.
cygwin style only spaces
cygwin style spaces + acuted a
emacs-nt style only spaces
emacs-nt style spaces + acuted a
Nice tests, and the results are interesting. It seems like both styles of file paths work if they don't include special characters.
Currently omnisharp works for most of the things I need, and I cannot be happier.