Giter Club home page Giter Club logo

Comments (7)

castwide avatar castwide commented on May 25, 2024
  1. What operating system are you using?

  2. Does the file you're editing have a .rb extension?

  3. What's the code in the file?

  4. If you go to Help -> Toggle Developer Tools and open the Console, are there any error messages? Please copy/paste or take a screenshot if you can.

from vscode-solargraph.

dgutov avatar dgutov commented on May 25, 2024
  1. Ubuntu 16.10.

  2. Yep.

  3. It's proprietary 😃 But it's a small-ish Sinatra controller. I'm not getting any completions even at the top-level, before the class definition.

  4. No errors, just:

[Extension Host] Solargraph extension activated.
extensionHost.ts:335[Extension Host] The Solargraph gem is installed and working.
extensionHost.ts:335[Extension Host] Checking gem version
extensionHost.ts:335[Extension Host] Updating gem yardocs
extensionHost.ts:335[Extension Host] Starting the server
extensionHost.ts:335[Extension Host] [2017-08-29 23:01:56] INFO  WEBrick 1.3.1
[2017-08-29 23:01:56] INFO  ruby 2.3.4 (2017-03-30) [x86_64-linux]

extensionHost.ts:335[Extension Host] == Sinatra (v2.0.0) has taken the stage on 0 for development with backup from WEBrick
[2017-08-29 23:01:56] INFO  WEBrick::HTTPServer#start: pid=19225 port=38409

extensionHost.ts:335[Extension Host] Preparing /home/dgutov/stash/project-name

extensionHost.ts:335[Extension Host] warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.3-compliant syntax, but you are running 2.3.4.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

extensionHost.ts:335[Extension Host] Getting completion items using workspace /home/dgutov/stash/project-name
extensionHost.ts:335[Extension Host] Solargraph gem version is current
extensionHost.ts:335 [Extension Host] Getting completion items using workspace /home/dgutov/stash/project-name
extensionHost.ts:335 [Extension Host] Preparing /home/dgutov/stash/project-name
extensionHost.ts:335 [Extension Host] 

2extensionHost.ts:335 [Extension Host] Getting completion items using workspace /home/dgutov/stash/project-name

(and nothing)

from vscode-solargraph.

dgutov avatar dgutov commented on May 25, 2024

I just had the OS do an OOM kill on a solargraph server process. That could be related.

from vscode-solargraph.

castwide avatar castwide commented on May 25, 2024

It might be choking on the size of the workspace, but I think it would have to be plenty big. I haven't run into serious issues up to about 10kloc.

One common cause I've encountered is unit tests. I had problems with RSpec suites on a couple of projects. I fixed it by having the gem avoid parsing anything in the spec/ folder by default. If you have tests in a folder with a different name, that might be where it's hanging.

You can try excluding unnecessary directories with a .solargraph.yml file. Let's say, for example, you want to skip a folder named test/. You can do the following:

  1. Go to the command palette and run Create a Solargraph config file. (This is the same as running solargraph config from the command line.) It'll create a .solargraph.yml file with default settings.

  2. Add the directory you want to exclude to .solargraph.yml so it looks something like this:

    include:
      - ./**/*.rb
    exclude:
      - spec/**/*
      - test/**/*     # <- Your new entry
  1. Go to the command palette and run Restart Solargraph.

(Side note: if you're editing a file in an excluded directory, Solargraph will still analyze that specific file while ignoring everything else.)

I still haven't figured out why test suites in particular are such a drag on performance.

from vscode-solargraph.

dgutov avatar dgutov commented on May 25, 2024

Thanks, that did it. I tried creating such a config previously, but we have a repo with multiple projects in one directory, and now I've opened just one of them as the workspace (and put the config inside it), completion at least does something.

It's very slow, though: after pressing Ctrl-Space, I have to wait like 1-4 seconds, depending on the context, before the menu shows up. It even takes about 1 second in a newly generated Rails project.

from vscode-solargraph.

castwide avatar castwide commented on May 25, 2024

Cool. That's a start.

I'm working on ways to improve responsiveness, especially on medium to large projects. That's primarily an issue with the gem, where most of the heavy lifting happens.

from vscode-solargraph.

dgutov avatar dgutov commented on May 25, 2024

Thanks. I'll close this, then.

from vscode-solargraph.

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.