simdref 0.0.11__tar.gz → 0.0.12__tar.gz

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.
Files changed (80) hide show
  1. {simdref-0.0.11/src/simdref.egg-info → simdref-0.0.12}/PKG-INFO +1 -1
  2. {simdref-0.0.11 → simdref-0.0.12}/pyproject.toml +1 -1
  3. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/lsp.py +6 -1
  4. {simdref-0.0.11 → simdref-0.0.12/src/simdref.egg-info}/PKG-INFO +1 -1
  5. {simdref-0.0.11 → simdref-0.0.12}/tests/test_lsp_stdio.py +22 -0
  6. {simdref-0.0.11 → simdref-0.0.12}/LICENSE +0 -0
  7. {simdref-0.0.11 → simdref-0.0.12}/README.md +0 -0
  8. {simdref-0.0.11 → simdref-0.0.12}/setup.cfg +0 -0
  9. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/__init__.py +0 -0
  10. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/__main__.py +0 -0
  11. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/annotate.py +0 -0
  12. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/arm_instructions.py +0 -0
  13. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/cli.py +0 -0
  14. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/display.py +0 -0
  15. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/export.py +0 -0
  16. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/filters.py +0 -0
  17. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/ingest.py +0 -0
  18. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/ingest_catalog.py +0 -0
  19. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/ingest_pdf.py +0 -0
  20. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/ingest_sources.py +0 -0
  21. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/manpages.py +0 -0
  22. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/models.py +0 -0
  23. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfparse/__init__.py +0 -0
  24. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfparse/base.py +0 -0
  25. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfparse/intel.py +0 -0
  26. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfparse/registry.py +0 -0
  27. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfparse/types.py +0 -0
  28. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/pdfrefs.py +0 -0
  29. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf.py +0 -0
  30. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf_sources/__init__.py +0 -0
  31. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf_sources/cores.py +0 -0
  32. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf_sources/llvm_mca.py +0 -0
  33. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf_sources/llvm_scheduling.py +0 -0
  34. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/perf_sources/merge.py +0 -0
  35. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/queries.py +0 -0
  36. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/riscv.py +0 -0
  37. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/search.py +0 -0
  38. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/storage.py +0 -0
  39. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/tui.py +0 -0
  40. {simdref-0.0.11 → simdref-0.0.12}/src/simdref/ui_labels.py +0 -0
  41. {simdref-0.0.11 → simdref-0.0.12}/src/simdref.egg-info/SOURCES.txt +0 -0
  42. {simdref-0.0.11 → simdref-0.0.12}/src/simdref.egg-info/dependency_links.txt +0 -0
  43. {simdref-0.0.11 → simdref-0.0.12}/src/simdref.egg-info/entry_points.txt +0 -0
  44. {simdref-0.0.11 → simdref-0.0.12}/src/simdref.egg-info/requires.txt +0 -0
  45. {simdref-0.0.11 → simdref-0.0.12}/src/simdref.egg-info/top_level.txt +0 -0
  46. {simdref-0.0.11 → simdref-0.0.12}/tests/test_annotate.py +0 -0
  47. {simdref-0.0.11 → simdref-0.0.12}/tests/test_annotate_positions.py +0 -0
  48. {simdref-0.0.11 → simdref-0.0.12}/tests/test_audit_coverage.py +0 -0
  49. {simdref-0.0.11 → simdref-0.0.12}/tests/test_auto_update_on_version_change.py +0 -0
  50. {simdref-0.0.11 → simdref-0.0.12}/tests/test_cli_bare_query.py +0 -0
  51. {simdref-0.0.11 → simdref-0.0.12}/tests/test_cli_bootstrap_progress.py +0 -0
  52. {simdref-0.0.11 → simdref-0.0.12}/tests/test_cli_help.py +0 -0
  53. {simdref-0.0.11 → simdref-0.0.12}/tests/test_cli_llm.py +0 -0
  54. {simdref-0.0.11 → simdref-0.0.12}/tests/test_coverage_live.py +0 -0
  55. {simdref-0.0.11 → simdref-0.0.12}/tests/test_coverage_parity.py +0 -0
  56. {simdref-0.0.11 → simdref-0.0.12}/tests/test_display.py +0 -0
  57. {simdref-0.0.11 → simdref-0.0.12}/tests/test_export.py +0 -0
  58. {simdref-0.0.11 → simdref-0.0.12}/tests/test_filters.py +0 -0
  59. {simdref-0.0.11 → simdref-0.0.12}/tests/test_ingest_sources.py +0 -0
  60. {simdref-0.0.11 → simdref-0.0.12}/tests/test_intel_operation_and_url.py +0 -0
  61. {simdref-0.0.11 → simdref-0.0.12}/tests/test_issue2_fixes.py +0 -0
  62. {simdref-0.0.11 → simdref-0.0.12}/tests/test_issues_23_24_25.py +0 -0
  63. {simdref-0.0.11 → simdref-0.0.12}/tests/test_lsp_web.py +0 -0
  64. {simdref-0.0.11 → simdref-0.0.12}/tests/test_models.py +0 -0
  65. {simdref-0.0.11 → simdref-0.0.12}/tests/test_pdfparse.py +0 -0
  66. {simdref-0.0.11 → simdref-0.0.12}/tests/test_perf.py +0 -0
  67. {simdref-0.0.11 → simdref-0.0.12}/tests/test_perf_sources.py +0 -0
  68. {simdref-0.0.11 → simdref-0.0.12}/tests/test_presentation.py +0 -0
  69. {simdref-0.0.11 → simdref-0.0.12}/tests/test_preset_persistence.py +0 -0
  70. {simdref-0.0.11 → simdref-0.0.12}/tests/test_riscv_docs_pages.py +0 -0
  71. {simdref-0.0.11 → simdref-0.0.12}/tests/test_search.py +0 -0
  72. {simdref-0.0.11 → simdref-0.0.12}/tests/test_search_pushdown.py +0 -0
  73. {simdref-0.0.11 → simdref-0.0.12}/tests/test_source_kind_filter.py +0 -0
  74. {simdref-0.0.11 → simdref-0.0.12}/tests/test_source_validation.py +0 -0
  75. {simdref-0.0.11 → simdref-0.0.12}/tests/test_storage_payload.py +0 -0
  76. {simdref-0.0.11 → simdref-0.0.12}/tests/test_storage_schema.py +0 -0
  77. {simdref-0.0.11 → simdref-0.0.12}/tests/test_tui.py +0 -0
  78. {simdref-0.0.11 → simdref-0.0.12}/tests/test_ui_labels_parity.py +0 -0
  79. {simdref-0.0.11 → simdref-0.0.12}/tests/test_version_matches_pyproject.py +0 -0
  80. {simdref-0.0.11 → simdref-0.0.12}/tests/test_x86_linking.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simdref
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Searchable SIMD intrinsic and instruction reference with CLI, manpages, TUI, and LSP.
5
5
  Author: Marco
6
6
  License: GPL-3.0-or-later
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simdref"
7
- version = "0.0.11"
7
+ version = "0.0.12"
8
8
  description = "Searchable SIMD intrinsic and instruction reference with CLI, manpages, TUI, and LSP."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -99,6 +99,11 @@ def _code_point_index(line: str, character: int) -> int:
99
99
  return index
100
100
 
101
101
 
102
+ def _utf16_column(line: str, index: int) -> int:
103
+ # The reverse of _code_point_index: a code-point index to a UTF-16 column.
104
+ return sum(2 if ord(c) > 0xFFFF else 1 for c in line[:index])
105
+
106
+
102
107
  def _line_prefix(text: str, line: int, character: int) -> str:
103
108
  lines = text.splitlines()
104
109
  if line >= len(lines):
@@ -374,7 +379,7 @@ def _inlay_hints(conn, text: str, language_id: str, uri: str, start: int, end: i
374
379
  # LSP columns count UTF-16 code units.
375
380
  "position": {
376
381
  "line": line,
377
- "character": len(source_lines[line].encode("utf-16-le")) // 2,
382
+ "character": _utf16_column(source_lines[line], len(source_lines[line])),
378
383
  },
379
384
  "label": _cut_label("; ".join(hints[line])),
380
385
  "paddingLeft": True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simdref
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Searchable SIMD intrinsic and instruction reference with CLI, manpages, TUI, and LSP.
5
5
  Author: Marco
6
6
  License: GPL-3.0-or-later
@@ -10,6 +10,7 @@ import time
10
10
  import unittest
11
11
  from pathlib import Path
12
12
 
13
+ from simdref import lsp
13
14
  from simdref.lsp import _mnemonic_from_asm_line
14
15
  from simdref.storage import SQLITE_PATH
15
16
 
@@ -192,6 +193,27 @@ class LspEndToEndTests(unittest.TestCase):
192
193
  self.assertTrue(hints[4]["label"].endswith("..."))
193
194
  self.assertFalse(hints[5]["label"].endswith("..."))
194
195
 
196
+ def test_inlay_hint_after_astral_characters_gets_utf16_column(self):
197
+ # LSP columns count UTF-16 code units: each emoji adds 2 units to the
198
+ # end-of-line column the hint returns.
199
+ prefix = "".join("\U0001f600" for _ in range(10))
200
+ text = f"# {prefix}\n vaddps ymm0, ymm1, ymm2 # {prefix}\n"
201
+ self.server.open(ASM_URI, "asm", text)
202
+ hints = {h["position"]["line"]: h for h in self.server.hints(ASM_URI)}
203
+ self.assertEqual(sorted(hints), [1])
204
+ line = text.split("\n")[1]
205
+ self.assertEqual(
206
+ hints[1]["position"]["character"],
207
+ lsp._utf16_column(line, len(line)),
208
+ )
209
+ self.assertEqual(hints[1]["label"], "Add Packed Single Precision Floating-Point Values.")
210
+
211
+ def test_utf16_column_is_the_reverse_of_code_point_index(self):
212
+ line = "a \U0001f600 b"
213
+ for index in range(len(line) + 1):
214
+ with self.subTest(index=index):
215
+ self.assertEqual(lsp._code_point_index(line, lsp._utf16_column(line, index)), index)
216
+
195
217
  def test_range_limits_hints(self):
196
218
  self.server.open(ASM_URI, "asm", ASM_TEXT)
197
219
  self.assertEqual([h["position"]["line"] for h in self.server.hints(ASM_URI, 4, 4)], [4])
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes