Skip to content

Commit

Permalink
fix: "copilot_prepare_and_edit_settings" not working
Browse files Browse the repository at this point in the history
PermissionError: [WinError 5] 存取被拒。: '${packages}'

Because "${packages}" is not expanded into exact path.

Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Jul 11, 2024
1 parent 112fb6a commit 91e562b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def wrapped(self: Any, *arg, **kwargs) -> Any:

class CopilotPrepareAndEditSettingsCommand(sublime_plugin.ApplicationCommand):
def run(self, *, base_file: str, user_file: str, default: str = "") -> None:
Path(user_file).parent.mkdir(parents=True, exist_ok=True)
window = sublime.active_window()
user_file_resolved: str = sublime.expand_variables(user_file, window.extract_variables()) # type: ignore
Path(user_file_resolved).parent.mkdir(parents=True, exist_ok=True)
sublime.run_command("edit_settings", {"base_file": base_file, "user_file": user_file, "default": default})


Expand Down

0 comments on commit 91e562b

Please sign in to comment.