Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Add setting to exclude files from diagnostic publishing.
- java.diagnostic.filter setting
- Suggest project reload when the setting changes and add support for
  arrays in hasConfigKeyChanged(..)

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
  • Loading branch information
rgrunber committed Jul 26, 2024
commit 8359ce997340a70cc7395756eab6b60ac09713a8
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ The following settings are supported:
* `java.configuration.detectJdksAtStart`: Automatically detect JDKs installed on local machine at startup. If you have specified the same JDK version in `java.configuration.runtimes`, the extension will use that version first. Defaults to `true`.
* `java.completion.collapseCompletionItems`: Enable/disable the collapse of overloaded methods in completion items. Overrides `java.completion.guessMethodArguments`. Defaults to `false`.

New in 1.33.0
* `java.diagnostic.filter`: Specifies a list of file patterns for which matching documents should not have their diagnostics reported (eg. '**/Foo.java').

Semantic Highlighting
===============
[Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience a few minor issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing. Semantic highlighting can be disabled for all languages using the `editor.semanticHighlighting.enabled` setting, or for Java only using [language-specific editor settings](https://code.visualstudio.com/docs/getstarted/settings#_languagespecific-editor-settings).
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,15 @@
"markdownDescription": "Specifies whether to recheck all open Java files for diagnostics when editing a Java file.",
"scope": "window"
},
"java.diagnostic.filter": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Specifies a list of file patterns for which matching documents should not have their diagnostics reported (eg. '**/Foo.java').",
"scope": "window"
},
"java.editor.reloadChangedSources": {
"type": "string",
"enum": [
Expand Down
9 changes: 7 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ function hasJavaConfigChanged(oldConfig: WorkspaceConfiguration, newConfig: Work
|| hasConfigKeyChanged('jdt.ls.vmargs', oldConfig, newConfig)
|| hasConfigKeyChanged('server.launchMode', oldConfig, newConfig)
|| hasConfigKeyChanged('sharedIndexes.location', oldConfig, newConfig)
|| hasConfigKeyChanged('transport', oldConfig, newConfig);
|| hasConfigKeyChanged('transport', oldConfig, newConfig)
|| hasConfigKeyChanged('diagnostic.filter', oldConfig, newConfig);
}

function hasConfigKeyChanged(key, oldConfig, newConfig) {
return oldConfig.get(key) !== newConfig.get(key);
const oldValue = oldConfig.get(key);
const newValue = newConfig.get(key);
return Array.isArray(oldValue) && Array.isArray(newValue)
? JSON.stringify(oldValue) !== JSON.stringify(newValue)
: oldValue !== newValue;
}

export function getJavaEncoding(): string {
Expand Down