@knip/language-server 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,7 +84,7 @@ Example:
84
84
 
85
85
  ### Imports
86
86
 
87
- The file desciptor can be used to display an overview of imports of a document
87
+ The file descriptor can be used to display an overview of imports of a document
88
88
  with direct links to their definition location.
89
89
 
90
90
  Optionally, the client can implement:
@@ -99,7 +99,7 @@ Example:
99
99
 
100
100
  ### Exports
101
101
 
102
- The file desciptor can be used to display an overview of exports of a document
102
+ The file descriptor can be used to display an overview of exports of a document
103
103
  with direct links to their usage locations.
104
104
 
105
105
  Optionally, the client can implement:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knip/language-server",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/webpro-nl/knip.git",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "vscode-languageserver": "^9.0.1",
22
22
  "vscode-languageserver-textdocument": "^1.0.12",
23
- "knip": "^5.86.0"
23
+ "knip": "^5.88.1"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=18.20.0"
@@ -8,6 +8,14 @@ import { DiagnosticSeverity, DiagnosticTag } from 'vscode-languageserver/node.js
8
8
  * @import { Issue, Rules } from 'knip/session';
9
9
  */
10
10
 
11
+ const dimmedIssueTypes = {
12
+ exports: 'dimExports',
13
+ types: 'dimTypes',
14
+ enumMembers: 'dimEnumMembers',
15
+ classMembers: 'dimClassMembers',
16
+ duplicates: 'dimDuplicates',
17
+ };
18
+
11
19
  const SEVERITY = {
12
20
  error: DiagnosticSeverity.Error,
13
21
  warn: DiagnosticSeverity.Warning,
@@ -42,12 +50,7 @@ export const issueToDiagnostic = (issue, rules, config, document) => {
42
50
  /** @type {DiagnosticTag[]} */
43
51
  const tags = [];
44
52
 
45
- if (issue.type === 'exports' && config.editor.exports.highlight.dimExports) {
46
- severity = DiagnosticSeverity.Hint;
47
- tags.push(DiagnosticTag.Unnecessary);
48
- }
49
-
50
- if (issue.type === 'types' && config.editor.exports.highlight.dimTypes) {
53
+ if (dimmedIssueTypes[issue.type] && config.editor.exports.highlight[dimmedIssueTypes[issue.type]]) {
51
54
  severity = DiagnosticSeverity.Hint;
52
55
  tags.push(DiagnosticTag.Unnecessary);
53
56
  }
package/src/server.js CHANGED
@@ -34,7 +34,13 @@ const DEFAULT_CONFIG = {
34
34
  codelens: { enabled: true },
35
35
  hover: { enabled: true, includeImportLocationSnippet: false, maxSnippets: 10, timeout: 300 },
36
36
  quickfix: { enabled: true },
37
- highlight: { dimExports: false, dimTypes: false },
37
+ highlight: {
38
+ dimExports: false,
39
+ dimTypes: false,
40
+ dimEnumMembers: false,
41
+ dimClassMembers: false,
42
+ dimDuplicates: false,
43
+ },
38
44
  },
39
45
  },
40
46
  imports: { enabled: true },
package/src/types.d.ts CHANGED
@@ -21,6 +21,9 @@ export type Config = {
21
21
  highlight: {
22
22
  dimExports: boolean;
23
23
  dimTypes: boolean;
24
+ dimEnumMembers: boolean;
25
+ dimClassMembers: boolean;
26
+ dimDuplicates: boolean;
24
27
  };
25
28
  };
26
29
  };