SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

syntax definition scope name completions can be annoying #140

Closed keith-hall closed 7 years ago

keith-hall commented 7 years ago

When writing a syntax definition, PackageDev currently shows completions for scopes, based on the scope naming conventions. This is great, but sometimes it adds a . and shows suggestions when it shouldn't (IMO):

  1. When entering the last scope atom of the syntax definition i.e. for the Markdown syntax, with a base scope of text.html.markdown, when writing a scope like entity.name. and selecting markdown, I would expect to see no further dots added or autocompletion popups shown. The current behavior is to have a trailing dot and see markdown in the list again.
  2. When altering an atom in a scope that has already been completed, say changing punctuation.definition.string.begin to punctuation.section.string.begin. I double click definition, and start typing s, PD shows a popup for section - great! But I press Tab to select it and I end up with punctuation.section..string.begin (notice the two dots). Ofc, it's pretty trivial to delete the additional dot, just wondering if others agree whether it would be a good idea to remove this behavior in this circumstance.
r-stein commented 7 years ago
  1. My version (current master branch) behaves like this if I select the "base suffix" entry
  2. I agree that it should omit the trailing dot if it is already present
FichteFoll commented 7 years ago
  1. This shouldn't be happening as I specifically added a check for that, but I'll check again. Edit: can confirm and know why.
  2. This can be fixed.