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

Refine locations in the CDS file #159

Merged
merged 6 commits into from
Nov 19, 2024
Merged

Refine locations in the CDS file #159

merged 6 commits into from
Nov 19, 2024

Conversation

lcartey
Copy link
Contributor

@lcartey lcartey commented Nov 14, 2024

This PR updates our locations in CDS files by:

  • Using the location in the .cds.json file for CDL definitions which do not directly appear in the .cds file. These are usually metadata elements in the .cds.json, used for grouping data produced by the compiler.
  • Updates the location of CDL elements in CDS files by determining an appropriate end column location. This avoids the problem of highlighting the whole line, and the beginning of the following line.

 - Exclude objects without a $locations property
 - Use the known name to deduce the end column
CdlAttributes extend CdlObject, not CdlElement, but still require
location sniffing.
 * Use the file location only if no line/col data
 * Use the col start line if available, otherwise choose col 0
 * Use the end line deduction if available, otherwise use 1 past the start
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jeongsoolee09 jeongsoolee09 merged commit aed7714 into main Nov 19, 2024
5 checks passed
@jeongsoolee09 jeongsoolee09 deleted the lcartey/cds-locations branch November 19, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants