Giter Club home page Giter Club logo

Comments (4)

SuperSandro2000 avatar SuperSandro2000 commented on August 14, 2024

Is there any progress on this in the meantime? I even encounter a few seconds wait time with very short makefiles which need to run commands for variables. Can command running be disabled to speedup tab completion at the cost of correctnes?

from bash-completion.

akinomyoga avatar akinomyoga commented on August 14, 2024

I think there are no efforts on this for now.

with very short makefiles which need to run commands for variables.

In the original report, the time of sed (10 secs) seems to be longer than that of make (4 secs). In the case that commands are run for variables, I guess the time of make should be dominant. What is the result of the following command in the directory?

$ time make -npq | wc

If this explains the most part of the delay you observe, I think it's difficult to improve the response because there is no way to disable only $(shell slow-command) in Makefile unless GNU make supports the feature. However, if we give up completions of all the targets that includes variables or wildcards (such as $(OBJDIR)/file or %.o) and also give up tracking includes, we may just run sed -n 's/^[[:space:]]*\([^:]*[^[:space:]]\)[[:space:]]*:\([^=].*\)\{0,1\}$/\1/p' Makefile to extract target names. Or another way might be to use timeout command to set a timeout for the call of make -npq, and to fall back to the above simple sed on the timeout.

from bash-completion.

janev94 avatar janev94 commented on August 14, 2024

I think there are no efforts on this for now.

with very short makefiles which need to run commands for variables.

In the original report, the time of sed (10 secs) seems to be longer than that of make (4 secs). In the case that commands are run for variables, I guess the time of make should be dominant. What is the result of the following command in the directory?

$ time make -npq | wc

If this explains the most part of the delay you observe, I think it's difficult to improve the response because there is no way to disable only $(shell slow-command) in Makefile unless GNU make supports the feature. However, if we give up completions of all the targets that includes variables or wildcards (such as $(OBJDIR)/file or %.o) and also give up tracking includes, we may just run sed -n 's/^[[:space:]]*\([^:]*[^[:space:]]\)[[:space:]]*:\([^=].*\)\{0,1\}$/\1/p' Makefile to extract target names. Or another way might be to use timeout command to set a timeout for the call of make -npq, and to fall back to the above simple sed on the timeout.

Do you have an example how to instruct make to give up completions of all targets that include variables or wildcards as you suggested, or was that a proposal for how this might be resolved? Asking since I have a similar issue and would love it if I can make the completion faster.

from bash-completion.

akinomyoga avatar akinomyoga commented on August 14, 2024

Do you have an example how to instruct make to give up completions of all targets that include variables or wildcards as you suggested,

No. In addition, that's not what I suggested. As I mentioned, there is no way to do that unless GNU Make would newly support it. What I instead suggested was to give up using make and manually manipulate Makefile, GNUmakefile, etc. using sed, etc.

or was that a proposal for how this might be resolved?

It was a possibility of how the problem might be fixed in bash-completion, and it's not what I expect the users of bash-completion to set up. The problem with this heuristic approach is that it's incomplete, imprecise, and not robust.

from bash-completion.

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.