From 8d7e266943447a97ad09caebc263f3b2d6abdbde Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Wed, 15 Dec 2021 14:21:36 +0100 Subject: provide a "make vscode-ide-integration" target to be consistent with the other ide integrations and to take care of the extra step of running "make vim-ide-integration" to create the compile_commands.json file required by the vscode integration. Not using the autogenerated file created by configure directly might also spare some users from having their own additions overridden Change-Id: Ibb269197dc84f607b28ddad03adc919864e0c040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126860 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- .vscode/vs-code-template.code-workspace.in | 6 +++--- Makefile.in | 12 +++++++++++- configure.ac | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.vscode/vs-code-template.code-workspace.in b/.vscode/vs-code-template.code-workspace.in index fe20726afaeb..61df6099bce7 100644 --- a/.vscode/vs-code-template.code-workspace.in +++ b/.vscode/vs-code-template.code-workspace.in @@ -1,6 +1,6 @@ -// *** Autogenerated file - created by configure.ac *** -// you should save the auto-generated vs-code-templates.code-workspace to a separate file -// to prevent your changes from being overwritten +// *** vs-code.code-workspace.template is an autogenerated file created by configure.ac *** +// any changes to the vs-code.code-workspace.template file WILL BE OVERRIDDEN +// use the vs-code.code-worskpace file (make vscode-ide-integration) for your own edits { "extensions": { "recommendations": [ diff --git a/Makefile.in b/Makefile.in index f089fa9a0d48..bf756f205915 100644 --- a/Makefile.in +++ b/Makefile.in @@ -228,7 +228,7 @@ distclean : clean compilerplugins-clean $(BUILDDIR)/instsetoo_native/util/openoffice.lst \ $(BUILDDIR)/solenv/lockfile/autoconf.h \ $(BUILDDIR)/sysui/desktop/macosx/Info.plist \ - $(BUILDDIR)/vs-code-template.code-workspace + $(BUILDDIR)/vs-code*.code-workspace* $(if $(filter WNT,$(OS)),env -i PATH="$$PATH") $(FIND) $(SRCDIR)/solenv/gdb -name \*.pyc -exec rm {} \; # @@ -493,6 +493,16 @@ $(foreach ide,\ eclipsecdt,\ $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide)))) +# vscode integration is based on compile_commands.json, which is generated by vim-ide-integration +# the workspace template created by configure doesn't provide advanced/fine grained targets but +# rather supplies some useful settings and basic examples for run/debug configurations +# this target is provided primarily for consistency with the other ide-integrations +vscode-ide-integration: $(BUILDDIR)/vs-code.code-workspace vim-ide-integration + +$(BUILDDIR)/vs-code.code-workspace: $(BUILDDIR)/vs-code.code-workspace.template + @test -e $@ || cp $< $@ && \ + cmp -s $@ $< || echo "ATTN: $(@F) differs from $(