-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Priority: HighbugSomething isn't workingSomething isn't workinglspLanguage Server Protocol relatedLanguage Server Protocol relatedtechnical-debtCode quality and architectural issuesCode quality and architectural issues
Milestone
Description
Problem
IEC 61131-3 is case-insensitive, but implementation is inconsistent:
- Some lookups use
toLowerCase()normalization - Others use exact match first, then fallback
normalizedNamefield sometimes not set
Impact
Go to definition fails when symbol casing differs:
VAR
myTimer : TON;
END_VAR
MyTimer.Q := TRUE; // <-- Won't find definition
MYTIMER(IN := TRUE); // <-- May or may not workCode Locations
workspace-indexer.ts- Uses toLowerCase() normalizationdefinition-provider.ts- Exact match first, then fallbackast-parser.tslines 217-218 - normalizedName sometimes not set
Fix Required
Standardize case handling across all providers:
// 1. Always set normalizedName in AST parser
symbol.normalizedName = symbol.name.toLowerCase();
// 2. All lookups use normalized names
const lookup = symbolMap.get(identifier.toLowerCase());
// 3. Display original case to user
// 4. Store both original and normalizedFiles Affected
src/server/ast-parser.ts- Always normalizesrc/server/workspace-indexer.ts- Use normalized keyssrc/server/providers/definition-provider.ts- Consistent lookupsrc/server/providers/completion-provider.ts- Consistent lookupsrc/server/providers/hover-provider.ts- Consistent lookupsrc/server/providers/member-access-provider.ts- Consistent lookup
Acceptance Criteria
- All symbols have normalizedName set
- All lookups use normalized comparison
- Original case preserved for display
- Tests with mixed case scenarios
- myTimer, MyTimer, MYTIMER all resolve correctly
- Performance not degraded
Priority
HIGH - Core language feature (case insensitivity) broken
Related
- IEC 61131-3 specification compliance
- Symbol resolution
- All LSP providers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority: HighbugSomething isn't workingSomething isn't workinglspLanguage Server Protocol relatedLanguage Server Protocol relatedtechnical-debtCode quality and architectural issuesCode quality and architectural issues