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

#982: Add plugin recommendation feature to vscode #993

Merged
merged 30 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
76f5821
add recommendation feature
alfeilex Nov 22, 2022
40e7475
fix typo
alfeilex Nov 22, 2022
c7df866
modify feature
alfeilex Nov 24, 2022
a908822
update rm -fR to rm
alfeilex Nov 24, 2022
a67319d
update docs and changelog
alfeilex Nov 24, 2022
fbe8a3b
fix typo
alfeilex Nov 24, 2022
9d7e28f
Merge branch 'master' into feature/vscode-recommendations
alfeilex Dec 8, 2022
09bf643
Merge branch 'master' into feature/vscode-recommendations
alfeilex Dec 14, 2022
1037e58
Merge branch 'master' into feature/vscode-recommendations
hohwille Dec 19, 2022
3e4e62f
Merge branch 'devonfw:master' into feature/vscode-recommendations
alfeilex Jan 18, 2023
1f81c97
resolve review tasks
alfeilex Jan 18, 2023
c8f0945
Update CHANGELOG.asciidoc
alfeilex Jan 18, 2023
60be735
Update vscode
alfeilex Jan 18, 2023
00dff71
Update vscode.asciidoc
alfeilex Jan 18, 2023
a4e7e66
Update vscode.asciidoc
alfeilex Jan 18, 2023
637d00a
Merge branch 'master' into feature/vscode-recommendations
alfeilex Jan 23, 2023
e710417
redesign recommendation functionality
alfeilex Jan 23, 2023
f386ce5
Merge branch 'feature/vscode-recommendations' of https://github.com/a…
alfeilex Jan 23, 2023
b14db26
Merge branch 'master' into feature/vscode-recommendations
alfeilex Jan 31, 2023
935d904
Merge branch 'devonfw:master' into feature/vscode-recommendations
alfeilex Feb 2, 2023
07c5842
Merge branch 'master' into feature/vscode-recommendations
alfeilex Feb 6, 2023
3ffb2e4
Update CHANGELOG.asciidoc
alfeilex Feb 7, 2023
d346dba
Merge branch 'master' into feature/vscode-recommendations
alfeilex Feb 7, 2023
9e586f7
Merge branch 'master' into feature/vscode-recommendations
alfeilex Feb 7, 2023
90083b5
Merge branch 'master' into feature/vscode-recommendations
hohwille Feb 13, 2023
ddb836d
resolve review feedback
alfeilex Feb 27, 2023
5172502
add hint for main workspace
alfeilex Feb 28, 2023
4252749
#982: #993: improved doc
hohwille Mar 2, 2023
980bd54
Merge branch 'master' into feature/vscode-recommendations
hohwille Mar 2, 2023
5b93fcc
Merge branch 'master' into feature/vscode-recommendations
hohwille Mar 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/ide[devonf

Release with new features and bugfixes:

* https://github.com/devonfw/ide/issues/982[#982]: Add plugin recommendation feature to vscode
* https://github.com/devonfw/ide/issues/1004[#1004]: GCloud CLI integration for windows
* https://github.com/devonfw/ide/issues/939[#939]: Consider extending test-functions-doc with invocation of undeclared functions

Expand Down
2 changes: 1 addition & 1 deletion documentation/vscode.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The variables are defined as following:

In general you should try to stick with the configuration pre-defined by your project. But some plugins may be considered as personal flavor and are typically not predefined by the project config. Such plugins should be shipped with your link:settings.asciidoc[settings] as described above with `plugin_active=false` allowing you to easily install it manually. Surely, you can easily add plugins via the UI of VS code. However, be aware that some plugins may collect sensitive data or could introduce other vulnerabilities. So consider the governance of your project and talk to your technical lead before installing additional plugins that are not pre-defined in your link:settings.asciidoc[settings].

As maintainer of the link:settings.asciidoc[settings] for your project you should avoid to ship too many plugins that may waste resources but are not used by every developer. By configuring additional plugins with `plugin_active=false` you can give your developers the freedom to install some additional plugins easily.
As maintainer of the link:settings.asciidoc[settings] for your project you should avoid to ship too many plugins that may waste resources but are not used by every developer. By configuring additional plugins with `plugin_active=false` you can give your developers the freedom to install some additional plugins easily. In addition, these plugins are recommended to the user by recommendation link:https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions[feature] of VS Code.

=== cleaning plugins on update

Expand Down
45 changes: 45 additions & 0 deletions scripts/src/main/resources/scripts/command/vscode
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,55 @@ function doRunVsCode() {

function doStartVsCode() {
doConfigureVsCode -u
doAddRecmdt
hohwille marked this conversation as resolved.
Show resolved Hide resolved
doEcho "launching VSCode..."
doRunVsCode "${WORKSPACE_PATH}"
}

function doAddRecmdt() {
local recmdtJSON="${WORKSPACE_PATH}/.vscode/extensions.json"
local file
local recmdtKey
local recmdtValue
local pluginsToRecmdt=()
for file in "${SETTINGS_PATH}"/vscode/plugins/*.properties
do
hohwille marked this conversation as resolved.
Show resolved Hide resolved
if [ -f "${file}" ]
then
plugin_id=""
plugin_active="true"
doLoadProperties "${file}"
if [ -z "${plugin_id}" ]
then
doWarning "Invalid vscode plugin config: ${file}"
elif [ "${plugin_active}" = "false" ]
then
local IFS=,
pluginsToRecmdt+=("\"${plugin_id}\"")
fi
fi
done
recmdtValue=${pluginsToRecmdt[*]}
recmdtKey="\"recommendations\": [$recmdtValue]"
if [ -f "${recmdtJSON}" ] && [ ! -s "${recmdtJSON}" ]
then
if grep -q "\"recommendations\":" "${recmdtJSON}"
then
if ! grep -Fq "${recmdtKey}" "${recmdtJSON}"
then
sed -i "s/\"recommendations\": \[[^]]*\]/${recmdtKey}/g" "${recmdtJSON}"
hohwille marked this conversation as resolved.
Show resolved Hide resolved
doSuccess "Plugin recommendations have been updated in ${recmdtJSON}."
fi
else
sed -i 's/^{/{ '"$recmdtKey"', /' "${recmdtJSON}"
doSuccess "Plugin recommendations have been added in ${recmdtJSON}."
fi
else
echo "{${recmdtKey}}" > "${recmdtJSON}"
doSuccess "Plugin recommendations have been created in ${recmdtJSON}"
fi
}

# CLI
if [ "${1}" = "-h" ] || [ "${1}" = "help" ]
then
Expand Down