-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Dart support for trailing commas after named args (WIP). #520
Conversation
I see that similar options for other languages are in the Smart Keys page (where you've already added Are you saying it doesn't work yet? No guarantees that P.S. Please rebase on master. P.P.S. Do you have more background than mentioned in flutter/flutter-intellij#551? It is marked as a blocker there, but without knowing the background it looks just like a minor questionable feature, which has not been asked for years and has not been implemented in other similar languages. It's about typing a comma... how can it be blocking anything ;-)? |
Thanks for the feedback. cc @mit-mit for background and justification for the blocker tag. As for where options should live, I'll migrate. (Aside: the fact that I forgot where the other options were is either testament to my spaciness or the fact that it's not obvious where these things should go! 😉 ) Why would Any thoughts about getting resolution working in the tests? |
I'm no answering yet, I'm asking :). I didn't dig into the code yet. So it it suitable? ;)
In |
Well, I thought so and assumed the code was vetted since it was in the plugin.
Right but the issue is not in what I get from the server, it's in the PSI model. Specifically,
returning Maybe this speaks to the unsuitability of the method? Since I don't know my way around the PSI element model, I could use some guidance on that... |
# Conflicts: # Dart/src/com/jetbrains/lang/dart/ide/completion/DartServerCompletionContributor.java
You may see PSI using 'View PSI Structure' action. And get general PSI tree idea looking in |
Thanks! That plugin was really useful (and the reason I got this far! 👍 ) |
I'll be able to help tomorrow if anything remains not clear. Feel free to prepare questions. |
And still curious about the rationale :). |
<properties/> | ||
<border type="etched" title="Auto-insert trailing commas"/> | ||
<children> | ||
<component id="da9d2" class="javax.swing.JCheckBox" binding="myInsertTrailingCommasInConsCheckBox"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this file touched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops. Forgot to revert. Will fix.
@@ -55,6 +57,7 @@ public String getHelpTopic() { | |||
|
|||
public void reset(CodeStyleSettings settings) { | |||
myInsertOverrideAnnotationCheckBox.setSelected(settings.INSERT_OVERRIDE_ANNOTATION); | |||
myInsertTrailingCommasInConsCheckBox.setSelected(DartCodeInsightSettings.getInstance().TRAILING_COMMAS_AFTER_CONS_ARGS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here!
@@ -9,6 +9,7 @@ | |||
import org.jetbrains.annotations.NotNull; | |||
|
|||
public class DartCodeStyleSettingsProvider extends CodeStyleSettingsProvider { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this empty line finally appears to be the only change in this file :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix.
Hey @alexander-doroshko. Sorry for the noise. I only partly backed out my changes when I moved to a smart key preference. Should be a little tidier now. 👍 |
Closing in favor of pushing into server as per conversation in flutter/flutter-intellij#551. |
Adds:
support for trailing commas after named args in constructors (see: Completions on named arguments should include trailing comma flutter/flutter-intellij#551)
control via a new Dart code generation preference
Besides wordsmithing, the test needs work as this bit in
DartServerCompletionContributor
yields
null
(whereas in practice it does not). Do I need to provoke a resolve?@alexander-doroshko