Repository: sublimelsp/LSP

Issue:
When disabling a LSP-* plugin, I the error popup shows up infinitely 
**Describe the bug**
When I disable a LSP-* plugin. 
the error popup shows to infinity.



**To Reproduce**
Steps to reproduce the behavior:
1. Have LSP-css installed.
2. Open a css file.
3. Disable the LSP-css plugin.
4. See error


**Expected behavior**

I would not expect the server to shut down gracefully without any popup showing.

**Screenshots**

But instead, the popup shows until I kill the ST app.

[If applicable, add screenshots to help explain your problem.](https://user-images.githubusercontent.com/22029477/143683180-5b1a5a71-57ae-4e35-ac9f-773eefa0076b.mp4)

**Environment (please complete the following information):**
- OS: macOS 11.5.2 Big Sur
- Sublime Text version: 4122
- LSP version: acfd6406ba4680a0e537dc87a72aa5b410a154e7
- Language servers used: [e.g. clangd, gopls, dart, Vetur, intelephense, HIE]

**Additional context**

Here is the error from the ST console:
```
LSP: starting ['', '', '--stdio'] in /Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP
Unable to start subprocess for LSP-css
Traceback (most recent call last):
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/windows.py", line 356, in start_async
    transport = create_transport(transport_config, transport_cwd, session)
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 252, in create_transport
    process = start_subprocess()
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 241, in start_subprocess
    return _start_subprocess(config.command, stdin, stdout, subprocess.PIPE, startupinfo, config.env, cwd)
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 323, in _start_subprocess
    cwd=cwd)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
PermissionError: [Errno 13] Permission denied

LSP: starting ['', '', '--stdio'] in /Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP
Unable to start subprocess for LSP-css
Traceback (most recent call last):
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/windows.py", line 356, in start_async
    transport = create_transport(transport_config, transport_cwd, session)
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 252, in create_transport
    process = start_subprocess()
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 241, in start_subprocess
    return _start_subprocess(config.command, stdin, stdout, subprocess.PIPE, startupinfo, config.env, cwd)
  File "/Users/codetribe/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 323, in _start_subprocess
    cwd=cwd)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
PermissionError: [Errno 13] Permission denied

# .... it keeps repeating to infinity ...
```

I sent my work MAC laptop to service, and got it back a few weeks ago,
I remember that I could remember that I couldn't type  ls when inside the Documents  directory.
I run into this issue:
https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/

So maybe I have some problems with permissions.


Discussion:
For me it looks like I have the correct permissions in Package Storage:
```
➜  Package Storage whoami             
codetribe
➜  Package Storage ls -la             
total 0
drwxr-xr-x  11 codetribe  staff  352 Nov 26 22:30 .
drwx------   5 codetribe  staff  160 Nov  4 09:05 ..
drwxr-xr-x   3 codetribe  staff   96 Sep 27 14:53 LSP-css
drwxr-xr-x   3 codetribe  staff   96 Sep 24 17:01 LSP-eslint
drwxr-xr-x   3 codetribe  staff   96 Oct 19 11:43 LSP-file-watcher-chokidar
drwxr-xr-x   3 codetribe  staff   96 Sep 27 06:13 LSP-json
drwxr-xr-x   4 codetribe  staff  128 Nov 19 08:13 LSP-pyright
drwxr-xr-x   3 codetribe  staff   96 Nov 26 22:30 LSP-typescript
drwxr-xr-x   3 codetribe  staff   96 Sep 24 15:31 LSP-volar
drwxr-xr-x   3 codetribe  staff   96 Sep 27 06:17 LSP-vue
drwxr-xr-x   3 codetribe  staff   96 Sep 24 14:53 lsp_utils
```

Resolving patch:
diff --git a/plugin/core/configurations.py b/plugin/core/configurations.py
--- a/plugin/core/configurations.py
+++ b/plugin/core/configurations.py
@@ -53,12 +53,12 @@ def match_view(self, view: sublime.View, include_disabled: bool = False) -> Gene
         except (IndexError, RuntimeError):
             pass
 
-    def update(self, config_name: Optional[str] = None) -> None:
+    def update(self, updated_config_name: Optional[str] = None) -> None:
         project_settings = (self._window.project_data() or {}).get("settings", {}).get("LSP", {})
-        if config_name is None:
+        if updated_config_name is None:
             self.all.clear()
         for name, config in self._global_configs.items():
-            if config_name and config_name != name:
+            if updated_config_name and updated_config_name != name:
                 continue
             overrides = project_settings.pop(name, None)
             if isinstance(overrides, dict):
@@ -69,11 +69,11 @@ def update(self, config_name: Optional[str] = None) -> None:
                 overrides["enabled"] = False
             self.all[name] = ClientConfig.from_config(config, overrides)
         for name, c in project_settings.items():
-            if config_name and config_name != name:
+            if updated_config_name and updated_config_name != name:
                 continue
             debug("loading project-only configuration", name)
             self.all[name] = ClientConfig.from_dict(name, c)
-        self._window.run_command("lsp_recheck_sessions", {'config_name': config_name})
+        self._window.run_command("lsp_recheck_sessions", {'config_name': updated_config_name})
 
     def enable_config(self, config_name: str) -> None:
         if not self._reenable_disabled_for_session(config_name):
diff --git a/plugin/core/settings.py b/plugin/core/settings.py
--- a/plugin/core/settings.py
+++ b/plugin/core/settings.py
@@ -56,7 +56,7 @@ def add_external_config(self, name: str, s: sublime.Settings, file: str, notify_
     def remove_external_config(self, name: str) -> None:
         self.external.pop(name, None)
         if self.all.pop(name, None):
-            self._notify_listener(name)
+            self._notify_listener()
 
     def update_external_config(self, name: str, s: sublime.Settings, file: str) -> None:
         try:


Test patch: