jon
jon4mo ago

Automate Export+Import when using deps.ts pattern in VSCode/LSP

Hey, I wanted to see if there is a way to configure my IDE's (VSCode using the Deno extension) "Quick Fix" feature to automate importing from deps.ts instead of a fully-qualified URL, but in the case where an existing export in deps.ts is not present? To restate, when deps.ts is present and used, I want to automate adding a new export from deps.ts, and then import that exported thing directly in the file I am trying to run the "Quick Fix" from. deps.ts will be recommended as an import origin, but only if the exported thing already exists in deps.ts.
No description
1 Reply
Deno AI Helper
Deno AI Helper4mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, it seems like you're looking for a way to enhance the functionality of the Deno extension for Visual Studio Code to support a more automated way of managing imports from a centralized deps.ts file. As of my knowledge cutoff date, the Deno extension for VSCode does not provide a feature to automatically add new exports to deps.ts and then update imports elsewhere in your project to use that centralized module. The "Quick Fix" feature in VSCode typically suggests imports based on existing exports, and it does not modify other files to add exports that are not already present. Since this advice is not based on the Deno documentation, I recommend double-checking the accuracy of this information and exploring the possibility of custom extensions or scripts that could assist with this task. Additionally, you might want to keep an eye on updates to the Deno extension for VSCode or reach out to the community to see if there are any plans or existing solutions for this kind of functionality.