Git Product home page Git Product logo

Comments (11)

nosami avatar nosami commented on May 21, 2024

Just tried on Windows.... server sits at 0% when not in use. I'm not at my linux box to try it out.

Do you think 56bcb87 could have caused this?

from omnisharp-vim.

chtenb avatar chtenb commented on May 21, 2024

I cannot be due to 56bcb87, since the while only loops when a line is entered, which doesn't happen generally.

from omnisharp-vim.

nosami avatar nosami commented on May 21, 2024

I didn't think it would be that to be honest... just clutching at straws. Do you know if the 100% cpu usage is a recent issue?

I'd be interested to know if anyone else has this problem.

from omnisharp-vim.

chtenb avatar chtenb commented on May 21, 2024

I just noticed that the problem doesn't occur when starting the server outside vim. Let me dig into this a little more.

from omnisharp-vim.

chtenb avatar chtenb commented on May 21, 2024

I don't know if its a recent issue, since I could only get it working very recently. Could it have something todo with the way vim-dispatch is called, or with vim-dispatch itself?

from omnisharp-vim.

nosami avatar nosami commented on May 21, 2024

I wouldn't imagine it was vim-dispatch related although I can't explain how starting the server outside vim would change anything. Sorry.

from omnisharp-vim.

chtenb avatar chtenb commented on May 21, 2024

I found its not vim-dispatch related, since running the server manually by :!Omnisharp.exe -s mysolution.sln & results in 100% CPU usage as well.

from omnisharp-vim.

nosami avatar nosami commented on May 21, 2024

I parse the solution in a background thread now since ed19c02. Maybe that is causing the problem.

from omnisharp-vim.

chtenb avatar chtenb commented on May 21, 2024

As far as I can understand things now, it actually IS related to the while loop in 56bcb87 .
What happens (I guess) is that starting the server from within vim causes Console.ReadLine() to pass immediately, making the while statement loop very fast.

Thinking about a solution for this, I think we actually don't want to test stdin for input since that happens to lead to unwanted behaviour on different systems. I think we just want to have NancyHost running forever, until it is given a shutdown signal from port 2000 (or whatever the configured port is). Just like is done with windows forms when the Appliction.Run() method is invoked.

Could something similar be done for nancyhost? That would solve all these problems.

from omnisharp-vim.

nosami avatar nosami commented on May 21, 2024

Not sure about the long term fix yet, but for now a simple Thread.Sleep(500) inside the while loop will sort your problem out.

from omnisharp-vim.

nosami avatar nosami commented on May 21, 2024

Just pushed quick fix.

from omnisharp-vim.

Related Issues (20)

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.