Skip to content

Commit af84c6d

Browse files
committed
fix: Compile warnings
1 parent 968ddc1 commit af84c6d

File tree

2 files changed

+85
-73
lines changed

2 files changed

+85
-73
lines changed

dap-java.el

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ If the port is taken, DAP will try the next port."
9090
(defcustom dap-java-terminal 'internalConsole
9191
"Default java terminal."
9292
:group 'dap-java
93-
:type '(choice (const 'integratedTerminal)
94-
(const 'externalTerminal)
95-
(const 'internalConsole)))
93+
:type '(choice (const integratedTerminal)
94+
(const externalTerminal)
95+
(const internalConsole)))
9696

9797
(defcustom dap-java-args ""
9898
"Default java args."

lsp-java.el

+82-70
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
;; Java specific adapter for LSP mode
2525

2626
;;; Code:
27+
2728
(require 'cc-mode)
2829
(require 'lsp-mode)
2930
(require 'markdown-mode)
@@ -34,6 +35,9 @@
3435
(require 'request)
3536
(require 'cl-lib)
3637

38+
;; Compiler pacifier
39+
(defvar java-ts-mode-indent-offset)
40+
3741
(defgroup lsp-java nil
3842
"JDT emacs frontend."
3943
:prefix "lsp-java-"
@@ -47,7 +51,8 @@ The slash is expected at the end."
4751
:type 'directory)
4852

4953
(defcustom lsp-java-jdt-ls-prefer-native-command nil
50-
"Use native jdtls command provided by jdtls installation instead of lsp's java -jar invocation."
54+
"Use native jdtls command provided by jdtls installation instead of
55+
lsp's java -jar invocation."
5156
:risky t
5257
:type 'boolean)
5358

@@ -285,15 +290,15 @@ import is missing."
285290
:lsp-path "java.completion.favoriteStaticMembers")
286291

287292
(lsp-defcustom lsp-java-completion-import-order ["java" "javax" "com" "org"]
288-
"Defines the sorting order of import statements. A package or
289-
type name prefix (e.g. 'org.eclipse') is a valid entry. An import
290-
is always added to the most specific group."
293+
"Defines the sorting order of import statements.
294+
A package or type name prefix (e.g. `org.eclipse') is a valid entry.
295+
An import is always added to the most specific group."
291296
:type '(lsp-repeatable-vector string)
292297
:lsp-path "java.completion.importOrder")
293298

294299
(lsp-defcustom lsp-java-folding-range-enabled t
295-
"Enable/disable smart folding range support. If disabled, it
296-
will use the default indentation-based folding range provided by
300+
"Enable/disable smart folding range support.
301+
If disabled, it will use the default indentation-based folding range provided by
297302
VS Code."
298303
:type 'boolean
299304
:lsp-path "java.foldingRange.enabled")
@@ -305,8 +310,8 @@ processes on the server."
305310
:lsp-path "java.progressReports.enabled")
306311

307312
(lsp-defcustom lsp-java-format-settings-url nil
308-
"Specifies the url or file path to the [Eclipse formatter xml
309-
settings](https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings)."
313+
"Specifies the url or file path to the [Eclipse formatter XML settings]
314+
(https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings)."
310315
:type '(choice (string)
311316
(const nil))
312317
:lsp-path "java.format.settings.url")
@@ -342,13 +347,13 @@ and higher."
342347
:lsp-path "java.codeGeneration.hashCodeEquals.useJava7Objects")
343348

344349
(lsp-defcustom lsp-java-code-generation-hash-code-equals-use-instanceof nil
345-
"Use 'instanceof' to compare types when generating the hashCode
350+
"Use `instanceof' to compare types when generating the hashCode
346351
and equals methods."
347352
:type 'boolean
348353
:lsp-path "java.codeGeneration.hashCodeEquals.useInstanceof")
349354

350355
(lsp-defcustom lsp-java-code-generation-use-blocks nil
351-
"Use blocks in 'if' statements when generating the methods."
356+
"Use blocks in `if' statements when generating the methods."
352357
:type 'boolean
353358
:lsp-path "java.codeGeneration.useBlocks")
354359

@@ -391,7 +396,7 @@ then list all."
391396
"Defines the type filters. All types whose fully qualified name
392397
matches the selected filter strings will be ignored in content
393398
assist or quick fix proposals and when organizing imports. For
394-
example 'java.awt.*' will hide all types from the awt packages."
399+
example `java.awt.*' will hide all types from the awt packages."
395400
:type '(lsp-repeatable-vector string)
396401
:lsp-path "java.completion.filteredTypes")
397402

@@ -419,7 +424,7 @@ example 'java.awt.*' will hide all types from the awt packages."
419424
(lsp-defcustom lsp-java-import-gradle-home nil
420425
"Use Gradle from the specified local installation directory or
421426
GRADLE_HOME if the Gradle wrapper is missing or disabled and no
422-
'java.import.gradle.version' is specified."
427+
`java.import.gradle.version' is specified."
423428
:type '(choice (string)
424429
(const nil))
425430
:lsp-path "java.import.gradle.home")
@@ -554,7 +559,8 @@ projects import is skipped on startup."
554559
(defun lsp-java--locate-server-jar ()
555560
"Return the jar file location of the language server.
556561
557-
The entry point of the language server is in `lsp-java-server-install-dir'/plugins/org.eclipse.equinox.launcher_`version'.jar."
562+
The entry point of the language server is in the `lsp-java-server-install-dir'
563+
+ /plugins/org.eclipse.equinox.launcher_`version'.jar."
558564
(pcase (f-glob "org.eclipse.equinox.launcher_*.jar" (expand-file-name "plugins" lsp-java-server-install-dir))
559565
(`(,single-entry) single-entry)
560566
(`nil nil)
@@ -564,7 +570,8 @@ The entry point of the language server is in `lsp-java-server-install-dir'/plugi
564570
(defun lsp-java--locate-server-command ()
565571
"Return the jdtls command location of the language server.
566572
567-
The entry point of the language server is in `lsp-java-server-install-dir'/bin/jdtls[.bat]."
573+
The entry point of the language server is in the
574+
`lsp-java-server-install-dir'/bin/jdtls[.bat]."
568575
(let ((bin-path (expand-file-name "bin" lsp-java-server-install-dir)))
569576
(locate-file lsp-java-jdt-ls-command `(,bin-path) exec-suffixes 1)))
570577

@@ -1073,9 +1080,9 @@ current symbol."
10731080
(progn
10741081
(require 'helm-source)
10751082
(helm :sources (helm-make-source
1076-
message 'helm-source-sync :candidates items
1077-
:action '(("Identity" lambda (_)
1078-
(setq lsp-java--helm-result (helm-marked-candidates)))))
1083+
message 'helm-source-sync :candidates items
1084+
:action '(("Identity" lambda (_)
1085+
(setq lsp-java--helm-result (helm-marked-candidates)))))
10791086
:buffer "*lsp-java select*"
10801087
:prompt message)
10811088
lsp-java--helm-result)
@@ -1556,14 +1563,16 @@ projects."
15561563
:lsp-path "java.configuration.maven.globalSettings")
15571564

15581565
(lsp-defcustom lsp-java-configuration-maven-not-covered-plugin-execution-severity "warning"
1559-
"Specifies severity if the plugin execution is not covered by Maven build lifecycle."
1566+
"Specifies severity if the plugin execution is not covered by Maven
1567+
build lifecycle."
15601568
:type '(choice (const "ignore")
15611569
(const "warning")
15621570
(const "error"))
15631571
:lsp-path "java.configuration.maven.notCoveredPluginExecutionSeverity")
15641572

15651573
(lsp-defcustom lsp-java-configuration-maven-default-mojo-execution-action "ignore"
1566-
"Specifies default mojo execution action when no associated metadata can be detected."
1574+
"Specifies default mojo execution action when no associated metadata can
1575+
be detected."
15671576
:type '(choice (:const "ignore") (:const "warn") (:const "error") (:const "execute"))
15681577
:lsp-path "java.configuration.maven.defaultMojoExecutionAction")
15691578

@@ -1625,24 +1634,23 @@ actions."
16251634
:lsp-path "java.codeGeneration.insertionLocation")
16261635

16271636
(lsp-defcustom lsp-java-templates-file-header nil
1628-
"Specifies the file header comment for new Java file. Supports
1629-
configuring multi-line comments with an array of strings, and
1630-
using ${variable} to reference the [predefined
1631-
variables](command:_java.templateVariables)."
1637+
"Specifies the file header comment for new Java file.
1638+
Supports configuring multi-line comments with an array of strings,
1639+
and using ${variable} to reference
1640+
the [predefined variables](command:_java.templateVariables)."
16321641
:type 'lsp-string-vector
16331642
:lsp-path "java.templates.fileHeader")
16341643

16351644
(lsp-defcustom lsp-java-templates-type-comment nil
1636-
"Specifies the type comment for new Java type. Supports
1637-
configuring multi-line comments with an array of strings, and
1638-
using ${variable} to reference the [predefined
1639-
variables](command:_java.templateVariables)."
1645+
"Specifies the type comment for new Java type.
1646+
Supports configuring multi-line comments with an array of strings,
1647+
and using ${variable} to reference
1648+
the [predefined variables](command:_java.templateVariables)."
16401649
:type 'lsp-string-vector
16411650
:lsp-path "java.templates.typeComment")
16421651

16431652
(lsp-defcustom lsp-java-references-include-accessors t
1644-
"Include getter, setter and builder/constructor when finding
1645-
references."
1653+
"Include getter, setter and builder/constructor when finding references."
16461654
:type 'boolean
16471655
:lsp-path "java.references.includeAccessors")
16481656

@@ -1652,16 +1660,15 @@ references."
16521660
:lsp-path "java.references.includeDecompiledSources")
16531661

16541662
(lsp-defcustom lsp-java-type-hierarchy-lazy-load nil
1655-
"Enable/disable lazy loading the content in type hierarchy. Lazy
1656-
loading could save a lot of loading time but every type should be
1663+
"Enable/disable lazy loading the content in type hierarchy.
1664+
Lazy loading could save a lot of loading time but every type should be
16571665
expanded manually to load its content."
16581666
:type 'boolean
16591667
:lsp-path "java.typeHierarchy.lazyLoad")
16601668

16611669
(lsp-defcustom lsp-java-settings-url nil
16621670
"Specifies the url or file path to the workspace Java settings.
1663-
See [Setting Global
1664-
Preferences](https://github.com/redhat-developer/vscode-java/wiki/Settings-Global-Preferences)"
1671+
See [Setting Global Preferences](https://github.com/redhat-developer/vscode-java/wiki/Settings-Global-Preferences)"
16651672
:type 'string
16661673
:lsp-path "java.settings.url")
16671674

@@ -1682,18 +1689,19 @@ Preferences](https://github.com/redhat-developer/vscode-java/wiki/Settings-Globa
16821689
Integer.valueOf(/* s: */ '123', /* radix: */ 10)
16831690
16841691
```
1685-
`#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay hints for methods."
1692+
`#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay
1693+
hints for methods."
16861694
:type '(choice (:const "none") (:const "literals") (:const "all"))
16871695
:lsp-path "java.inlayHints.parameterNames.enabled")
16881696

16891697
(lsp-defcustom lsp-java-inlay-hints-parameter-names-exclusions nil
16901698
"The patterns for the methods that will be disabled to show the
16911699
inlay hints. Supported pattern examples:
16921700
- `java.lang.Math.*` - All the methods from java.lang.Math.
1693-
- `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.
1694-
- `*.println(*)` - Methods named as 'println'.
1695-
- `(from, to)` - Methods with two parameters named as 'from' and 'to'.
1696-
- `(arg*)` - Methods with one parameter whose name starts with 'arg'."
1701+
- `*.Arrays.asList` - Methods named as `asList' in the types named as `Arrays'.
1702+
- `*.println(*)` - Methods named as `println'.
1703+
- `(from, to)` - Methods with two parameters named as `from' and `to'.
1704+
- `(arg*)` - Methods with one parameter whose name starts with `arg'."
16971705
:type 'lsp-string-vector
16981706
:lsp-path "java.inlayHints.parameterNames.exclusions")
16991707

@@ -1775,7 +1783,8 @@ Visual Studio Code - Insiders."
17751783
:lsp-path "java.sharedIndexes.location")
17761784

17771785
(lsp-defcustom lsp-java-refactoring-extract-interface-replace t
1778-
"Specify whether to replace all the occurrences of the subtype with the new extracted interface."
1786+
"Specify whether to replace all the occurrences of the subtype with the new
1787+
extracted interface."
17791788
:type 'boolean
17801789
:lsp-path "java.refactoring.extract.interface.replace")
17811790

@@ -1815,40 +1824,42 @@ projects."
18151824
:lsp-path "java.configuration.maven.globalSettings")
18161825

18171826
(lsp-defcustom lsp-java-configuration-maven-not-covered-plugin-execution-severity "warning"
1818-
"Specifies severity if the plugin execution is not covered by Maven build lifecycle."
1827+
"Specifies severity if the plugin execution is not covered by Maven
1828+
build lifecycle."
18191829
:type '(choice (:const "ignore") (:const "warning") (:const "error"))
18201830
:lsp-path "java.configuration.maven.notCoveredPluginExecutionSeverity")
18211831

18221832
(lsp-defcustom lsp-java-configuration-maven-default-mojo-execution-action "ignore"
1823-
"Specifies default mojo execution action when no associated metadata can be detected."
1833+
"Specifies default mojo execution action when no associated metadata
1834+
can be detected."
18241835
:type '(choice (:const "ignore") (:const "warn") (:const "error") (:const "execute"))
18251836
:lsp-path "java.configuration.maven.defaultMojoExecutionAction")
18261837

18271838
(lsp-defcustom lsp-java-configuration-workspace-cache-limit 90
1828-
"The number of days (if enabled) to keep unused workspace cache
1829-
data. Beyond this limit, cached workspace data may be removed."
1839+
"The number of days (if enabled) to keep unused workspace cache data.
1840+
Beyond this limit, cached workspace data may be removed."
18301841
:type '(repeat nil)
18311842
:lsp-path "java.configuration.workspaceCacheLimit")
18321843

18331844
(lsp-defcustom lsp-java-import-generates-metadata-files-at-project-root nil
18341845
"Specify whether the project metadata files(.project, .classpath,
18351846
.factorypath, .settings/) will be generated at the project root.
1836-
Click [HERE](command:_java.metadataFilesGeneration) to learn how
1837-
to change the setting to make it take effect."
1847+
Click [HERE](command:_java.metadataFilesGeneration) to learn how to change the
1848+
setting to make it take effect."
18381849
:type 'boolean
18391850
:lsp-path "java.import.generatesMetadataFilesAtProjectRoot")
18401851

18411852
(lsp-defcustom lsp-java-project-output-path ""
1842-
"A relative path to the workspace where stores the compiled
1843-
output. `Only` effective in the `WORKSPACE` scope. The setting
1844-
will `NOT` affect Maven or Gradle project."
1853+
"A relative path to the workspace where stores the compiled output.
1854+
`Only` effective in the `WORKSPACE` scope. The setting will `NOT` affect
1855+
Maven or Gradle project."
18451856
:type '(repeat string)
18461857
:lsp-path "java.project.outputPath")
18471858

18481859
(lsp-defcustom lsp-java-project-source-paths nil
18491860
"Relative paths to the workspace where stores the source files.
1850-
`Only` effective in the `WORKSPACE` scope. The setting will `NOT`
1851-
affect Maven or Gradle project."
1861+
`Only` effective in the `WORKSPACE` scope. The setting will `NOT` affect Maven
1862+
or Gradle project."
18521863
:type 'lsp-string-vector
18531864
:lsp-path "java.project.sourcePaths")
18541865

@@ -1882,24 +1893,23 @@ actions."
18821893
:lsp-path "java.codeGeneration.insertionLocation")
18831894

18841895
(lsp-defcustom lsp-java-templates-file-header nil
1885-
"Specifies the file header comment for new Java file. Supports
1886-
configuring multi-line comments with an array of strings, and
1887-
using ${variable} to reference the [predefined
1888-
variables](command:_java.templateVariables)."
1896+
"Specifies the file header comment for new Java file.
1897+
Supports configuring multi-line comments with an array of strings, and using
1898+
${variable} to reference the
1899+
[predefined variables](command:_java.templateVariables)."
18891900
:type 'lsp-string-vector
18901901
:lsp-path "java.templates.fileHeader")
18911902

18921903
(lsp-defcustom lsp-java-templates-type-comment nil
1893-
"Specifies the type comment for new Java type. Supports
1894-
configuring multi-line comments with an array of strings, and
1895-
using ${variable} to reference the [predefined
1896-
variables](command:_java.templateVariables)."
1904+
"Specifies the type comment for new Java type.
1905+
Supports configuring multi-line comments with an array of strings, and using
1906+
${variable} to reference the
1907+
[predefined variables](command:_java.templateVariables)."
18971908
:type 'lsp-string-vector
18981909
:lsp-path "java.templates.typeComment")
18991910

19001911
(lsp-defcustom lsp-java-references-include-accessors t
1901-
"Include getter, setter and builder/constructor when finding
1902-
references."
1912+
"Include getter, setter and builder/constructor when finding references."
19031913
:type 'boolean
19041914
:lsp-path "java.references.includeAccessors")
19051915

@@ -1939,18 +1949,19 @@ Preferences](https://github.com/redhat-developer/vscode-java/wiki/Settings-Globa
19391949
Integer.valueOf(/* s: */ '123', /* radix: */ 10)
19401950
19411951
```
1942-
`#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay hints for methods."
1952+
`#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay
1953+
hints for methods."
19431954
:type '(choice (:const "none") (:const "literals") (:const "all"))
19441955
:lsp-path "java.inlayHints.parameterNames.enabled")
19451956

19461957
(lsp-defcustom lsp-java-inlay-hints-parameter-names-exclusions nil
19471958
"The patterns for the methods that will be disabled to show the
19481959
inlay hints. Supported pattern examples:
19491960
- `java.lang.Math.*` - All the methods from java.lang.Math.
1950-
- `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.
1951-
- `*.println(*)` - Methods named as 'println'.
1952-
- `(from, to)` - Methods with two parameters named as 'from' and 'to'.
1953-
- `(arg*)` - Methods with one parameter whose name starts with 'arg'."
1961+
- `*.Arrays.asList` - Methods named as `asList' in the types named as `Arrays'.
1962+
- `*.println(*)` - Methods named as `println'.
1963+
- `(from, to)` - Methods with two parameters named as `from' and `to'.
1964+
- `(arg*)` - Methods with one parameter whose name starts with `arg'."
19541965
:type 'lsp-string-vector
19551966
:lsp-path "java.inlayHints.parameterNames.exclusions")
19561967

@@ -2012,10 +2023,10 @@ dependencies. This setting will be ignored if
20122023
:lsp-path "java.compile.nullAnalysis.mode")
20132024

20142025
(lsp-defcustom lsp-java-cleanup-actions-on-save nil
2015-
"The list of clean ups to be run on the current document when it's
2016-
saved. Clean ups can automatically fix code style or programming
2017-
mistakes. Click [HERE](command:_java.learnMoreAboutCleanUps) to
2018-
learn more about what each clean up does."
2026+
"The list of clean ups to be run on the current document when it's saved.
2027+
Clean ups can automatically fix code style or programming mistakes.
2028+
Click [HERE](command:_java.learnMoreAboutCleanUps) to learn more about what each
2029+
clean up does."
20192030
:type 'lsp-string-vector
20202031
:lsp-path "java.cleanup.actionsOnSave")
20212032

@@ -2032,7 +2043,8 @@ Visual Studio Code - Insiders."
20322043
:lsp-path "java.sharedIndexes.location")
20332044

20342045
(lsp-defcustom lsp-java-refactoring-extract-interface-replace t
2035-
"Specify whether to replace all the occurrences of the subtype with the new extracted interface."
2046+
"Specify whether to replace all the occurrences of the subtype with the new
2047+
extracted interface."
20362048
:type 'boolean
20372049
:lsp-path "java.refactoring.extract.interface.replace")
20382050

0 commit comments

Comments
 (0)