-
Notifications
You must be signed in to change notification settings - Fork 456
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
Hide java project setting files by default. #776
Conversation
Signed-off-by: Yaohai Zheng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- maybe we should display a warning on the 1st startup of the extension, asking the user to enable that feature
- if the feature is disabled globally, then you manually enable it, the files are not excluded until the next vscode restart.
package.json
Outdated
"java.configuration.excludeProjectSettingFiles": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Exclude the extension generated project setting files from file explorer.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings from the file explorer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to explain setting it to false won't remove the exclusions
src/setting.ts
Outdated
import { getJavaConfiguration } from './utils'; | ||
|
||
|
||
const DEFAULT_HIIDEN_FILES: string[] = ['**/.classpath', '**/.project', '**/.settings']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HIDDEN
package.json
Outdated
@@ -89,6 +89,12 @@ | |||
"description": "Specifies the severity of the message when the classpath is incomplete for a Java file", | |||
"scope": "window" | |||
}, | |||
"java.configuration.excludeProjectSettingFiles": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hideProjectSettingsFiles
src/setting.ts
Outdated
}); | ||
} | ||
|
||
export function excludeProjectSettingFiles(workspaceUri: Uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excludeProjectSettingsFiles
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.classpath": true,
"**/.project": true,
"**/.settings": true
} is added to the local settings.json, even if the java exclusions are already defined at the user settings level. That's a big no no |
@fbricon Addressed the review feedback. |
Signed-off-by: Yaohai Zheng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/setting/settings/g
src/setting.ts
Outdated
@@ -0,0 +1,69 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings.ts
you also need to hide |
if your settings contains
agreeing to hide the project settings will change the settings to
|
For setting generated, if user choose the workspace or global, the settings is split. Should we always keep them the same place? I would let the user to make the decision here. |
Signed-off-by: vscjava <[email protected]>
@fbricon Updated |
How about we change the choices to
If files exclusions exists in the workspace preferences, then we don't propose to "Exclude globally" |
src/settings.ts
Outdated
let needUpdate = false; | ||
for (const hiddenFiles of DEFAULT_HIDDEN_FILES) { | ||
if (!excludedValue.hasOwnProperty(hiddenFiles)) { | ||
needExcludeFiles[hiddenFiles] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this will always store a subset of the files, overriding existing settings.
We do want to merge excludedValue + DEFAULT_HIDDEN_FILES in config.get('exclude')
if (!params.affectsConfiguration('java')) { | ||
return; | ||
} | ||
let newConfig = getJavaConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to check that if configuration.excludeProjectSettingsFiles is true, but it was false before, then excludeProjectSettingsFiles should be called.
Be aware that oldConfig is only changed if the "java configuration" changed, so it makes things a bit trickier.
Would keep the term simple and consistent with other messages in the similar situation. |
I'm fine with having better labels, but they need to be explicit |
@fbricon Updated PR. |
@yaohaizh I've renamed the new preference to better reflect its role: |
Signed-off-by: Yaohai Zheng <[email protected]>
@fbricon
Fix issue #618 which gives us lots of negative feedback and requested by the users.
Since this PR microsoft/vscode#66451 is closed by VSCode side, provide the vscode java setting to mitigate this issue.