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

request: project-specific settings #1

Closed
canfoderiskii opened this issue Apr 24, 2016 · 14 comments
Closed

request: project-specific settings #1

canfoderiskii opened this issue Apr 24, 2016 · 14 comments
Assignees
Milestone

Comments

@canfoderiskii
Copy link

Is there any possiblilty that adding a 'read project-specific setting' feature before processing a file?

Maybe the project-specific setting file is a .clang_complete file as used by vim's clang_complete plugin.

EasyClangComplete can search up from the directory tree for the setting file. If it's found, use it to add parameters passed to clang.

@niosus
Copy link
Owner

niosus commented Apr 24, 2016

Yep, the possibility is there. :) Thanks for a suggestion. It sounds pretty good. Can you tell me more about how are you about to use it? Is it only the .clang_complete file or do you intend something in addition to it?

The .clang_complete is easy to find and its structure is fairly easy to parse, so I can try to add it this week.

niosus added a commit that referenced this issue Apr 24, 2016
- add new `search_clang_complete_file` setting. Setting it to `true` forces the plugin to search for `.clang_complete` file up the tree and to add its contents to include lists. This should address issue #1. Testing needed.
- removed redundand default encoding setting
- updated readme with new parameter
@niosus
Copy link
Owner

niosus commented Apr 24, 2016

Hey @canfoderiskii I have just pushed a commit with the support for the simple functionality of searching the file .clang_complete up the tree and adding its contents to include list. Can you please try to verify if this is working for you?

If not please tell me what fails and please be specific about the version of sublime text and os you are running. Thanks!

@canfoderiskii
Copy link
Author

@niosus Okay, I will update the plugin and test it when I'm not so busy these two days, and i'm using sublime text 3103.

Thank you for the great work.

By the way, for your question about how i would use the new feature, a boolean switch in setting file is preferred. That switch controls whether to use .clang_complete file only.

@canfoderiskii
Copy link
Author

@niosus I did a quick test, found a problem.

create a new .c file, in which i have a struct definition & struct variable declaration. When i type in "sturctVariable." or "pStructVariable->", i cannot get auto-completed struct members. If manually call autocomplete via key binding, the sublime text status bar displays "No available completion".

I tried with/without .clang_complete file, or on/off the switch "search_clang_complete_file"/"include_file_folder", cannot solve the problem.

I also tried both syntax, "C" or "C Improved", problem still remains.

Then tried another plugin, ClangAutoComplete, I can get auto-completed struct member normally.

In addition, i'm using sublime text on Win10 Pro x64.

@niosus
Copy link
Owner

niosus commented Apr 25, 2016

Wait for calling it great until you're able to run it :)
Anyway, there is a setting in the plugin search_clang_complete_file. It will enable searching for .clang_complete file. It is on by default.

Also, I had one more question. Are you intending to use a .clang_complete file on a global level? Say in home directory? For now the plugin will only search until the project folder is reached and no further.

Also, I'm not too familiar with typical usage of such file. Is it only for includes or is it also for other compile flags? For now I read only lines that start with -I, e.g. -Isrc and after parsing it is just src

@niosus
Copy link
Owner

niosus commented Apr 25, 2016

Thanks for trying out @canfoderiskii !

Uh, Windows :) I am not too familiar with it. Can you please enable the verbose flag in settings and look into the sublime console for a line COMPLETIONS WILL NOT BE AVAILABLE? If you see it - it means that the plugin cannot find libclang.

Alternatively, can you point me to a good tutorial on how to install clang on windows and I will return to you once I have found out what happens there.

@canfoderiskii
Copy link
Author

@niosus , I turned on verbose flag, and saw this line in the sublime text console:
EasyClangComplete: function 'clang_CXXField_isMutable' not found. Please ensure that your python bindings are compatible with your libclang.so version.
Looks like libclang.so is where the problem comes from.

Installing clang is simple on Windows, binary is provided officially.
We can download it from this page: http://llvm.org/releases/download.html. The downloaded file for Windows is a installer and installation is simple: pick a target path and keep clicking "Next".

@niosus
Copy link
Owner

niosus commented Apr 25, 2016

Oh, ok. Thanks. I guess I will then install it on my windows setup and see what is going on there. I will try to finish it in the next couple of days.

@canfoderiskii
Copy link
Author

@niosus Thank you for replying so quickly and for your work.

@niosus
Copy link
Owner

niosus commented Apr 25, 2016

@canfoderiskii you're welcome :) I really want to make this one easy to use, so thanks for your help.

@canfoderiskii
Copy link
Author

canfoderiskii commented Apr 25, 2016

@niosus I just found out that i missed one of your reply. Let me answer here As far as i know, the .clang_complete file contains parameters "-I" and "-D", the former is for path while the latter is for macro definition.

And that file may not be located in Home folder, It can be anywhere I need it to be, maybe a project source folder

@niosus niosus added this to the 0.0.1 milestone Apr 25, 2016
@niosus niosus self-assigned this Apr 25, 2016
@niosus
Copy link
Owner

niosus commented Apr 25, 2016

@canfoderiskii ok, I will look into -D lines too then :)

niosus added a commit that referenced this issue May 1, 2016
@niosus
Copy link
Owner

niosus commented May 1, 2016

I added full support for this feature. Now one is able to use -I<abs_path>, -I<local_path> and -D<macros> in a .clang_complete file. I close this issue for now. You will be able to test it as soon as I find a solution to issue #4

@niosus niosus closed this as completed May 1, 2016
@canfoderiskii
Copy link
Author

@niosus Okay, thank you

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants