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
9 changes: 8 additions & 1 deletion scripts/persistent_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,17 @@ def get_cached_result(
return None

conn = self._connect()
# Tiebreak on the autoincrement id (monotonic) in addition to
# timestamp: set_cached_result() does a plain INSERT (not an
# upsert), so two writes for the same (command, file_set_hash) in
# quick succession can land on the same time.time() value (limited
# clock resolution) — ORDER BY timestamp alone then returns
# whichever row SQLite picks arbitrarily on the tie, which can be
# the stale one.
row = conn.execute(
"""SELECT result_json FROM analysis_cache
WHERE command = ? AND file_set_hash = ?
ORDER BY timestamp DESC LIMIT 1
ORDER BY timestamp DESC, id DESC LIMIT 1
""",
(command, file_set_hash),
).fetchone()
Expand Down
7 changes: 5 additions & 2 deletions tests/test_node_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ def test_unknown_language_raises(self):


class TestGetSupportedLanguages:
"""``get_supported_languages()`` lists all 7 tree-sitter languages."""
"""``get_supported_languages()`` lists all 13 tree-sitter languages."""

# Issue #198 added go/java/php/ruby/c/cpp (6 languages) alongside the
# original 7 (python/rust/javascript/typescript/tsx/css/html) -> 13 total.
EXPECTED_LANGUAGES = {
"python", "rust", "javascript", "typescript", "tsx", "css", "html"
"python", "rust", "javascript", "typescript", "tsx", "css", "html",
"go", "java", "php", "ruby", "c", "cpp",
}

def test_all_expected_languages_present(self):
Expand Down
Loading