Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
fix: auto import module not working properly in some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 26, 2020
1 parent 5278331 commit 71b518b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions typescript-deno-plugin/src/plugin.ts
Expand Up @@ -225,8 +225,15 @@ export class DenoPlugin implements ts_module.server.PluginModule {
return details;
}

if (details && details.kindModifiers === "export") {
if (details.codeActions && details.codeActions.length) {
if (details) {
// modifiers maybe contain multiple values. eg `export,declare`
const modifiers = details.kindModifiers.split(",") || [];

if (
modifiers.includes("export") &&
details.codeActions &&
details.codeActions.length
) {
for (const ca of details.codeActions) {
for (const change of ca.changes) {
if (!change.isNewFile) {
Expand Down

0 comments on commit 71b518b

Please sign in to comment.