Skip to content

Commit 9e326f1

Browse files
authored
chore: default "deno.enablePaths" to null (#1028)
1 parent edde9c6 commit 9e326f1

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

client/src/enable.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ export async function getWorkspacesEnabledInfo() {
4141
}
4242

4343
// check for specific paths being enabled
44-
const enabledPaths = config.get<string[]>(ENABLE_PATHS);
45-
// We convert `enablePaths: []` to `enablePaths: null` for now.
46-
// See https://github.com/denoland/vscode_deno/issues/908.
47-
if (enabledPaths && enabledPaths.length) {
44+
if (config.get<string[]>(ENABLE_PATHS)) {
4845
return true;
4946
}
5047

client/src/extension.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ function getPathFilters(): PathFilter[] {
110110
vscode.Uri.joinPath(workspaceFolder.uri, p).fsPath
111111
);
112112
const enabled_ = config.get<string[]>(ENABLE_PATHS);
113-
// We convert `enablePaths: []` to `enablePaths: null` for now.
114-
// See https://github.com/denoland/vscode_deno/issues/908.
115-
const enabled = enabled_?.length
113+
const enabled = enabled_
116114
? enabled_.map((p) => vscode.Uri.joinPath(workspaceFolder.uri, p).fsPath)
117115
: null;
118116
if (disabled.length === 0 && enabled == null) {

client/src/shared_types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface Settings {
9393
disablePaths: string[];
9494
/** If set, indicates that only the paths in the workspace should be Deno
9595
* enabled. */
96-
enablePaths: string[];
96+
enablePaths: string[] | null;
9797
/** A path to an import map that should be applied. */
9898
importMap: string | null;
9999
/** Options related to the display of inlay hints. */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
"items": {
204204
"type": "string"
205205
},
206-
"default": [],
206+
"default": null,
207207
"markdownDescription": "Enables the Deno Language Server for specific paths, instead of for the whole workspace folder. This will disable the built in TypeScript/JavaScript language server for those paths.\n\nWhen a value is set, the value of `\"deno.enable\"` is ignored.\n\nThe workspace folder is used as the base for the supplied paths. If for example you have all your Deno code in `worker` path in your workspace, you can add an item with the value of `./worker`, and the Deno will only provide diagnostics for the files within `worker` or any of its sub paths.\n\n**Not recommended to be enabled in user settings.**",
208208
"scope": "resource",
209209
"examples": [

typescript-deno-plugin/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const defaultSettings: Settings = {
3636
certificateStores: null,
3737
enable: null,
3838
disablePaths: [],
39-
enablePaths: [],
39+
enablePaths: null,
4040
codeLens: null,
4141
config: null,
4242
documentPreloadLimit: null,

0 commit comments

Comments
 (0)