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

Commit

Permalink
Merge 19c4b1a into 427a3ca
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 11, 2020
2 parents 427a3ca + 19c4b1a commit f9ce1f9
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 34 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ We recommend you using [dvm](https://github.com/axetroy/dvm) for the manager Den

- `deno.enabled` - Enable extension. Default is `false`

- `deno.dts_file` - The file paths of the TypeScript declaration file (.d.ts). Default is `[]`

- `deno.import_map` - The file paths of Import Map. Default is `null`

We recommend that you do not set global configuration. It should be configured in `.vscode/settings.json` in the project directory:
Expand All @@ -147,7 +145,6 @@ We recommend that you do not set global configuration. It should be configured i
// .vscode/settings.json
{
"deno.enable": true,
"deno.dts_file": ["./path/to/your/customize/lib.d.ts"],
"deno.import_map": "./path/to/import_map.json"
}
```
Expand Down
6 changes: 0 additions & 6 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const TYPESCRIPT_DENO_PLUGIN_ID = "typescript-deno-plugin";

type SynchronizedConfiguration = {
enable?: boolean;
dts_file?: string[];
import_map?: string;
};

Expand Down Expand Up @@ -141,7 +140,6 @@ export class Extension {
}

withConfigValue(_config, config, "enable");
withConfigValue(_config, config, "dts_file");
withConfigValue(_config, config, "import_map");

if (!config.enable) {
Expand All @@ -152,10 +150,6 @@ export class Extension {
config.import_map = undefined;
}

if (!config.dts_file) {
config.dts_file = [];
}

return config;
}
// register command for deno extension
Expand Down
13 changes: 0 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@
false
]
},
"deno.dts_file": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "%deno.config.dts_file%",
"scope": "resource",
"examples": [
"./deno.d.ts",
"/absolute/path/to/deno.d.ts"
]
},
"deno.import_map": {
"type": "string",
"markdownDescription": "%deno.config.import_map%",
Expand Down
3 changes: 0 additions & 3 deletions typescript-deno-plugin/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ import equal from "deep-equal";

export type DenoPluginConfig = {
enable: boolean;
dts_file: string[];
import_map: string;
};

type UpdateDenoPluginConfig = {
enable?: boolean;
dts_file?: string[];
import_map?: string;
};

export class ConfigurationManager {
private static readonly defaultConfiguration: DenoPluginConfig = {
enable: false,
dts_file: [],
import_map: ""
};

Expand Down
10 changes: 1 addition & 9 deletions typescript-deno-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ export class DenoPlugin implements ts_module.server.PluginModule {
}

// Get typescript declaration File
const dtsFiles = [getDenoDts()]
.concat(this.configurationManager.config.dts_file || [])
.map(filepath => {
const absoluteFilepath = path.isAbsolute(filepath)
? filepath
: path.resolve(project.getCurrentDirectory(), filepath);
return absoluteFilepath;
})
.filter(v => v.endsWith(this.typescript.Extension.Dts));
const dtsFiles = [getDenoDts()];

const iterator = new Set(dtsFiles).entries();

Expand Down

0 comments on commit f9ce1f9

Please sign in to comment.