-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[plug-in][java][preferences] Add files.exclude preference #4274
Conversation
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.
fine for me for plugin-related code
waiting other feedback for preferences part
I do not know much about the VS Code extensions but why do not we have one preference for this in Theia instead of having both the |
@kittaakos for me it makes sense to remove |
Figuring this out should be part of this PR, I think. If possible, the two preferences should be merged. Otherwise, it could be confusing later why do we have two. // cc @akosyakov |
@svor @kittaakos If |
@akosyakov @kittaakos I've made changes to use just |
There is a list of default settings here: https://code.visualstudio.com/docs/getstarted/settings |
@akosyakov @kittaakos @svenefftinge |
Doing the review... |
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.
Other than my comment on the ctor, it works as expected. Thank you!
protected showHiddenFiles: boolean; | ||
|
||
constructor( | ||
@inject(FileNavigatorPreferences) protected readonly preferences: FileNavigatorPreferences | ||
@inject(FileSystemPreferences) protected readonly filesPreferences: FileSystemPreferences |
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.
You should leave the constructor as it was
@inject(FileNavigatorPreferences) protected readonly preferences: FileNavigatorPreferences
and use property injection for the FileSystemPreferences
. Otherwise, you break another API.
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.
@kittaakos Thank you for your review. Can you explain more which API it can break?
I don't see any reason to inject FileNavigatorPreferences
here it is never used in this class
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.
Can you explain more which API it can break?
Sure. Subclasses must call super in the ctors. If there is any subclass of the FileNavigatorFilter
, you will break client code if we publish a new latest
version. If clear, please adjust , if no, or I have overlooked something, let me know.
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.
@kittaakos Thank you for the explanation, it is clear! I've fixed that.
I'll give it a try once more, but it should be fine... |
@@ -60,14 +64,10 @@ export class FileNavigatorFilter { | |||
this.emitter.fire(undefined); | |||
} | |||
|
|||
protected onPreferenceChanged(event: PreferenceChangeEvent<FileNavigatorConfiguration>): void { | |||
let hasChanged = false; | |||
protected onFilesPreferenceChanged(event: PreferenceChangeEvent<FileSystemConfiguration>): void { |
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.
This cannot be renamed. Please restore the original method name. Sorry for not mentioning it before :(
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.
I left this method as it is, and added
protected onPreferenceChanged(event: PreferenceChangeEvent<FileNavigatorConfiguration>): void
with empty body. Please take another look at it :)
…avigator.exclude Signed-off-by: Valeriy Svydenko <vsvydenk@redhat.com>
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.
It works nicely, thank you for the patch!
Signed-off-by: Valeriy Svydenko vsvydenk@redhat.com
The problem
VS Code has
files.exclude
preference and some of VS Code extensions want to change value of this preference. In my case it is java-vscode extension. The last version of java-vscode extension (0.38.0) asks user to exclude some types of files (.project
,.classpath
) to hide them in Files view. To do that the extension wants to extendfiles.exclude
preference, but Theia doesn't have such preference.Changes
This PR offers to add
files.exclude
and makes it possible to hide excluded files/folders in Files view.Related issue
#4254
Short demo