Skip to content
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

Add support for ABAP CDS #4614

Merged
merged 12 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from 10 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@
[submodule "vendor/grammars/ZenScript-tmLanguage"]
path = vendor/grammars/ZenScript-tmLanguage
url = https://github.com/CraftTweaker/ZenScript-tmLanguage
[submodule "vendor/grammars/abap-cds-grammar"]
path = vendor/grammars/abap-cds-grammar
url = https://github.com/FreHu/abap-cds-grammar
[submodule "vendor/grammars/abap.tmbundle"]
path = vendor/grammars/abap.tmbundle
url = https://github.com/pvl/abap.tmbundle
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ vendor/grammars/XojoSyntaxTM:
- source.xojo
vendor/grammars/ZenScript-tmLanguage:
- source.zenscript
vendor/grammars/abap-cds-grammar:
- source.abapcds
vendor/grammars/abap.tmbundle:
- source.abap
vendor/grammars/actionscript3-tmbundle/:
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ ABAP:
tm_scope: source.abap
ace_mode: abap
language_id: 1
ABAP CDS:
type: programming
color: "#555e25"
extensions:
- ".asddls"
tm_scope: "source.abapcds"
language_id: 452681853
ace_mode: text
ABNF:
type: data
ace_mode: text
Expand Down
19 changes: 19 additions & 0 deletions samples/ABAP CDS/zcds_monsters_association.ddls.asddls
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@AbapCatalog.sqlViewName: 'ZV_MONSTERS_ASS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Monster CDS View with Association'
// Listing 07.30 : Coding CDS Views using Association
define view Zcds_Monsters_Association
as select from ztmonster_header as monster
association [0..*] to ztmonster_pets as _Pet on monster.monster_number = _Pet.owner
{
key monster.monster_number as MonsterNumber,
key _Pet.pet_number as PetNumber,
_Pet.owner as Owner,
monster.name as OwnerName,
_Pet.pet_name as Name,
_Pet.pet_type as Type,
_Pet.pet_species as Species,
_Pet // Make association public
}
21 changes: 21 additions & 0 deletions samples/ABAP CDS/zcds_monsters_parameters.ddls.asddls
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@AbapCatalog.sqlViewName: 'ZV_MONSTERS_PARS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Monster CDS View with Parameters'
// Listing 07.32 : Defining CDS View with Parameters
define view Zcds_Monsters_Parameters
with parameters
p_sanity_low : zde_monster_sanity,
p_sanity_high : zde_monster_sanity,
p_color : zde_monster_color
as select from ztmonster_header as monster
{
key monster.monster_number as MonsterNumber,
monster.name as name,
monster.color as color,
monster.sanity_percentage as sanity,
monster.strength as strength
}
where
monster.color = :p_color
and sanity_percentage between :p_sanity_low and :p_sanity_high
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
<!-- Everything below this line is auto-generated by script/list-grammars. Manual edits will be lost -->
- **1C Enterprise:** [xDrivenDevelopment/atom-language-1c-bsl](https://github.com/xDrivenDevelopment/atom-language-1c-bsl)
- **ABAP:** [pvl/abap.tmbundle](https://github.com/pvl/abap.tmbundle)
- **ABAP CDS:** [FreHu/abap-cds-grammar](https://github.com/FreHu/abap-cds-grammar)
- **ABNF:** [sanssecours/ABNF.tmbundle](https://github.com/sanssecours/ABNF.tmbundle)
- **AGS Script:** [textmate/c.tmbundle](https://github.com/textmate/c.tmbundle)
- **AMPL:** [ampl/sublime-ampl](https://github.com/ampl/sublime-ampl)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/abap-cds-grammar
Submodule abap-cds-grammar added at 534201
30 changes: 30 additions & 0 deletions vendor/licenses/grammar/abap-cds-grammar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
type: grammar
name: abap-cds-grammar
version: 534201199f4f80da8d34ac1601edc7b9b28b4ca9
license: unlicense
---
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>