Add intention to expand wildcard in select statement into column names#822
Merged
AlecKazakova merged 1 commit intomasterfrom May 3, 2018
Merged
Add intention to expand wildcard in select statement into column names#822AlecKazakova merged 1 commit intomasterfrom
AlecKazakova merged 1 commit intomasterfrom
Conversation
AlecKazakova
approved these changes
May 2, 2018
|
|
||
| override fun getText() = INTENTION_EXPAND_COLUMN_NAMES_TEXT | ||
|
|
||
| override fun isAvailable(project: Project, editor: Editor?, psiFile: PsiFile?) = true |
Collaborator
There was a problem hiding this comment.
psiFile is SqlDelightFile probably so we can be typesafe below
|
|
||
| override fun invoke(project: Project, editor: Editor, psiFile: PsiFile) { | ||
| ApplicationManager.getApplication().invokeLater { | ||
| expandWildcard(project, editor, psiFile.virtualFile) |
Collaborator
There was a problem hiding this comment.
pass psiFile as SqlDelightFile here instead of the virtualfile.
| object : WriteCommandAction.Simple<Project>(project) { | ||
| override fun run() { | ||
| val file = PsiManager.getInstance(project).findFile(virtualFile) as SqlDelightFile | ||
| val selectStatement = findStatementAtCaret(editor, file.findChildrenOfType()) |
Collaborator
There was a problem hiding this comment.
this can be
val selectStatement = PsiTreeUtil.findElementOfClassAtOffset(file, offset, SqliteSelectStmt::class.java, false)
which could probably be wrapped into a nice extension function on PsiFile
Collaborator
|
Closes #812 |
b0a62ee to
933ab4a
Compare
Contributor
Author
|
@AlecStrong PTAL |
Collaborator
|
hell yea awesome |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #812