Giter Site home page Giter Site logo

Comments (6)

akinsho avatar akinsho commented on May 27, 2024 3

Good shout @rlch, I've added that in as well. Tbh I think long term there's a better way to do this e.g. just not analysing anything that's not in the current workspace 🤔

from flutter-tools.nvim.

akinsho avatar akinsho commented on May 27, 2024 1

@RobertBrunhage thanks for raising this 👍🏾 I hadn't really paid too much attention but I was able to reproduce this. I don't think it relates to compe since it's activities are primarily through completion so any lag it causes would be during completion.

I think the main issue here is possibly how I've set up the language server. At the moment it doesn't exclude any folders from being analysed so when you jump into an sdk package it tries to analyse the entire folder i.e. all the packages from wherever it determines the root to be which is going to a) be too many files and b) not useful since you don't need analysis like diagnostics for an sdk package.

I've tried locally using the

lsp = {
   settings = {
      analysisExcludedFolders = {vim.fn.expand("$HOME/flutter/packages")}
  }
}

which seems to stop the lag on my machine. Can you try adding the path to your flutter binary (if you use a mac and it's installed in your home dir) you can just use exactly what I used there,
to see if it makes it less laggy on your end?

If that works then I will add this in as a default so people can jump into the sdk definitions without lag.

from flutter-tools.nvim.

rlch avatar rlch commented on May 27, 2024 1

Just a tip; I would also recommend adding vim.fn.expand("$HOME/flutter/.pub-cache") to this table to stop analysis on pub.dev packages.

This really improved my performance :)

from flutter-tools.nvim.

RobertBrunhage avatar RobertBrunhage commented on May 27, 2024

Awesome, that makes a lot more sense!

I tested it out and worked great, no more lag!

I tried defining it like this which didn't work

require("flutter-tools").setup{ 
  lsp = {
    on_attach = on_attach,
    settings = {
      analysisExcludedFolders = {vim.fn.expand("%HOMEDRIVE%/src/flutter/packages")}
    }
  }
} 

but replacing %HOMEDRIVE% with just C: worked well (I am using Windows).

from flutter-tools.nvim.

RobertBrunhage avatar RobertBrunhage commented on May 27, 2024

@akinsho any plans for adding this to only analyze in the current workspace? Getting this same issue when I navigate to packages code that I depend on.

from flutter-tools.nvim.

akinsho avatar akinsho commented on May 27, 2024

@RobertBrunhage I still don't really have any clue how I would do that, there is no explicit option in the lsp spec that provides this. onlyAnalyzeProjectsWithOpenFiles is the closest thing that sounds right but it won't actually stop huge files or their containing projects being analysed. If anyone has a good suggestion 🤷🏿‍♂️

from flutter-tools.nvim.

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.