-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix autocomplete prefix for custom identifierRegexes #4919
base: master
Are you sure you want to change the base?
Conversation
c266a7b
to
fc7659b
Compare
@nightwing could you please take a look at the PR? |
@AprilArcus could you please address failing build? Seems it's just related to missing semicolon |
Hi, Ace team! My team has been using a fork of Ace, and I'm hoping to merge some of our changes upstream so that we can return to using your official releases. The engineer who originally accomplished this work has long since departed my team, so forgive me for this somewhat rote transcription of his working notes. > This was sent upstream in ajaxorg#2352, > but closed because ajaxorg@fcebd0f > seemed to address the same issue. That fix unfortunately does not > work as we need, and fails the behavior described in our test named > `test leading @ not duplicated on autocomplete` > > The root cause: Autocomplete prefix can be wrong for completions with > a custom identifierRegex because `Autocompleter.base` is computed > relative to a prefix computed for the default identifierRegex. Below, I reproduce the test my colleague referred to. ``` 'test leading @ not duplicated on autocomplete': function (test) { editor.setValue(''); editor.navigateFileStart(); var text = 'view: users { derived_table: { sql: @{;; } }'; exec('insertstring', 1, text); editor.moveCursorTo(0, 38); editor.getValue(); attachedSymbolsToSession(text, editor.session, { const: 'value' }); editor.execCommand('startAutocomplete'); var completion = editor.completer.completions.filtered.filter(function(completion) { return completion.caption === '@{const}'; }); test.ok(completion[0]); editor.completer.insertMatch(completion[0]); test.equal(editor.getValue(), 'view: users { derived_table: { sql: @{const};; } }'); test.done(); }, ```
fc7659b
to
e4e7582
Compare
done |
Codecov ReportBase: 85.75% // Head: 85.85% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4919 +/- ##
==========================================
+ Coverage 85.75% 85.85% +0.10%
==========================================
Files 539 542 +3
Lines 40728 41138 +410
Branches 6445 6515 +70
==========================================
+ Hits 34927 35320 +393
- Misses 5801 5818 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Can anyone help me rebase this over #5084? I'm stumped. |
Hi, Ace team! My team has been using a fork of Ace, and I'm hoping to merge some of our changes upstream so that we can return to using your official releases.
The engineer who originally accomplished this work has long since departed my team, so forgive me for this somewhat rote transcription of his working notes.
Below, I reproduce the test my colleague referred to.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.