Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telescope cmake_tools throws #109

Closed
Amleto opened this issue Jul 29, 2023 · 7 comments
Closed

Telescope cmake_tools throws #109

Amleto opened this issue Jul 29, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Amleto
Copy link
Contributor

Amleto commented Jul 29, 2023

Bug description

I'm not sure if there are some undocumented pre-reqs or anything?

Run :Telescope cmake_tools gives:

Error executing Lua callback: ...ta/lazy/cmake-tools.nvim/lua/cmake-tools/file_picker.lua:18: bad argument #1 to 'ipairs
' (table expected, got nil)
stack traceback:
        [C]: in function 'ipairs'
        ...ta/lazy/cmake-tools.nvim/lua/cmake-tools/file_picker.lua:18: in function 'get_files_from_target'
        ...ta/lazy/cmake-tools.nvim/lua/cmake-tools/file_picker.lua:51: in function 'get_source_files'
        ...ake-tools.nvim/lua/telescope/_extensions/cmake_tools.lua:30: in function 'fn'
        ...ake-tools.nvim/lua/telescope/_extensions/cmake_tools.lua:16: in function <...ake-tools.nvim/lua/telescope/_ex
tensions/cmake_tools.lua:8>
        .../nvim-data/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        .../nvim-data/lazy/telescope.nvim/lua/telescope/command.lua:253: in function 'load_command'
        ...Local/nvim-data/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...Local/nvim-data/lazy/telescope.
nvim/plugin/telescope.lua:107>

Steps to reproduce
I have telescope and cmake_tools plugins loaded. My current dir is a small c++/cmake repo. I run.
:Telescope cmake_tools

Minimal configuration

Expected behavior
The telescope command executed ok.

Screenshots

Environment

  • OS: Win10
  • Plugins commit hash: 8e8e952
@Amleto Amleto added the bug Something isn't working label Jul 29, 2023
@Civitasv
Copy link
Owner

@hfn92 can you see it

@hfn92
Copy link
Contributor

hfn92 commented Jul 29, 2023

can you upload the contens of ./cmake/api ? the whole project would be even better of course

@hfn92
Copy link
Contributor

hfn92 commented Jul 29, 2023

Still I think this should fix it #110
But would be good to know what the cmake api response looks like

@Amleto
Copy link
Contributor Author

Amleto commented Jul 29, 2023

can you upload the contens of ./cmake/api ? the whole project would be even better of course

I'm sorry, I don't know what that refers to.

My test repo is just 3 files at top level:

CMakeLists.txt
main.cpp:

#include <algorithm>
#include <iostream>
#include <list>
#include <string>
#include <vcruntime.h>
#include <vector>

#include "other_type.h"

//  help string
auto foo(int a, char y, size_t sz) -> std::list<int> {
    std::list<int> xxx;
    xxx.clear();
    return xxx;
}

int main() {

    std::cout << "hello\n";

    tempT<int> tt;
    tt.y = 1;

    auto l = foo(0, 'y', 9);
    auto l1 = foo;

    std::vector<int> is{1,2,3};
    is.pop_back();


    //std::transform()

    std::cin.get();

  return 0;

}

other_type.h:

#pragma once

class other_type {
public:
    int get_int() { return 2; }    
            
};

template<typename T>
class tempT {
    public:
        T t;
};

@Amleto
Copy link
Contributor Author

Amleto commented Jul 29, 2023

ah, ok. I have seen the dir.

Here is a gist of the reply.

There are two zero-byte files in the query dir.

image

@hfn92
Copy link
Contributor

hfn92 commented Jul 29, 2023

Ah, I see some of the visual studio specific targets were causing issues. Thanks

Btw does the fix work?

@Amleto
Copy link
Contributor Author

Amleto commented Jul 29, 2023

Yes, works great. Thanks for the extension!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants