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 query expression for word-boundary and use it in symbols and project-symbols #170

Merged
merged 1 commit into from
Mar 9, 2017

Conversation

t9md
Copy link
Owner

@t9md t9md commented Mar 9, 2017

Fix #169
Related #50

What will change

Add query expression which specify word-boundary(\b) search.

Here is how query translated

  # Translate
  # - ">word<" to "\bword\b"
  # - ">word" to "\bword"
  # - "word<" to "word\b"
  if /^>./.test(pattern)

If \b is meaningless(e.g. >=), it don't add \b, but remove > or < for consistency.

NOTE: I also evaluated not-trim starting > so that user don't need to search by >>= for search >= literal.
But it was not obvious when > is removed or not removed, which make user learning difficult, so avoided this approach.

Auto enable word boundary query when symbols and project-symbols invoked by by-current-word command

Purpose: To make quick previewing by symbols-by-current-word or project-symbols-by-current-word further useful.

Before: Problematic situation

  1. Place cursor on @refresh function and invoke
  2. narrow:symbols-by-current-word: Previewing unwanted function(multiple symbols which contains refresh)
  3. narrow:project-symbols-by-current-word: Previewing unwanted function(multiple symbols which contains refresh)

atom-narrow-symbols-boundary-query-before

After: Find target thanks to >refresh< query.

  1. Place cursor on @refresh function and invoke
  2. narrow:symbols-by-current-word: Previewing single preview function.
  3. narrow:project-symbols-by-current-word: Previewing single preview function.

atom-narrow-symbols-boundary-query-after

… use >word< query on by-current-word invocation
@t9md t9md merged commit a8d901a into master Mar 9, 2017
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.

None yet

1 participant