Added keywords for 1C query syntax#4321
Conversation
| Author: Stanislav Belov <stbelov@gmail.com> | ||
| Description: built-in language 1C:Enterprise (v7, v8) | ||
| Category: enterprise | ||
| Category: enterprise, common |
There was a problem hiding this comment.
Common is decided by core team. Please remove this. I don't think we'll be adding 1C to the common build anytime soon.
There was a problem hiding this comment.
Removed common from category
| // Дополнительные объекты | ||
| + 'внешнийисточникданных внешняяобработка внешнийотчет ' | ||
| + 'общийреквизит общиймодуль общаяформа общиймакет '; |
There was a problem hiding this comment.
Aligned the comment with the rest of the code. Ran ESLint --fix to ensure consistent formatting.
|
|
||
| // keyword : ключевые слова | ||
| const KEYWORD = v7_keywords + v8_keywords; | ||
| const KEYWORD = v7_keywords + v7_query_keywords + v8_keywords + v8_query_keywords; |
There was a problem hiding this comment.
Did we not support query keywords before at all?
There was a problem hiding this comment.
Yes, keywords in queries weren't supported at all; the module's author confirmed this.
| const NUMBERS = hljs.inherit(hljs.NUMBER_MODE); | ||
|
|
||
| // operator : Звездочка для выбора всех полей | ||
| const OPERATORS = { |
There was a problem hiding this comment.
I'm not sure I understand what an operator is or what this rule is trying to match, please provide some markup tests with examples.
| begin: 'ЕСТЬNULL|ВЫРАЗИТЬ|РАЗНОСТЬДАТ|ДАТАВРЕМЯ|ГОД|МЕСЯЦ|ДЕНЬ|ДЕНЬГОДА|ДЕНЬНЕДЕЛИ|НЕДЕЛЯГОДА|ЧАС|МИНУТА|СЕКУНДА|НАЧАЛОПЕРИОДА|КОНЕЦПЕРИОДА|ДОБАВИТЬКДАТЕ|СУММА|КОЛИЧЕСТВО|МИНИМУМ|МАКСИМУМ|СРЕДНЕЕ', | ||
| end: '\\(', | ||
| returnBegin: true, | ||
| contains: [ |
There was a problem hiding this comment.
Can we do this instead with regex.lookahead? We're trying to deprecate returnBegin.
Or just modify this rule itself to had className: function built in and match the trailing ( using look-ahead. Again the goal to not use returnBegin.
There was a problem hiding this comment.
Replaced returnBegin with regex.lookahead
|
What is your interest in 1C... would you like to become the defacto maintainer? It's really not practical to maintain this in core since I can't even read 99% of the file... |
Added keywords for 1C query syntax. Added metadata to the v8_meta_keywords constant
00547ba to
42723db
Compare
Description
Added missing keywords for 1C query language including OPERATOR, WHERE, ORDER BY, GROUP BY, and other SQL-like constructs specific to 1C platform.
Motivation and Context
Currently, some 1C query language keywords are not properly highlighted. This change improves the developer experience when working with 1C queries by providing more accurate syntax highlighting.
How Has This Been Tested?
Types of changes
Checklist: