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

feat(developer): add hint when index() store is longer than any() store #12000

Merged

Conversation

mcdurdin
Copy link
Member

While it does not cause any problems to have a index() store that is longer than its corresponding any() store, it often indicates a mistake, as the trailing characters in the store are ignored. Thus, adding as a hint (which can be disabled via message suppression) rather than as a warning or error.

Example code:

store(abc) 'abc'
store(defg) 'defg'
any(abc) + 'x' > index(defg, 1)  c generates HINT_IndexStoreLong

Fixes: #10666

@keymanapp-test-bot skip

While it does not cause any problems to have a index() store that is
longer than its corresponding any() store, it often indicates a mistake,
as the trailing characters in the store are ignored. Thus, adding as a
hint (which can be disabled via message suppression) rather than as a
warning or error.

Example code:
    store(abc) 'abc'
    store(defg) 'defg'
    any(abc) + 'x' > index(defg, 1)  c generates HINT_IndexStoreLong

Fixes: #10666
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jul 24, 2024

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@mcdurdin
Copy link
Member Author

@markcsinclair you will note that I have added e2e message tests to kmc-kmn, leaving the unit test for the CheckStatementOffsets function to you for now 😁

@@ -0,0 +1,11 @@
store(&NAME) 'warn_index_store_short'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
store(&NAME) 'warn_index_store_short'
store(&NAME) 'hint_index_store_short'

@@ -0,0 +1,11 @@
store(&NAME) 'warn_index_store_short_key'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
store(&NAME) 'warn_index_store_short_key'
store(&NAME) 'hint_index_store_short_key'

@mcdurdin mcdurdin merged commit b0c7147 into master Jul 25, 2024
4 checks passed
@mcdurdin mcdurdin deleted the feat/developer/10666-hint-on-index-store-longer-than-any branch July 25, 2024 07:46
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 18.0.75-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants