driftdetect-lsp 0.9.34 → 0.9.37

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.
Files changed (65) hide show
  1. package/dist/bin/server.d.ts +12 -0
  2. package/dist/bin/server.js +26 -0
  3. package/dist/bin/server.js.map +1 -0
  4. package/dist/capabilities.d.ts +91 -0
  5. package/dist/commands/approve-pattern.d.ts +15 -0
  6. package/dist/commands/approve-pattern.js +83 -0
  7. package/dist/commands/approve-pattern.js.map +1 -0
  8. package/dist/commands/create-variant.d.ts +22 -0
  9. package/dist/commands/create-variant.js +109 -0
  10. package/dist/commands/create-variant.js.map +1 -0
  11. package/dist/commands/explain-ai.d.ts +11 -0
  12. package/dist/commands/explain-ai.js +144 -0
  13. package/dist/commands/explain-ai.js.map +1 -0
  14. package/dist/commands/fix-ai.d.ts +11 -0
  15. package/dist/commands/fix-ai.js +146 -0
  16. package/dist/commands/fix-ai.js.map +1 -0
  17. package/dist/commands/ignore-once.d.ts +33 -0
  18. package/dist/commands/ignore-once.js +147 -0
  19. package/dist/commands/ignore-once.js.map +1 -0
  20. package/dist/commands/ignore-pattern.d.ts +15 -0
  21. package/dist/commands/ignore-pattern.js +77 -0
  22. package/dist/commands/ignore-pattern.js.map +1 -0
  23. package/dist/commands/index.d.ts +14 -0
  24. package/dist/commands/index.js +14 -0
  25. package/dist/commands/index.js.map +1 -0
  26. package/dist/commands/rescan.d.ts +19 -0
  27. package/dist/commands/rescan.js +125 -0
  28. package/dist/commands/rescan.js.map +1 -0
  29. package/dist/commands/show-violations.d.ts +11 -0
  30. package/dist/commands/show-violations.js +259 -0
  31. package/dist/commands/show-violations.js.map +1 -0
  32. package/dist/handlers/index.d.ts +23 -0
  33. package/dist/handlers/index.js +16 -0
  34. package/dist/handlers/index.js.map +1 -0
  35. package/dist/handlers/initialize.d.ts +41 -0
  36. package/dist/handlers/initialize.d.ts.map +1 -0
  37. package/dist/handlers/initialize.js +33 -0
  38. package/dist/handlers/initialize.js.map +1 -0
  39. package/dist/index.d.ts +22 -0
  40. package/dist/index.js +26 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/integration/core-scanner.d.ts +89 -0
  43. package/dist/integration/index.d.ts +11 -0
  44. package/dist/integration/index.js +11 -0
  45. package/dist/integration/index.js.map +1 -0
  46. package/dist/server/index.d.ts +5 -0
  47. package/dist/server/index.js +5 -0
  48. package/dist/server/index.js.map +1 -0
  49. package/dist/server.d.ts +63 -0
  50. package/dist/types/index.d.ts +5 -0
  51. package/dist/types/index.js +5 -0
  52. package/dist/types/index.js.map +1 -0
  53. package/dist/types/lsp-types.d.ts +321 -0
  54. package/dist/types/lsp-types.js +274 -0
  55. package/dist/types/lsp-types.js.map +1 -0
  56. package/dist/utils/diagnostic.d.ts +84 -0
  57. package/dist/utils/index.d.ts +8 -0
  58. package/dist/utils/index.js +8 -0
  59. package/dist/utils/index.js.map +1 -0
  60. package/dist/utils/position.d.ts +44 -0
  61. package/dist/utils/position.d.ts.map +1 -0
  62. package/dist/utils/position.js +96 -0
  63. package/dist/utils/position.js.map +1 -0
  64. package/dist/utils/workspace.d.ts +98 -0
  65. package/package.json +3 -3
@@ -0,0 +1,8 @@
1
+ /**
2
+ * LSP Utilities Module
3
+ *
4
+ * Exports utility functions for position and document handling.
5
+ */
6
+ export * from './position.js';
7
+ export * from './document.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Position Utilities
3
+ *
4
+ * Helper functions for working with LSP positions and ranges.
5
+ */
6
+ import type { Position, Range } from 'vscode-languageserver';
7
+ /**
8
+ * Create a Position
9
+ */
10
+ export declare function createPosition(line: number, character: number): Position;
11
+ /**
12
+ * Create a Range
13
+ */
14
+ export declare function createRange(start: Position, end: Position): Range;
15
+ /**
16
+ * Create a Range from coordinates
17
+ */
18
+ export declare function createRangeFromCoords(startLine: number, startChar: number, endLine: number, endChar: number): Range;
19
+ /**
20
+ * Check if a position is within a range
21
+ */
22
+ export declare function isPositionInRange(position: Position, range: Range): boolean;
23
+ /**
24
+ * Check if two ranges overlap
25
+ */
26
+ export declare function rangesOverlap(a: Range, b: Range): boolean;
27
+ /**
28
+ * Check if range a contains range b
29
+ */
30
+ export declare function rangeContains(a: Range, b: Range): boolean;
31
+ /**
32
+ * Compare two positions
33
+ * Returns negative if a < b, positive if a > b, 0 if equal
34
+ */
35
+ export declare function comparePositions(a: Position, b: Position): number;
36
+ /**
37
+ * Format a position for display
38
+ */
39
+ export declare function formatPosition(position: Position): string;
40
+ /**
41
+ * Format a range for display
42
+ */
43
+ export declare function formatRange(range: Range): string;
44
+ //# sourceMappingURL=position.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/utils/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,CAExE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK,CAEjE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,KAAK,CAKP;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAiB3E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAkBzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO,CAKzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAKjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAKhD"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Position Utilities
3
+ *
4
+ * Helper functions for working with LSP positions and ranges.
5
+ */
6
+ /**
7
+ * Create a Position
8
+ */
9
+ export function createPosition(line, character) {
10
+ return { line, character };
11
+ }
12
+ /**
13
+ * Create a Range
14
+ */
15
+ export function createRange(start, end) {
16
+ return { start, end };
17
+ }
18
+ /**
19
+ * Create a Range from coordinates
20
+ */
21
+ export function createRangeFromCoords(startLine, startChar, endLine, endChar) {
22
+ return {
23
+ start: { line: startLine, character: startChar },
24
+ end: { line: endLine, character: endChar },
25
+ };
26
+ }
27
+ /**
28
+ * Check if a position is within a range
29
+ */
30
+ export function isPositionInRange(position, range) {
31
+ const { line, character } = position;
32
+ const { start, end } = range;
33
+ if (line < start.line || line > end.line) {
34
+ return false;
35
+ }
36
+ if (line === start.line && character < start.character) {
37
+ return false;
38
+ }
39
+ if (line === end.line && character > end.character) {
40
+ return false;
41
+ }
42
+ return true;
43
+ }
44
+ /**
45
+ * Check if two ranges overlap
46
+ */
47
+ export function rangesOverlap(a, b) {
48
+ // a ends before b starts
49
+ if (a.end.line < b.start.line) {
50
+ return false;
51
+ }
52
+ if (a.end.line === b.start.line && a.end.character < b.start.character) {
53
+ return false;
54
+ }
55
+ // b ends before a starts
56
+ if (b.end.line < a.start.line) {
57
+ return false;
58
+ }
59
+ if (b.end.line === a.start.line && b.end.character < a.start.character) {
60
+ return false;
61
+ }
62
+ return true;
63
+ }
64
+ /**
65
+ * Check if range a contains range b
66
+ */
67
+ export function rangeContains(a, b) {
68
+ return (isPositionInRange(b.start, a) &&
69
+ isPositionInRange(b.end, a));
70
+ }
71
+ /**
72
+ * Compare two positions
73
+ * Returns negative if a < b, positive if a > b, 0 if equal
74
+ */
75
+ export function comparePositions(a, b) {
76
+ if (a.line !== b.line) {
77
+ return a.line - b.line;
78
+ }
79
+ return a.character - b.character;
80
+ }
81
+ /**
82
+ * Format a position for display
83
+ */
84
+ export function formatPosition(position) {
85
+ return `${position.line + 1}:${position.character + 1}`;
86
+ }
87
+ /**
88
+ * Format a range for display
89
+ */
90
+ export function formatRange(range) {
91
+ if (range.start.line === range.end.line) {
92
+ return `line ${range.start.line + 1}`;
93
+ }
94
+ return `lines ${range.start.line + 1}-${range.end.line + 1}`;
95
+ }
96
+ //# sourceMappingURL=position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.js","sourceRoot":"","sources":["../../src/utils/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,SAAiB;IAC5D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAe,EAAE,GAAa;IACxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAAiB,EACjB,SAAiB,EACjB,OAAe,EACf,OAAe;IAEf,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;QAChD,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE;KAC3C,CAAC;AACJ,CAAC;AAED;;GAEG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.js';
6
+ /**
7
+ * Convert file path to URI
8
+ */
9
+ export declare function pathToUri(path: string): string;
10
+ /**
11
+ * Convert URI to file path
12
+ */
13
+ export declare function uriToPath(uri: string): string;
14
+ /**
15
+ * Get file name from URI
16
+ */
17
+ export declare function getFileName(uri: string): string;
18
+ /**
19
+ * Get file extension from URI
20
+ */
21
+ export declare function getFileExtension(uri: string): string;
22
+ /**
23
+ * Get directory from URI
24
+ */
25
+ export declare function getDirectory(uri: string): string;
26
+ /**
27
+ * Join URI with path segments
28
+ */
29
+ export declare function joinUri(base: string, ...segments: string[]): string;
30
+ /**
31
+ * Get relative path from base URI
32
+ */
33
+ export declare function getRelativePath(baseUri: string, targetUri: string): string;
34
+ /**
35
+ * Check if URI is a child of another URI
36
+ */
37
+ export declare function isChildOf(parentUri: string, childUri: string): boolean;
38
+ /**
39
+ * Find workspace folder for URI
40
+ */
41
+ export declare function findWorkspaceFolder(uri: string, workspaceFolders: WorkspaceFolder[]): WorkspaceFolder | undefined;
42
+ /**
43
+ * Get workspace root URI
44
+ */
45
+ export declare function getWorkspaceRoot(workspaceFolders: WorkspaceFolder[]): string | undefined;
46
+ /**
47
+ * Check if URI is in workspace
48
+ */
49
+ export declare function isInWorkspace(uri: string, workspaceFolders: WorkspaceFolder[]): boolean;
50
+ /**
51
+ * Get all workspace URIs
52
+ */
53
+ export declare function getWorkspaceUris(workspaceFolders: WorkspaceFolder[]): string[];
54
+ /**
55
+ * Check if URI matches a glob pattern
56
+ */
57
+ export declare function matchesGlob(uri: string, pattern: string): boolean;
58
+ /**
59
+ * Check if URI matches any of the glob patterns
60
+ */
61
+ export declare function matchesAnyGlob(uri: string, patterns: string[]): boolean;
62
+ /**
63
+ * Filter URIs by glob patterns
64
+ */
65
+ export declare function filterByGlob(uris: string[], includePatterns: string[], excludePatterns?: string[]): string[];
66
+ /**
67
+ * Check if URI is a TypeScript file
68
+ */
69
+ export declare function isTypeScriptFile(uri: string): boolean;
70
+ /**
71
+ * Check if URI is a JavaScript file
72
+ */
73
+ export declare function isJavaScriptFile(uri: string): boolean;
74
+ /**
75
+ * Check if URI is a CSS file
76
+ */
77
+ export declare function isCssFile(uri: string): boolean;
78
+ /**
79
+ * Check if URI is a JSON file
80
+ */
81
+ export declare function isJsonFile(uri: string): boolean;
82
+ /**
83
+ * Check if URI is a Markdown file
84
+ */
85
+ export declare function isMarkdownFile(uri: string): boolean;
86
+ /**
87
+ * Check if URI is a configuration file
88
+ */
89
+ export declare function isConfigFile(uri: string): boolean;
90
+ /**
91
+ * Check if URI is a test file
92
+ */
93
+ export declare function isTestFile(uri: string): boolean;
94
+ /**
95
+ * Check if URI should be excluded from scanning
96
+ */
97
+ export declare function shouldExclude(uri: string, excludePatterns: string[]): boolean;
98
+ //# sourceMappingURL=workspace.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "driftdetect-lsp",
3
- "version": "0.9.34",
3
+ "version": "0.9.37",
4
4
  "description": "Language Server Protocol implementation for Drift",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -34,8 +34,8 @@
34
34
  "typecheck": "tsc --noEmit"
35
35
  },
36
36
  "dependencies": {
37
- "driftdetect-core": "^0.9.28",
38
- "driftdetect-detectors": "^0.9.28",
37
+ "driftdetect-core": "0.9.37",
38
+ "driftdetect-detectors": "0.9.37",
39
39
  "vscode-languageserver": "^9.0.1",
40
40
  "vscode-languageserver-textdocument": "^1.0.11",
41
41
  "vscode-uri": "^3.0.8"