-
Notifications
You must be signed in to change notification settings - Fork 121
Add semantic highlighting for NStr and StrTemplate functions #3697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Implement NStrAndStrTemplateSemanticTokensSupplier to highlight: - Language keys (ru=, en=) in NStr/НСтр function calls - Placeholders (%1, %2, %(1)) in StrTemplate/СтрШаблон function calls Co-authored-by: nixel2007 <[email protected]>
| */ | ||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class NStrAndStrTemplateSemanticTokensSupplier implements SemanticTokensSupplier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot используй MultilingualStringAnalyser. Расширь его при необходимости
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to use MultilingualStringAnalyser. Extended it with:
isNStrCall()andisStrTemplateCall()static methodsfindLanguageKeyPositions()andfindPlaceholderPositions()static methodsMatchPositionrecord for position infoSTR_TEMPLATE_PLACEHOLDER_PATTERN(same pattern as inIncorrectUseOfStrTemplateDiagnostic)
Commit: 5c618ee
…ighting - Extended MultilingualStringAnalyser with public patterns and utility methods: - isNStrCall() and isStrTemplateCall() static methods - findLanguageKeyPositions() and findPlaceholderPositions() static methods - MatchPosition record for position information - STR_TEMPLATE_PLACEHOLDER_PATTERN for placeholder detection - Updated NStrAndStrTemplateSemanticTokensSupplier to use MultilingualStringAnalyser - Removed duplicate patterns from semantic tokens supplier Co-authored-by: nixel2007 <[email protected]>
NStrAndStrTemplateSemanticTokensSupplierto add semantic highlighting for NStr/НСтр and StrTemplate/СтрШаблонMultilingualStringAnalyserinstead of duplicating patternsSummary
This PR implements semantic syntax highlighting for
NStr/НСтрandStrTemplate/СтрШаблонfunction calls:NStr/НСтр Highlighting
Language keys in multilingual strings are highlighted as
Property:StrTemplate/СтрШаблон Highlighting
Placeholders in template strings are highlighted as
Parameter:Implementation
Extended
MultilingualStringAnalyserwith:isNStrCall(),isStrTemplateCall(),findLanguageKeyPositions(),findPlaceholderPositions()MatchPositionrecord for returning position informationThe implementation follows the existing patterns in the codebase and reuses the
MultilingualStringAnalyseras requested.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.