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
18 changes: 18 additions & 0 deletions changelog.d/unreleased/4917.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
category: internal
issues:
- 4917
affected:
- src/CodeIndex/Cli/DiffCommandRunner.cs
- src/CodeIndex/Indexer/References/Languages/ShaderReferenceExtractor.cs
- src/CodeIndex/Indexer/Symbols/SymbolExtractor.ExtractCore.cs
- src/CodeIndex/Lsp/LspServer.PositionResolution.cs
---

## English

- **Removed four superseded internal helpers (#4917)** — deleted unused diff string-row equality, shader quoted-include, Prolog clause-terminator, and LSP position-preference helpers after confirming their active call paths use the more complete ordered-diff, general shader-include, top-level Prolog terminator, and position-aware definition-resolution implementations.

## 日本語

- **置換済みの内部 helper 4 件を削除しました (#4917)** — 現在の call path が、より完全な ordered diff、shader include の共通処理、Prolog の top-level terminator 判定、position-aware な definition resolution を使用していることを確認し、未使用となっていた diff の string-row equality、shader の quoted-include、Prolog の clause-terminator、LSP の position-preference helper を削除しました。
25 changes: 0 additions & 25 deletions src/CodeIndex/Cli/DiffCommandRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,31 +1148,6 @@ private static bool RowsEqual(SqliteConnection leftConnection, SqliteConnection
return leftHasValue == rightHasValue;
}

private static bool StringRowsEqual(SqliteConnection leftConnection, SqliteConnection rightConnection, string sql, CancellationToken cancellationToken)
{
using var leftCommand = leftConnection.CreateCommand();
leftCommand.CommandText = sql;
using var rightCommand = rightConnection.CreateCommand();
rightCommand.CommandText = sql;
using var leftReader = leftCommand.ExecuteReader();
using var rightReader = rightCommand.ExecuteReader();

var leftRowsRead = 0;
var rightRowsRead = 0;
var leftHasValue = TryReadString(leftReader, out var leftValue, ref leftRowsRead, "left", cancellationToken);
var rightHasValue = TryReadString(rightReader, out var rightValue, ref rightRowsRead, "right", cancellationToken);
while (leftHasValue && rightHasValue)
{
cancellationToken.ThrowIfCancellationRequested();
if (!string.Equals(leftValue, rightValue, StringComparison.Ordinal))
return false;
leftHasValue = TryReadString(leftReader, out leftValue, ref leftRowsRead, "left", cancellationToken);
rightHasValue = TryReadString(rightReader, out rightValue, ref rightRowsRead, "right", cancellationToken);
}

return leftHasValue == rightHasValue;
}

private static bool TryReadRow(SqliteDataReader reader, out DiffRow value, ref int rowsRead, string side, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ internal static class ShaderReferenceExtractor
private static readonly Regex IncludeDirectiveRegex = new(
@"^\s*#\s*include\b",
SharedRegexOptions);
private static readonly Regex QuotedIncludeRegex = new(
@"^\s*#\s*include\s*""(?<path>[^""\r\n]+)""",
SharedRegexOptions);
private static readonly Regex CudaKernelLaunchRegex = new(
@"(?<![\w:])(?<name>(?:[A-Za-z_]\w*::)*[A-Za-z_]\w*)(?:\s*<[^<>\r\n]{1,512}>)?\s*<<<",
SharedRegexOptions);
Expand Down
17 changes: 0 additions & 17 deletions src/CodeIndex/Indexer/Symbols/SymbolExtractor.ExtractCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,23 +1571,6 @@ private static void AddPrologMultilineHeadSymbols(
}
}

private static bool HasPrologClauseTerminator(string line)
{
for (var column = 0; column < line.Length; column++)
{
if (line[column] is '\'' or '"')
{
column = SkipPrologQuotedTerm(line, column, line[column]) - 1;
continue;
}

if (DynamicDeclarativeReferenceExtractor.IsPrologClauseTerminator(line, column))
return true;
}

return false;
}

private static int SkipPrologQuotedTerm(string line, int startColumn, char delimiter)
{
for (var column = startColumn + 1; column < line.Length; column++)
Expand Down
8 changes: 0 additions & 8 deletions src/CodeIndex/Lsp/LspServer.PositionResolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,6 @@ private static bool TryCountCommaSeparatedItems(
return false;
}

private List<DefinitionResult> PreferDefinitionAtPosition(
List<DefinitionResult> definitions,
PositionTokenContext context)
{
var positioned = FindDefinitionsAtPosition(definitions, context);
return positioned.Count > 0 ? positioned : definitions;
}

private List<DefinitionResult> FindDefinitionsAtPosition(
List<DefinitionResult> definitions,
PositionTokenContext context)
Expand Down
Loading