diff --git a/binary/package-lock.json b/binary/package-lock.json index 0d67a4725..a27e6ee97 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -74,7 +74,7 @@ "jsdom": "^24.0.0", "launchdarkly-node-client-sdk": "^3.2.0", "llm-code-highlighter": "^0.0.14", - "lru-cache": "^10.2.2", + "lru-cache": "^11.0.2", "mac-ca": "^3.1.0", "node-fetch": "^3.3.2", "node-html-markdown": "^1.3.0", @@ -99,6 +99,7 @@ "vectordb": "^0.4.20", "web-tree-sitter": "^0.21.0", "win-ca": "^3.5.1", + "wink-nlp-utils": "^2.1.0", "workerpool": "^9.1.3", "yaml": "^2.4.2", "zod": "^3.23.8" @@ -135,12 +136,12 @@ } }, "node_modules/@75lb/deep-merge": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", - "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", + "integrity": "sha512-08K9ou5VNbheZFxM5tDWoqjA3ImC50DiuuJ2tj1yEPRfkp8lLLg6XAaJ4On+a0yAXor/8ay5gHnAIshRM44Kpw==", "peer": true, "dependencies": { - "lodash.assignwith": "^4.2.0", + "lodash": "^4.17.21", "typical": "^7.1.1" }, "engines": { @@ -2749,12 +2750,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3545,9 +3546,9 @@ "optional": true }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -5037,10 +5038,10 @@ "node": ">=8" } }, - "node_modules/lodash.assignwith": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", - "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==", + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "peer": true }, "node_modules/lodash.camelcase": { diff --git a/core/autocomplete/context/root-path-context/RootPathContextService.ts b/core/autocomplete/context/root-path-context/RootPathContextService.ts index 9c47138cd..b4b742911 100644 --- a/core/autocomplete/context/root-path-context/RootPathContextService.ts +++ b/core/autocomplete/context/root-path-context/RootPathContextService.ts @@ -39,6 +39,7 @@ export class RootPathContextService { } private static TYPES_TO_USE = new Set([ + "arrow_function", "program", "function_declaration", "function_definition", @@ -90,15 +91,15 @@ export class RootPathContextService { return snippets; } - await Promise.all( - query.matches(node).map(async (match) => { - for (const item of match.captures) { - const endPosition = item.node.endPosition; - const newSnippets = await this.getSnippets(filepath, endPosition); - snippets.push(...newSnippets); - } - }), - ); + const queries = query.matches(node).map(async (match) => { + for (const item of match.captures) { + const endPosition = item.node.endPosition; + const newSnippets = await this.getSnippets(filepath, endPosition); + snippets.push(...newSnippets); + } + }); + + await Promise.all(queries); return snippets; } diff --git a/core/autocomplete/context/root-path-context/test/files/arrowFunctions.ts b/core/autocomplete/context/root-path-context/test/files/arrowFunctions.ts new file mode 100644 index 000000000..42ef247b0 --- /dev/null +++ b/core/autocomplete/context/root-path-context/test/files/arrowFunctions.ts @@ -0,0 +1,25 @@ +// @ts-nocheck + +const getAddress = (person: Person): Address => { + // TODO +}; + +const logPerson = (person: Person) => { + // TODO +}; + +const getHardcodedAddress = (): Address => { + // TODO +}; + +const getAddresses = (people: Person[]): Address[] => { + // TODO +}; + +const logPersonWithAddres = (person: Person
): Person => { + // TODO +}; + +const logPersonOrAddress = (person: Person | Address): Person | Address => { + // TODO +}; diff --git a/core/autocomplete/context/root-path-context/test/files/class.ts b/core/autocomplete/context/root-path-context/test/files/class.ts deleted file mode 100644 index 017b592ae..000000000 --- a/core/autocomplete/context/root-path-context/test/files/class.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - Address, - Person, - BaseClass, - FirstInterface, - SecondInterface, - // @ts-ignore -} from "./types"; - -class Group extends BaseClass implements FirstInterface, SecondInterface { - people: Person[]; - - constructor(people: Person[]) { - super(); - this.people = people; - } - - getPersonAddress(person: Person): Address { - return person.address; - } - - getHardcodedAddress(): Address { - return { street: "123 Main St", city: "Anytown" }; - } - - addPerson(person: Person) { - this.people = [...this.people, person]; - } - - addPeople(people: Person[]) { - this.people = [...this.people, ...people]; - } -} diff --git a/core/autocomplete/context/root-path-context/test/files/classMethods.ts b/core/autocomplete/context/root-path-context/test/files/classMethods.ts new file mode 100644 index 000000000..36224029b --- /dev/null +++ b/core/autocomplete/context/root-path-context/test/files/classMethods.ts @@ -0,0 +1,31 @@ +// @ts-nocheck + +class Group { + getPersonAddress(person: Person): Address { + // TODO + } + + getHardcodedAddress(): Address { + // TODO + } + + addPerson(person: Person) { + // TODO + } + + addPeople(people: Person[]) { + // TODO + } + + getAddresses(people: Person[]): Address[] { + // TODO + } + + logPersonWithAddress(person: Person): Person { + // TODO + } + + logPersonOrAddress(person: Person | Address): Person | Address { + // TODO + } +} diff --git a/core/autocomplete/context/root-path-context/test/files/classes.ts b/core/autocomplete/context/root-path-context/test/files/classes.ts new file mode 100644 index 000000000..2f6b76cda --- /dev/null +++ b/core/autocomplete/context/root-path-context/test/files/classes.ts @@ -0,0 +1,3 @@ +// @ts-nocheck + +class Group extends BaseClass implements FirstInterface, SecondInterface {} diff --git a/core/autocomplete/context/root-path-context/test/files/functions.ts b/core/autocomplete/context/root-path-context/test/files/functions.ts index 2b6125a74..4189f4e20 100644 --- a/core/autocomplete/context/root-path-context/test/files/functions.ts +++ b/core/autocomplete/context/root-path-context/test/files/functions.ts @@ -1,25 +1,29 @@ -import { - Address, - Person, - // @ts-ignore -} from "./types"; +// @ts-nocheck function getAddress(person: Person): Address { - return person.address; + // TODO } function getFirstAddress(people: Person[]): Address { - return people[0].address; + // TODO } function logPerson(person: Person) { - console.log(`Name: ${person.name}, Age: ${person.age}`); + // TODO } function getHardcodedAddress(): Address { - return { street: "123 Main St", city: "Anytown", zipCode: "12345" }; + // TODO } function getAddresses(people: Person[]): Address[] { - return people[0].address; + // TODO +} + +function logPersonWithAddress(person: Person): Person { + // TODO +} + +function logPersonOrAddress(person: Person | Address): Person | Address { + // TODO } diff --git a/core/autocomplete/context/root-path-context/test/testCases/typescript.ts b/core/autocomplete/context/root-path-context/test/testCases/typescript.ts index 6913cb8d3..9c490ae23 100644 --- a/core/autocomplete/context/root-path-context/test/testCases/typescript.ts +++ b/core/autocomplete/context/root-path-context/test/testCases/typescript.ts @@ -1,89 +1,223 @@ -export const TYPESCRIPT_TEST_CASES = [ +const FUNCTIONS = [ { nodeType: "function_declaration with a param and a return type", fileName: "functions.ts", language: "TypeScript", - cursorPosition: { line: 7, character: 24 }, + cursorPosition: { line: 3, character: 9 }, definitionPositions: [ - { row: 6, column: 34 }, // Person - { row: 6, column: 44 }, // Address + { row: 2, column: 34 }, // Person + { row: 2, column: 44 }, // Address ], }, { nodeType: "function_declaration with array param", fileName: "functions.ts", language: "TypeScript", - cursorPosition: { line: 11, character: 27 }, + cursorPosition: { line: 7, character: 9 }, definitionPositions: [ - { row: 10, column: 39 }, // Person - { row: 10, column: 51 }, // Address + { row: 6, column: 39 }, // Person + { row: 6, column: 51 }, // Address ], }, { nodeType: "function_declaration without return type", fileName: "functions.ts", language: "TypeScript", - cursorPosition: { line: 15, character: 58 }, + cursorPosition: { line: 11, character: 9 }, definitionPositions: [ - { row: 14, column: 33 }, // Person + { row: 10, column: 33 }, // Person ], }, { nodeType: "function_declaration without params", fileName: "functions.ts", language: "TypeScript", - cursorPosition: { line: 19, character: 70 }, + cursorPosition: { line: 15, character: 9 }, definitionPositions: [ - { row: 18, column: 39 }, // Person + { row: 14, column: 39 }, // Person ], }, { - nodeType: "method_declaration", - fileName: "class.ts", + nodeType: "function_declaration with array params and array return type", + fileName: "functions.ts", language: "TypeScript", - cursorPosition: { line: 18, character: 26 }, + cursorPosition: { line: 19, character: 9 }, definitionPositions: [ - { row: 9, column: 29 }, // BaseClass - { row: 9, column: 55 }, // FirstInterface - { row: 9, column: 72 }, // SecondInterface - { row: 17, column: 33 }, // Person - { row: 17, column: 43 }, // Address + { row: 18, column: 36 }, // Person + { row: 18, column: 48 }, // Address + ], + }, + { + nodeType: + "function_declaration with generic params and generic return type", + fileName: "functions.ts", + language: "TypeScript", + cursorPosition: { line: 23, character: 9 }, + definitionPositions: [ + { row: 22, column: 44 }, // Person + { row: 22, column: 52 }, // Address + { row: 22, column: 62 }, // Person + { row: 22, column: 70 }, // Address + ], + }, + { + nodeType: + "function_declaration with union type params and union return type", + fileName: "functions.ts", + language: "TypeScript", + cursorPosition: { line: 27, character: 9 }, + definitionPositions: [ + { row: 26, column: 42 }, // Person + { row: 26, column: 52 }, // Address + { row: 26, column: 61 }, // Person + { row: 26, column: 71 }, // Address + ], + }, +]; + +const ARROW_FUNCTIONS = [ + { + nodeType: "arrow_function with a param and a return type", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 3, character: 9 }, + definitionPositions: [ + { row: 2, column: 34 }, // Person + { row: 2, column: 44 }, // Address + ], + }, + { + nodeType: "arrow_function without return type", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 7, character: 9 }, + definitionPositions: [ + { row: 6, column: 33 }, // Person + ], + }, + { + nodeType: "arrow_function without params", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 11, character: 9 }, + definitionPositions: [ + { row: 10, column: 39 }, // Person + ], + }, + { + nodeType: "arrow_function with array params and array return type", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 15, character: 9 }, + definitionPositions: [ + { row: 14, column: 36 }, // Person + { row: 14, column: 48 }, // Address + ], + }, + { + nodeType: "arrow_function with generic params and generic return type", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 19, character: 9 }, + definitionPositions: [ + { row: 18, column: 43 }, // Person + { row: 18, column: 51 }, // Address + { row: 18, column: 61 }, // Person + { row: 18, column: 69 }, // Address + ], + }, + { + nodeType: "arrow_function with union type params and union return type", + fileName: "arrowFunctions.ts", + language: "TypeScript", + cursorPosition: { line: 23, character: 9 }, + definitionPositions: [ + { row: 22, column: 42 }, // Person + { row: 22, column: 52 }, // Address + { row: 22, column: 61 }, // Person + { row: 22, column: 71 }, // Address + ], + }, +]; + +const CLASS_METHODS = [ + { + nodeType: "method_declaration with a param and a return type", + fileName: "classMethods.ts", + language: "TypeScript", + cursorPosition: { line: 4, character: 11 }, + definitionPositions: [ + { row: 3, column: 33 }, // Person + { row: 3, column: 43 }, // Address ], }, { nodeType: "method_declaration without arguments", - fileName: "class.ts", + fileName: "classMethods.ts", language: "TypeScript", - cursorPosition: { line: 22, character: 54 }, + cursorPosition: { line: 8, character: 11 }, definitionPositions: [ - { row: 9, column: 29 }, // BaseClass - { row: 9, column: 55 }, // FirstInterface - { row: 9, column: 72 }, // SecondInterface - { row: 21, column: 32 }, // Address + { row: 7, column: 32 }, // Address ], }, { nodeType: "method_declaration without return type", - fileName: "class.ts", + fileName: "classMethods.ts", language: "TypeScript", - cursorPosition: { line: 26, character: 43 }, + cursorPosition: { line: 12, character: 11 }, definitionPositions: [ - { row: 9, column: 29 }, // BaseClass - { row: 9, column: 55 }, // FirstInterface - { row: 9, column: 72 }, // SecondInterface - { row: 25, column: 26 }, // Person + { row: 11, column: 26 }, // Person ], }, { nodeType: "method_declaration with array type arguments", - fileName: "class.ts", + fileName: "classMethods.ts", language: "TypeScript", - cursorPosition: { line: 30, character: 46 }, + cursorPosition: { line: 16, character: 11 }, definitionPositions: [ - { row: 9, column: 29 }, // BaseClass - { row: 9, column: 55 }, // FirstInterface - { row: 9, column: 72 }, // SecondInterface - { row: 29, column: 26 }, // Person + { row: 15, column: 26 }, // Person + ], + }, + { + nodeType: + "method_declaration with array type arguments and array type return", + fileName: "classMethods.ts", + language: "TypeScript", + cursorPosition: { line: 20, character: 11 }, + definitionPositions: [ + { row: 19, column: 29 }, // Person + { row: 19, column: 41 }, // Address + ], + }, + { + nodeType: + "method_declaration with with generic params and generic return type", + fileName: "classMethods.ts", + language: "TypeScript", + cursorPosition: { line: 24, character: 11 }, + definitionPositions: [ + { row: 23, column: 37 }, // Person + { row: 23, column: 45 }, // Address + { row: 23, column: 55 }, // Person + { row: 23, column: 63 }, // Address + ], + }, + { + nodeType: "method_declaration with union type params and union return type", + fileName: "classMethods.ts", + language: "TypeScript", + cursorPosition: { line: 28, character: 11 }, + definitionPositions: [ + { row: 27, column: 35 }, // Person + { row: 27, column: 45 }, // Address + { row: 27, column: 54 }, // Person + { row: 27, column: 64 }, // Address ], }, ]; + +export const TYPESCRIPT_TEST_CASES = [ + ...FUNCTIONS, + ...ARROW_FUNCTIONS, + ...CLASS_METHODS, +]; diff --git a/core/package-lock.json b/core/package-lock.json index 633d60c99..fd3173f28 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -101,12 +101,12 @@ } }, "node_modules/@75lb/deep-merge": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", - "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", + "integrity": "sha512-08K9ou5VNbheZFxM5tDWoqjA3ImC50DiuuJ2tj1yEPRfkp8lLLg6XAaJ4On+a0yAXor/8ay5gHnAIshRM44Kpw==", "peer": true, "dependencies": { - "lodash.assignwith": "^4.2.0", + "lodash": "^4.17.21", "typical": "^7.1.1" }, "engines": { @@ -5832,6 +5832,14 @@ "node": "*" } }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/aws4": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", @@ -7331,27 +7339,27 @@ } }, "node_modules/engine.io-client": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.3.tgz", - "integrity": "sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.4.tgz", + "integrity": "sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ==", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", - "ws": "~8.11.0", + "ws": "~8.17.1", "xmlhttprequest-ssl": "~2.0.0" } }, "node_modules/engine.io-client/node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -10868,12 +10876,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.assignwith": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", - "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==", - "peer": true - }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -10910,6 +10912,20 @@ "node": "20 || >=22" } }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/mac-ca": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mac-ca/-/mac-ca-3.1.0.tgz", @@ -11068,28 +11084,17 @@ } }, "node_modules/micromatch": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.6.tgz", - "integrity": "sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", - "picomatch": "^4.0.2" + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, - "node_modules/micromatch/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -11293,15 +11298,16 @@ } }, "node_modules/mysql2": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.9.7.tgz", - "integrity": "sha512-KnJT8vYRcNAZv73uf9zpXqNbvBG7DJrs+1nACsjZP1HMJ1TgXEy8wnNilXAn/5i57JizXKtrUtwDB7HxT9DDpw==", + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.4.tgz", + "integrity": "sha512-Z2o3tY4Z8EvSRDwknaC40MdZ3+m0sKbpnXrShQLdxPrAvcNli7jLrD2Zd2IzsRMw4eK9Yle500FDmlkIqp+krg==", "dependencies": { + "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.6.3", "long": "^5.2.1", - "lru-cache": "^8.0.0", + "lru.min": "^1.0.0", "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" @@ -11310,14 +11316,6 @@ "node": ">= 8.0" } }, - "node_modules/mysql2/node_modules/lru-cache": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", - "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", - "engines": { - "node": ">=16.14" - } - }, "node_modules/named-placeholders": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", @@ -12253,7 +12251,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 8a07e257c..c833c3a7a 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -38,6 +38,7 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { insertAtCursor: [{ text: string }, void]; copyText: [{ text: string }, void]; "jetbrains/editorInsetHeight": [{ height: number }, void]; + "jetbrains/isOSREnabled": [undefined, void]; "vscode/openMoveRightMarkdown": [undefined, void]; setGitHubAuthToken: [{ token: string }, void]; acceptDiff: [{ filepath: string; streamId?: string }, void]; @@ -110,6 +111,7 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & { setTheme: [{ theme: any }, void]; setColors: [{ [key: string]: string }, void]; "jetbrains/editorInsetRefresh": [undefined, void]; + "jetbrains/isOSREnabled": [boolean, void]; addApiKey: [undefined, void]; setupLocalConfig: [undefined, void]; incrementFtc: [undefined, void]; diff --git a/core/util/filesystem.ts b/core/util/filesystem.ts index de71c15e2..42900edb5 100644 --- a/core/util/filesystem.ts +++ b/core/util/filesystem.ts @@ -20,7 +20,7 @@ import { GetGhTokenArgs } from "../protocol/ide.js"; import { getContinueGlobalPath } from "./paths.js"; class FileSystemIde implements IDE { - constructor(private readonly workspaceDir: string) { } + constructor(private readonly workspaceDir: string) {} showToast( type: ToastType, message: string, @@ -36,7 +36,7 @@ class FileSystemIde implements IDE { } gotoDefinition(location: Location): Promise