xulion / scope4code

cscope support for visual studio code
MIT License
21 stars 8 forks source link

External cscope database generation #31

Closed ydeweerdt closed 5 years ago

ydeweerdt commented 5 years ago

Some projects like u-boot and the linux kernel have a dedicated make target to generate the cscope database. In order to take advantage of that 3 changes were required:

xulion commented 5 years ago

Thank you for improve the tool! Will update the version and release it later today.

ydeweerdt commented 5 years ago

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-487762799, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A .

ydeweerdt commented 5 years ago

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-487762799, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A .

xulion commented 5 years ago

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-487762799, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

ydeweerdt commented 5 years ago

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-487762799, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A .

xulion commented 5 years ago

Sorry Yves for the late reply. I have to spend all my effort to my work in the past 2 month. For the change, I understand now the compile_commands.json is to help to generate the file list for cscope database, right?

The one thing I’m concerning about is this might be to specific to CMake. What do you think instead of CMake JSON, allow to call a separate script to provide file list?

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "file_list_generator" : "${workspaceRoot}/build/cscope_file_list_generator.sh" // could be js, py, any script } } ] }

Sent from Mail for Windows 10

From: Yves Sent: Friday, May 3, 2019 12:54 PM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-487762799, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

ydeweerdt commented 5 years ago

Hello,

compile_commands.json is indeed something that was introduced by cmake, and is used nowadays by several IDEs to know how to build a project, and know on which files a compilation unit depends, and which files are required for the project. There is even a script included in the linux kernel nowadays to generate a compile_commands.json file based on the selected kernel configuration for this purpose ( see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gen_compile_commands.py ). So I would not make the statement any more that this is Cmake specific :-)

Your suggestion could be an option too, it would probably be more general, because you can provide any file_list_generator, even a simple find would do. Before I started using vscode and scope4code, I was using vim with a bunch of plugins and I had an external tool in javascript to process the compile_commands.json, have it generate the file list, and call both cscope and ctags, at this moment I was using this external tool in the "build_command" to generate the cscope database, based on the compile_commands.json.

The reason I proposed to integrate the file list generation, based on the compile_commands.json, is just to avoid having to install external tools and have all functionality integrated in scope4code :-)

Kind regards,

Yves

On Mon, Jul 22, 2019 at 10:04 PM xulion notifications@github.com wrote:

Sorry Yves for the late reply. I have to spend all my effort to my work in the past 2 month. For the change, I understand now the compile_commands.json is to help to generate the file list for cscope database, right?

The one thing I’m concerning about is this might be to specific to CMake. What do you think instead of CMake JSON, allow to call a separate script to provide file list?

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "file_list_generator" : "${workspaceRoot}/build/cscope_file_list_generator.sh" // could be js, py, any script } } ] }

Sent from Mail for Windows 10

From: Yves Sent: Friday, May 3, 2019 12:54 PM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/xulion/scope4code/pull/31#issuecomment-487762799 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HMBUGJYJYNNY6F3P3QAYHGLA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RAB3A#issuecomment-513933548, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4H6HTUCYOFQZ5KYPXLQAYHGLANCNFSM4HIQ4B5A .

xulion commented 5 years ago

Yves,

Very sorry for the slow response. I have to prioritize my work over this and unfortunately the work is tough recently.

Glad you raise all these questions and I think the current design of the extension seems not flexible enough thus I’m redesigning it to be more configurable. I’m now thinking I shall put everything into a config json so user can freely change the command line and even define how the result shall be parsed. Will update you once I get this done and hopefully the new design could meet your requirement.

BRs, Leon.

Sent from Mail for Windows 10

From: Yves Sent: Tuesday, July 30, 2019 8:02 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

compile_commands.json is indeed something that was introduced by cmake, and is used nowadays by several IDEs to know how to build a project, and know on which files a compilation unit depends, and which files are required for the project. There is even a script included in the linux kernel nowadays to generate a compile_commands.json file based on the selected kernel configuration for this purpose ( see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gen_compile_commands.py ). So I would not make the statement any more that this is Cmake specific :-)

Your suggestion could be an option too, it would probably be more general, because you can provide any file_list_generator, even a simple find would do. Before I started using vscode and scope4code, I was using vim with a bunch of plugins and I had an external tool in javascript to process the compile_commands.json, have it generate the file list, and call both cscope and ctags, at this moment I was using this external tool in the "build_command" to generate the cscope database, based on the compile_commands.json.

The reason I proposed to integrate the file list generation, based on the compile_commands.json, is just to avoid having to install external tools and have all functionality integrated in scope4code :-)

Kind regards,

Yves

On Mon, Jul 22, 2019 at 10:04 PM xulion notifications@github.com wrote:

Sorry Yves for the late reply. I have to spend all my effort to my work in the past 2 month. For the change, I understand now the compile_commands.json is to help to generate the file list for cscope database, right?

The one thing I’m concerning about is this might be to specific to CMake. What do you think instead of CMake JSON, allow to call a separate script to provide file list?

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "file_list_generator" : "${workspaceRoot}/build/cscope_file_list_generator.sh" // could be js, py, any script } } ] }

Sent from Mail for Windows 10

From: Yves Sent: Friday, May 3, 2019 12:54 PM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt yves.deweerdt@gmail.com wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/xulion/scope4code/pull/31#issuecomment-487762799 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HMBUGJYJYNNY6F3P3QAYHGLA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RAB3A#issuecomment-513933548, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4H6HTUCYOFQZ5KYPXLQAYHGLANCNFSM4HIQ4B5A .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

ydeweerdt commented 5 years ago

Hello Leon,

I still have another question for you :-) The ms-vscode-cpptools allow working with different configurations, each of these configurations can work with a specific compile_commands.json. I wonder if it would be possible to incorporate this somehow into scope4code, to maintain different cscope databases in a workspace based on the configuration in use. To give you an idea, my projects/workspaces are typically consisting of u-boot, linux kernel, some out-of-tree kernel modules, buildroot for the custom embedded linux distribution, and then one or more applications in C++. So I am configuring multiple configurations in the cpptools, one for the u-boot, one for the kernel, one for the out-of-tree kernel modules, and then 2 configurations for each of the C++ applications (one for the on-target compiled application, and one for a "hostbuild" we use a lot during development to run tests, just on the desktop).

It would be nice to be able to use the information from these different configurations to maintain a cscope database for each configuration :-)

I have been looking into that already myself, but I am not familiar enough with the entire typescript/vscode extension environment to find a decent solution for this myself... This one came closest to what I had in mind: https://github.com/microsoft/vscode-cpptools/issues/1524, but I can't seem to find how to use this ${command:cpptools.activeConfigName} from an extension.

Kind regards,

Yves

On Fri, Aug 16, 2019 at 4:59 PM xulion notifications@github.com wrote:

Yves,

Very sorry for the slow response. I have to prioritize my work over this and unfortunately the work is tough recently.

Glad you raise all these questions and I think the current design of the extension seems not flexible enough thus I’m redesigning it to be more configurable. I’m now thinking I shall put everything into a config json so user can freely change the command line and even define how the result shall be parsed. Will update you once I get this done and hopefully the new design could meet your requirement.

BRs, Leon.

Sent from Mail for Windows 10

From: Yves Sent: Tuesday, July 30, 2019 8:02 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

compile_commands.json is indeed something that was introduced by cmake, and is used nowadays by several IDEs to know how to build a project, and know on which files a compilation unit depends, and which files are required for the project. There is even a script included in the linux kernel nowadays to generate a compile_commands.json file based on the selected kernel configuration for this purpose ( see

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gen_compile_commands.py ). So I would not make the statement any more that this is Cmake specific :-)

Your suggestion could be an option too, it would probably be more general, because you can provide any file_list_generator, even a simple find would do. Before I started using vscode and scope4code, I was using vim with a bunch of plugins and I had an external tool in javascript to process the compile_commands.json, have it generate the file list, and call both cscope and ctags, at this moment I was using this external tool in the "build_command" to generate the cscope database, based on the compile_commands.json.

The reason I proposed to integrate the file list generation, based on the compile_commands.json, is just to avoid having to install external tools and have all functionality integrated in scope4code :-)

Kind regards,

Yves

On Mon, Jul 22, 2019 at 10:04 PM xulion notifications@github.com wrote:

Sorry Yves for the late reply. I have to spend all my effort to my work in the past 2 month. For the change, I understand now the compile_commands.json is to help to generate the file list for cscope database, right?

The one thing I’m concerning about is this might be to specific to CMake. What do you think instead of CMake JSON, allow to call a separate script to provide file list?

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "file_list_generator" : "${workspaceRoot}/build/cscope_file_list_generator.sh" // could be js, py, any script } } ] }

Sent from Mail for Windows 10

From: Yves Sent: Friday, May 3, 2019 12:54 PM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt < yves.deweerdt@gmail.com> wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/xulion/scope4code/pull/31#issuecomment-487762799 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HMBUGJYJYNNY6F3P3QAYHGLA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RAB3A#issuecomment-513933548 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4H6HTUCYOFQZ5KYPXLQAYHGLANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HXKKPCHTJCSPR633TQE26ELA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4O3FGI#issuecomment-522039961, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4BWBNV63BSQYUQRWV3QE26ELANCNFSM4HIQ4B5A .

xulion commented 5 years ago

Interesting. I do use cpp tools myself, although I disable the database because it’s too slow when project is huge. Will look into it.

Thanks!

Sent from Mail for Windows 10

From: Yves Sent: Monday, August 19, 2019 3:12 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello Leon,

I still have another question for you :-) The ms-vscode-cpptools allow working with different configurations, each of these configurations can work with a specific compile_commands.json. I wonder if it would be possible to incorporate this somehow into scope4code, to maintain different cscope databases in a workspace based on the configuration in use. To give you an idea, my projects/workspaces are typically consisting of u-boot, linux kernel, some out-of-tree kernel modules, buildroot for the custom embedded linux distribution, and then one or more applications in C++. So I am configuring multiple configurations in the cpptools, one for the u-boot, one for the kernel, one for the out-of-tree kernel modules, and then 2 configurations for each of the C++ applications (one for the on-target compiled application, and one for a "hostbuild" we use a lot during development to run tests, just on the desktop).

It would be nice to be able to use the information from these different configurations to maintain a cscope database for each configuration :-)

I have been looking into that already myself, but I am not familiar enough with the entire typescript/vscode extension environment to find a decent solution for this myself... This one came closest to what I had in mind: https://github.com/microsoft/vscode-cpptools/issues/1524, but I can't seem to find how to use this ${command:cpptools.activeConfigName} from an extension.

Kind regards,

Yves

On Fri, Aug 16, 2019 at 4:59 PM xulion notifications@github.com wrote:

Yves,

Very sorry for the slow response. I have to prioritize my work over this and unfortunately the work is tough recently.

Glad you raise all these questions and I think the current design of the extension seems not flexible enough thus I’m redesigning it to be more configurable. I’m now thinking I shall put everything into a config json so user can freely change the command line and even define how the result shall be parsed. Will update you once I get this done and hopefully the new design could meet your requirement.

BRs, Leon.

Sent from Mail for Windows 10

From: Yves Sent: Tuesday, July 30, 2019 8:02 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

compile_commands.json is indeed something that was introduced by cmake, and is used nowadays by several IDEs to know how to build a project, and know on which files a compilation unit depends, and which files are required for the project. There is even a script included in the linux kernel nowadays to generate a compile_commands.json file based on the selected kernel configuration for this purpose ( see

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gen_compile_commands.py ). So I would not make the statement any more that this is Cmake specific :-)

Your suggestion could be an option too, it would probably be more general, because you can provide any file_list_generator, even a simple find would do. Before I started using vscode and scope4code, I was using vim with a bunch of plugins and I had an external tool in javascript to process the compile_commands.json, have it generate the file list, and call both cscope and ctags, at this moment I was using this external tool in the "build_command" to generate the cscope database, based on the compile_commands.json.

The reason I proposed to integrate the file list generation, based on the compile_commands.json, is just to avoid having to install external tools and have all functionality integrated in scope4code :-)

Kind regards,

Yves

On Mon, Jul 22, 2019 at 10:04 PM xulion notifications@github.com wrote:

Sorry Yves for the late reply. I have to spend all my effort to my work in the past 2 month. For the change, I understand now the compile_commands.json is to help to generate the file list for cscope database, right?

The one thing I’m concerning about is this might be to specific to CMake. What do you think instead of CMake JSON, allow to call a separate script to provide file list?

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "file_list_generator" : "${workspaceRoot}/build/cscope_file_list_generator.sh" // could be js, py, any script } } ] }

Sent from Mail for Windows 10

From: Yves Sent: Friday, May 3, 2019 12:54 PM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

if you take e.g. the neovim project, it is based on CMake and it generates the compile_commands.json file under the build/compile_commands.json.

my config for this project would be:

{ "version": "0.0.13", "open_new_column" : "no", "engine_configurations": [ { "cscope" : { "paths" : [ "${workspaceRoot}" ], "build_command" : "", "database_path" : "${workspaceRoot}/.vscode/cscope", "compile_commands_json" : "${workspaceRoot}/build/compile_commands.json" } } ] }

Hope this helps

Kind regards,

Yves On Fri, May 3, 2019 at 4:03 PM xulion notifications@github.com wrote:

Yves,

Don’t worry and I’m glad someone can help me. I’m too busy to update this. Everyone makes mistakes and unless we do nothing.

For your change, can you share me an example of the config? I would eventually need put it into the readme explaining how to config it and when to use it. I will take a look at this during weekend.

Sent from Mail for Windows 10

From: Yves Sent: Thursday, May 2, 2019 11:23 AM To: xulion/scope4code Cc: xulion; State change Subject: Re: [xulion/scope4code] External cscope database generation (#31)

Hello,

Sorry to mix up the default config... Hope that with this new pull request I don't give the same troubles again...

Yet another pull request, it should allow to specify a compile_commands.json file. then it will generate cscope.files by parsing the compile_commands.json to find all compilation units and the header files that are reachable through the given include paths for each compilation command.

Thx!

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:30 PM Yves Deweerdt < yves.deweerdt@gmail.com> wrote:

Thx for the update! Looking forward to take in the new release ;-)

Kind regards,

Yves

On Tue, Apr 30, 2019 at 12:14 AM xulion notifications@github.com wrote:

Thank you for improve the tool! Will update the version and release it later today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/xulion/scope4code/pull/31#issuecomment-487762799 , or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4FUNSXN2QXYUBAANZDPS5XKRANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31#issuecomment-489106179, or mute the thread <

https://github.com/notifications/unsubscribe-auth/AAAPX4DU5HPQYQ2BQIZ45Y3PTRAZ3ANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HMBUGJYJYNNY6F3P3QAYHGLA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RAB3A#issuecomment-513933548 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAAPX4H6HTUCYOFQZ5KYPXLQAYHGLANCNFSM4HIQ4B5A

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xulion/scope4code/pull/31?email_source=notifications&email_token=AAAPX4HXKKPCHTJCSPR633TQE26ELA5CNFSM4HIQ4B5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4O3FGI#issuecomment-522039961, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPX4BWBNV63BSQYUQRWV3QE26ELANCNFSM4HIQ4B5A .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

xulion commented 4 years ago

Yves,

I've released a new version with fully customizable command include file search and database build. Hope you could give it a try to see if it could meet your needs.

Thanks!