setta 0.0.5.dev3__py3-none-any.whl → 0.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of setta might be problematic. Click here for more details.

setta/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.0.5.dev3"
1
+ __version__ = "0.0.6"
setta/lsp/writer.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import asyncio
2
2
  import json
3
3
  import logging
4
- import platform
5
4
  import uuid
6
5
 
7
6
  from setta.utils.utils import recursive_dict_merge
@@ -268,18 +267,19 @@ class LanguageServerWriter(LanguageServerInteractor):
268
267
  asyncio.create_task(async_task)
269
268
 
270
269
  def get_workspace_uri(self):
271
- return f"file://{self.workspace_folder}"
270
+ return self.workspace_folder.as_uri()
272
271
 
273
- def get_base_uri(self, code_id):
272
+ def get_code_id_path(self, code_id):
274
273
  return self.code_folder / f"{code_id}.py"
275
274
 
275
+ def get_base_uri(self, code_id):
276
+ return self.get_code_id_path(code_id).as_uri()
277
+
276
278
  # https://github.com/microsoft/language-server-protocol/issues/1676
277
279
  def get_uri(self, code_id, virtual):
278
- base_uri = self.get_base_uri(code_id)
279
- prefix = "untitled:" if virtual else "file://"
280
- uri = f"{prefix}{base_uri}"
281
- if platform.system() == "Windows":
282
- uri += "/" # need trailing slash on Windows for some reason
280
+ uri = self.get_base_uri(code_id)
281
+ if virtual:
282
+ uri = uri.replace("file://", "untitled:", 1)
283
283
  return uri
284
284
 
285
285
  def get_is_virtual(self, virtual):
@@ -288,7 +288,7 @@ class LanguageServerWriter(LanguageServerInteractor):
288
288
  def create_temp_file(self, code_id, code):
289
289
  """Create a temporary file for the given code and return its path."""
290
290
  # Create all necessary parent directories
291
- file_path = self.get_base_uri(code_id)
291
+ file_path = self.get_code_id_path(code_id)
292
292
  logger.debug(f"Creating temporary file {file_path}")
293
293
  file_path.parent.mkdir(parents=True, exist_ok=True)
294
294