Giter Site home page Giter Site logo

clink-completions's People

Contributors

albfan avatar andegawen avatar bergbok avatar bug-ware avatar busches avatar chrisant996 avatar daxgames avatar doggy8088 avatar edgardmessias avatar gayanper avatar hifiphile avatar htsign avatar ian-craig avatar ipatalas avatar jnylson avatar junkangli avatar mause avatar mikesigs avatar nixxo avatar peter-obrien avatar piotr-cz avatar rasmusfaber avatar solwasserman avatar stefre avatar suraj-yadav avatar toxaris avatar vladimir-kotikov avatar yiftachdy avatar yiftizur avatar yoavst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clink-completions's Issues

Update README with branches description

A set of completions in this repo depends on chosen branch. Hovewer this solution is far from ideal but i have some reasons for it. Probably this should be documented better than now.

Improve compatibility with Cmder

Current completions set is not fully compatible with Cmder. Specifically there is a lack of prompt handling and replacing of {git} and {lamb} sequences in prompt.

Also there is an additional template for hg seems to be appeared in cmderdev/cmder@af30a90 and this could be added as well.

autocomplete remote branches

In this WIP

albfan@d48adfb

I found that clink divides autocompletion on "/".

$ git rebase <TAB>
origin/master origin/wip vladimir/master vladimir/extended vladimir/dev master wip
$ git rebase o<TAB>
$ git rebase origin/<TAB>
-- no output --

and it do not offer autocompletion

When there is only one branch on remote autocompletion works.

Is there any solution to avoid stop on "/"? I've tried "disable_file_matching()" but didn't solve it.

Including this package in Cmder

Hey, I am the guy behind Cmder. I was considering to include your amazing project. Would that be okay? I of course would include proper attribution.

Thanks

query npm_cache and npm_globals only when required

Currently these parameters queried on each module load, which adds delay to each console startup time. Hovewer these values are only required when completing some npmcommands / processing prompt when inside package.

Need to make these values lazy-loaded only when really required.

Improve yarn run completions

Unlike NPM, yarn run can run local modules in addition to project.json scripts.

I managed to do that locally with the following simple changes:

local bins = matchers.create_files_matcher('node_modules/.bin/*.')
-- ... skip some parser code
"run"..parser({bins, scripts}),

And this works, with 2 limitations that I am not sure how to fix:

  • I would like to color the scripts to make them more prominent. I tried to color_text the results but it didn't work.
  • it seems create_files_matcher returns . and ... create_dirs_matcher has some code to avoid that, it should probably be added to create_files_matcher as well.

clink/clink.lua:897: Tables can't have meta-tables.

I am trying to use your most recent version of git.lua with the latest clink (0.4.2). I keep getting following error -

Clink v0.4.2 [git:1111eb] Copyright (c) 2014 Martin Ridgers
http://mridgers.github.io/clink
D:\Apps\cmder\vendor\clink-new/clink.lua:897: Tables can't have meta-tables.

I see that clink is updated as per your suggestions for config file. I also verified that the error is displayed only when I use newer version of git.lua. I have an old version from cmder and it doesn't yield error but is way too limited. Thanks a ton for investing your time in writing these useful scripts. I would request you to distribute most recent compatible version of clink too along with your extensions to avoid compatibility issues.

"npm run" autocompletion doesn't display scripts after script with { and }

npm run autocompletion doesn't display scripts after script that contains { and }.

My scripts block:

  "scripts": {
    "grunt": "grunt",
    "build": "grunt styles",
    "cordova": "cordova",
    "ionic": "ionic",
    "jspm": "jspm",
    "bundle": "jspm bundle app/desktop/main.js - text www/dist/app.js --no-mangle --skip-source-maps --inject",
    "nwb": "nwb",
    "prepare:nwjs": "grunt styles",
    "bundle-sfx:nwjs": "jspm bundle-sfx app/nwjs/main platforms/nwjs/platform_www/sfx.js  --no-mangle --skip-source-maps",
    "nwbuild": "nwb nwbuild -o platforms/nwjs/build platforms/nwjs/platform_www/ -i \"./www:{app/**,jspm_packages/github/driftyco/ionic*/fonts/*.woff,jspm_packages/npm/font-awesome*/fonts/*.woff}\" --win-ico ./resources/nwjs/icon.ico --mac-icns ./resources/nwjs/icon.icns",
    "nwbuild:prod": "npm run nwbuild -- -v 0.15.0",
    "nwbuild:dev": "npm run nwbuild -- -v 0.15.0-sdk",
    "build:nwjs:prod": "npm run prepare:nwjs && npm run bundle-sfx:nwjs && npm run nwbuild:prod",
    "build:nwjs:dev": "npm run prepare:nwjs && npm run bundle-sfx:nwjs && npm run nwbuild:dev",
    "run:nwjs:dev": "nwb nwbuild ./www -v 0.15.0-sdk -r"
  },

Autocompletion output:

 C:\dev\ft\development>npm run
 build            bundle-sfx:nwjs  grunt            jspm             prepare:nwjs
 bundle           cordova          ionic            nwb

Autocompletion after I remove { and } from nwbuild:

C:\dev\ft\development>npm run
build            bundle           grunt            nwb              nwbuild:prod
build:nwjs:dev   bundle-sfx:nwjs  ionic            nwbuild          prepare:nwjs
build:nwjs:prod  cordova          jspm             nwbuild:dev      run:nwjs:dev

Git prompt example?

Is anyone using a git prompt, something that shows current branch etc? If so, can you share it so I can copy/modify :)

Complete remote branches for `git checkout`

If there's a remote branch origin/foo but no local branch foo, then git checkout foo automatically sets up a new local branch foo that tracks origin/foo. Currently, the completion foo is not picked up because the name of the existing branch is origin/foo, not foo. I would be nice to get completion for the foo in such situations.

Git completions don't work for submodules

Git completions seem to rely on finding the git-dir as per

local function get_git_dir(start_dir)
-- Checks if provided directory contains git directory
local function has_git_dir(dir)
return #clink.find_dirs(dir..'/.git') > 0
end
-- Set default path to current directory
if not start_dir or start_dir == '.' then start_dir = clink.get_cwd() end
-- If we're already have .git directory here, then return current path
if has_git_dir(start_dir) then return start_dir..'/.git' end
-- Otherwise go up one level and make a recursive call
local parent_path = path.pathname(start_dir)
if parent_path ~= start_dir then return get_git_dir(parent_path) end
end

However, since Git 1.7.8, submodules don't contain a .git/ folder anymore.
Instead, the submodule directory is populated with a .git text file
which contains a git-dir: /path/to/superproject/git_dir/modules/name.

See: https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.8.txt#L109-L114

It believe that changing the implementation of get_git_dir() to make it parse the git-dir value from the .git text file will solve the issue. I would have offered a PR right now if I was more familiar with the Lua syntax :)

Installation Guidance:

Is there guidance on how you install these completions?

For examples, right now I'm copying from this git directory into %localappdata%. Is there a better way?

Better display of yarn run completions

Following #74, I tested formatted completions: /.bin executables are displayed plain, package.json scripts are prefixed with a *.
yarn run
The result is better than nothing, although color would be 10x better ๐Ÿ˜ญ

To achieve this, I modified the scripts function as follows:

local function scripts_display_filter(scripts)
    return function(matches)
        for i, m in ipairs(matches) do
            local prefix = scripts[m] ~= nil and '* ' or '  '
            matches[i] = prefix..m
        end
        return matches
    end
end

-- Reads package.json in current directory and extracts all "script" commands defined
local function scripts(token)
    -- Read package.json first
    local package_json = io.open('package.json')
    -- If there is no such file, then close handle and return
    if package_json == nil then return {} end

    -- Read the whole file contents
    local package_contents = package_json:read("*a")
    package_json:close()

    local scripts = w(JSON:decode(package_contents).scripts)
    clink.match_display_filter = scripts_display_filter(scripts)
    return scripts:keys()
end

git.lua locks `packed-refs` file

Running git gc causes following error:

Rename from '<some_path>/.git/packed-refs.lock' to '<some_path>/.git/packed-refs' failed. Should I try again? (y/n)

Request for npm install

Hello,

I would like to request autocomple for npm install (suggesting packages) like it does from npm remove.

Thank you!

clink-completions/vagrant.lua:66

I installed cmdr which hapens to use your clink-completions. I stumbled upon this error, where we get the following message when a console starts.

.../vendor/clink-completions/vagrant.lua:66: Additional arguments to new_parser() must be tables or strings

This issue has been reported on cmdr issue #779, but no real fix has been found.

Currently I have commented out line 66 to have the message go away, but I'm missing the intended functionality.

I have tryed to troublesoot the issue, but was not able to figure it out. So, I just want to report the issue so you are ware of it.

Thanks.

Improve completion for choco packages

Recently Chocolatey is moving to different naming strategy when it comes to packages.

If I'm having a git.install package installed, clink completions shows only git as a suggestion.

I guess the regex should be:

local package_name = dir:match("^(%w%.*)%.")

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.