Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/language-server/src/ls-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const defaultLSConfig: LSConfig = {
enable: true,
compilerWarnings: {},
diagnostics: { enable: true },
rename: { enable: true },
format: { enable: true },
completions: { enable: true },
hover: { enable: true },
Expand Down Expand Up @@ -84,7 +85,7 @@ export interface LSTypescriptConfig {
enable: boolean;
};
selectionRange: {
enable: boolean
enable: boolean;
};
}

Expand All @@ -110,7 +111,7 @@ export interface LSCSSConfig {
enable: boolean;
};
selectionRange: {
enable: boolean
enable: boolean;
};
}

Expand Down Expand Up @@ -141,6 +142,9 @@ export interface LSSvelteConfig {
format: {
enable: boolean;
};
rename: {
enable: boolean;
};
completions: {
enable: boolean;
};
Expand All @@ -151,7 +155,7 @@ export interface LSSvelteConfig {
enable: boolean;
};
selectionRange: {
enable: boolean
enable: boolean;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ export class TypeScriptPlugin
}

async updateImports(fileRename: FileRename): Promise<WorkspaceEdit | null> {
if (!this.featureEnabled('rename')) {
if (
!(
this.configManager.enabled('svelte.enable') &&
this.configManager.enabled('svelte.rename.enable')
)
) {
return null;
}

Expand Down
6 changes: 5 additions & 1 deletion packages/svelte-vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ Enable code actions for TypeScript. _Default_: `true`

Enable selection range for TypeScript. _Default_: `true`

##### `svelte.plugin.typescript.rename.enable`

Enable rename functionality for JS/TS variables inside Svelte files. _Default_: `true`

##### `svelte.plugin.css.enable`

Enable the CSS plugin. _Default_: `true`
Expand Down Expand Up @@ -184,7 +188,7 @@ Enable autocompletion for Svelte (for tags like #if/#each). _Default_: `true`

##### `svelte.plugin.svelte.rename.enable`

Enable rename functionality (rename svelte files or variables inside svelte files). _Default_: `true`
Enable rename/move Svelte files functionality. _Default_: `true`

##### `svelte.plugin.svelte.codeActions.enable`

Expand Down
12 changes: 12 additions & 0 deletions packages/svelte-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
"title": "TypeScript: SelectionRange",
"description": "Enable selection range for TypeScript"
},
"svelte.plugin.typescript.rename.enable": {
"type": "boolean",
"default": true,
"title": "TypeScript: Rename",
"description": "Enable rename functionality for JS/TS variables inside Svelte files"
},
"svelte.plugin.css.enable": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -254,6 +260,12 @@
"default": true,
"title": "Svelte: Selection Range",
"description": "Enable selection range for Svelte"
},
"svelte.plugin.svelte.rename.enable": {
"type": "boolean",
"default": true,
"title": "Svelte: Rename",
"description": "Enable rename/move Svelte files functionality"
}
}
},
Expand Down