Code Assist Cont...

297 views
Skip to first unread message

Seth Berman

unread,
May 31, 2011, 5:47:24 PM5/31/11
to va-sma...@googlegroups.com
Hi everyone,

Code Assist support for Vast is moving forward.  The design document is publicly available at https://inst.fogbugz.com/default.asp?W493.
A new map (VA Code Assist) has been uploaded to VAStGoodies, which is a tweaked version of the latest map that was available in the (now deprecated) StsBrowsersWin w/Code Completion map.
The items in the deprecated map not related to code assist are being worked separately.

The original discussion thread on Code Assist in Vast can still be viewed at http://forums.instantiations.com/viewtopic.php?f=12&t=6223.

Please feel free to provide comments and suggestions.

-- Seth Berman (sbe...@instantiations.com)

marten

unread,
Jun 1, 2011, 1:50:15 AM6/1/11
to va-sma...@googlegroups.com
Looks promising ...

Seth Berman

unread,
Jun 22, 2011, 5:01:16 PM6/22/11
to va-sma...@googlegroups.com
A snapshot of the code assist development branch (VA Code Assist V 8.0.3 [162] - DEV 1.0) has been pushed up to VAStGoodies.
It contains a general purpose content assistance framework that, at least as far as I know right now, is cross-platform.
The Sts Code Assist module which is built on top of the framework is in progress, and not yet included in this this map.
However, included is an examples app utilizing the framework, which contains a simple text editor that can "suggest" previously seen words as you type.
I am planning to have a new map which will include code assist in about a week.
Config map notes have been updated with some known issues and how to debug.

Feedback welcome, of course.

-- Seth Berman

Seth Berman

unread,
Jun 28, 2011, 7:48:08 PM6/28/11
to va-sma...@googlegroups.com
Hi everyone,

I have provided another update to the VA Code Assist map in VaSTGoodies that includes some code assist features for the browsers.  Currently, method completions are available for types that can be determined by examining the parse tree.  Please see the examples provided in the design document: https://inst.fogbugz.com/default.asp?W493 under the "Phase 1 Checkpoint" heading if you are interested in this.  Please let me know if you have any additional suggestions or guidance, I would be glad to hear them.  Class, Vars and uninferred type method completions will be available soon...I also will be getting a GUI up in the next couple of weeks.  Stay tuned.

Seth Berman

Seth Berman

unread,
Jun 29, 2011, 7:43:30 PM6/29/11
to va-sma...@googlegroups.com
Another code assist update available at VaSTGoodies.
This update adds completions for locals, instVars, classVars and classInstVars.
Case-insensitive filtering is also supported so you don't have to match the case of the suggestions in the popup.
This map is VA Code Assist - V 8.0.3 [162] - DEV 1.2

Seth Berman

unread,
Jul 5, 2011, 8:10:13 PM7/5/11
to va-sma...@googlegroups.com
VA Code Assist - V 8.0.3 [162] - DEV 1.6 is now available at VaSTGoodies.
I'm in process on updating the design document (which has a linked that is referenced at the top of this post), it has some more specific information and examples to try.

Changelog since previous post: (DEV 1.2)
  • Pseudo-var completion (self, super, true, false, nil)
  • Scoped-var completion (i.e. CwConstants::<Ctrl-Space>)
  • Auto-Argument injection into completions with same name as current method context.  Useful for super calls or delegation
  • Added Code Assistance to StsDebugger - uses runtime information to resolve receivers of message sends
  • Added Code Assistance to StsWorkspace - uses cached workspace variables (that have been evaluated) to resolve receivers of message sends
What's left (well, that is feasible for this phase)
  • Class/Pool Completion
  • (Unresolved) Method Completion - Method completions to use when the static analysis can not identify the receiver as anything more specific that "Object"
  • Visibility settings (i.e. only show methods in application prereq chain or everything)
  • GUI  (To tweak settings for now - change [StsCodeAssistConfiguration browser], [StsCodeAssistConfiguration debugger] and [StsCodeAssistConfiguration workspace])
  • Must fix CwObjectList popup impl on Linux...the EwTableList enhanced widget seems to be working just fine
What I would like to complete, but may not get to:
  • Light type inference for cascaded messages.  Using the previous cascaded messages, the type can continue to be narrowed
  • Method chain following - It's fairly easy to detect if a method has one statement that returns a bounded variable like a literal or class, not sure how many levels to traverse...maybe an advanced setting
  • In Method completion popup, somehow show the object class that defines a particular method suggestion.
  • Row of buttons on the popup that allow for in-place tweaking of filters and visibility settings.  The list would dynamically refresh as the settings are adjusted

If you find any bugs or have a request...please feel free to respond.  Enjoy

Seth Berman

unread,
Jul 27, 2011, 11:28:09 PM7/27/11
to va-sma...@googlegroups.com
VA Code Assist - V 8.0.3 [162] - DEV 2.0 is now available at VaSTGoodies.
I have listed out many of the new features in the config map notes.

If anyone would like to help test, please have at it:)

jtu...@objektfabrik.de

unread,
Jul 28, 2011, 7:32:58 AM7/28/11
to va-sma...@googlegroups.com
Seth,

I haven't looked at Code Assist for quite a while and I must say I am impressed!
It's come a long way and is very good in suggesting names.

I currently cannot think of any more things to suggest, but I am just using it for a few hours now. Maybe I'll come back with ideas later.

Now that this is on its way, it's probably time for more ideas to improve the code editing experience (before you get bored ;-) ).

There are a few things that could be done for unknown symbols on method save:

I miss the suggestion to add unknown symbols as temporary variables or correct their spelling when a method is saved.
And the same thing may be a good idea for symbols with capital letters:
I may want to add a new class to the system or correct the misspelled class name.
But the missing symbol could also mean I need to add a pool dictionary to the class definition if the symbal can be found in a pool.

Based on this you could do a lot of nice things like adding a Symbol to a pool dictionary and piossibly even extend its definig pragma method (if one exists)...


Just a few thoughts to get you going.
I see the code editing experience improve a lot in upcoming VAST releases - thanks for the good work!

Joachim

Seth Berman

unread,
Jul 28, 2011, 10:07:18 AM7/28/11
to va-sma...@googlegroups.com
Hi Joachim,

Thanks for your inputs, glad it's proving to be useful.  I stare at this stuff everyday so all I ever see are it's flaws:)
Yeah, I've really tried to incorporate all the ideas you guys had in the old forum post.  I think what is there now is a good starting point, and as you pointed out, there is lots of room to improve the experience.

I agree with the additional features you were describing above.  Early on, I was trying to keep the door open for this kind of code intelligence.  This is for a future phase, but how do you feel about a "hint" system, very similar to a Netbeans or Eclipse approach, that would provide a hints icon on the side of a given line (presumably where the breakpoint icon shows up).  Pressing the "hint" icon would display a list of one or more actions, for something on that line, to invoke some of these longer running tasks (i.e. Add new temporary, correct spelling, create class, make pool dictionary entry)?

When I update the design doc, I'll add your suggestions to the future phase section.  Thanks again.

Seth

jtu...@objektfabrik.de

unread,
Jul 28, 2011, 2:14:43 PM7/28/11
to va-sma...@googlegroups.com
Seth,

a hint system for the more advanced stuff like creating a new class and such sounds good. And using the little column to the left (wher breakpoits show up) for other things as well is also a good idea.

But adding temps should be a no brainer for the user: prompt me and do it. The prompt should collect all tempvar candidates and let me choose to add a temp or collect spelling alternatives (the latter may take time...).
Maybe you have an installation of VW around, or Ernest Micklei's goodie that does exactly the add temp var part. It's convenient and fast!

I found an arzable flaw today: say you've typed the word "Objects' and move the cursor back between b and j and type another j, the tool offers correct suggestions. If you accept one, it will simply insert it and not replace the whole word ("ects" in this example). So the result will be "Objectects". I know there are arguments that the tool cannot kbow if I wanted to type more afterwards, so maybe it's not a bug... what do you think?

Joachim

Seth Berman

unread,
Jul 28, 2011, 2:44:07 PM7/28/11
to va-sma...@googlegroups.com
Joachim,

Good idea about the temps...I will take a look at VW and the goodie you suggested.

I agree about the 'Objects' use case...I tried it a few times and couldn't really think of any reason why I wouldn't want it to replace the part after the cursor.  As you were suggesting, applying method suggestions would be the only thing that would be difficult.  But this is a fairly simple change for the other completion types.  I will look into this.  

Currently, I'm working to slap a GUI on the configuration options.  I don't believe I mentioned this before, but I've shuffled some stuff around and now the configuration object can be retrieved by inspecting 'StsCodeAssist configuration'.

Also, if need be, set StsCodeAssist debug: true if you need to debug anything.  Otherwise, when the debugger is brought up, the text editor loses focus which forces the code assist session to close and that's the end of that:)

Appreciate the feedback.

Seth

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/tn_nC_CO75cJ.

To post to this group, send email to va-sma...@googlegroups.com.
To unsubscribe from this group, send email to va-smalltalk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.



--
-----------------------------------------------------
Seth Berman
Software Engineer, Instantiations Inc.
sbe...@instantiations.com



jtu...@objektfabrik.de

unread,
Jul 29, 2011, 4:49:53 AM7/29/11
to va-sma...@googlegroups.com
Hi Seth,

I found another bug(?). In case of symbols, I alwaays get the same symbol in the suggestion list twice...


>Currently, I'm working to slap a GUI on the configuration options.

I am surprised: Isn't Instantiations working on a settings framework? Why not be among the first to use it?

Joachim

jtu...@objektfabrik.de

unread,
Jul 29, 2011, 8:59:18 AM7/29/11
to va-sma...@googlegroups.com
Hi again,

the doubling happens also with method names (implementors), but I cannot tell under which circiumstances. It's not always, just from time to time. I've never seen more than two copies of the same entry, but I've seen double entries when there was only one suggestion, but also when there were multiple hits. As far as I can tell, not all of them were doubled when it happens.

When they were doubled, they always had the same icon (so not a getter and an instvar name or such).

Joachim

Seth Berman

unread,
Jul 29, 2011, 10:30:08 AM7/29/11
to va-sma...@googlegroups.com
Hi Joachim,

I'm looking for those cases.  So the symbol suggestions always have double entries?
I see a double entry in the following case:
3 + 2 +<CA>
One '+' is for the inner most receiver '2' and should just have a public method icon
One '+' for the outer receiver expression '3 + 2' and should have a public method icon preceded by a left arrow icon.
The distinction is for inserting parens.

If your seeing the 'implementors' icon with no common superclass on the far right, then these are for receivers who's types are unresolved.
If your seeing the 'implementors' icon with '(Object?)' on the far right, then these are for receivers who are resolved to some set of types, but their common superclass is Object.

So I think your referring to double entries listed for unresolved receivers?  I haven't noticed that in any of the cases I've tried so far, but I will be on the lookout.  Thanks for the find, let me know if you detect a pattern or find an example.

-Seth
 

jtu...@objektfabrik.de

unread,
Aug 2, 2011, 6:43:03 AM8/2/11
to va-sma...@googlegroups.com
Hi Seth,

the answer is much more "stupid" ;-)

Most of the time when I see double names, the second one is cut off before the last charecter. So the second one is the setter, but displayed without the colon. The insertion is correct, though.

Also: when I type "IfTrue:", the suggestion list is okay: ifTrue:,  ifFalse: etc.
But if I type  "ifTrue:" there is only one suggestion: "ifTrue:ifFalse" - note the missing colon at the end. When I insert, it inserts correctly.

Joachim

Seth Berman

unread,
Aug 3, 2011, 8:02:28 AM8/3/11
to va-sma...@googlegroups.com
Thanks Joachim,

I was able to reproduce the "suggestion truncation" you pointed out on the Linux side, so I'll take a look and fix that issue.

--Seth

Seth Berman

unread,
Aug 3, 2011, 2:28:42 PM8/3/11
to va-sma...@googlegroups.com
I have updated the Code Assist Design Document: https://inst.fogbugz.com/default.asp?W493.
Under the section (8/3/2011) Phase 1 Checkpoint, I have provided a complete summary of all the features that can be expected when this goes into the next release.

I have not backported the Configuration GUI and some other tweaks (thanks Joachim) to 8.0.3 yet for VastGoodies, but if I get time I will.
I've readjusted the items in the phases since I completed more than I thought I would.  If you have specific things you would like to see, please let me know.

--Seth

jtu...@objektfabrik.de

unread,
Aug 5, 2011, 5:02:14 AM8/5/11
to va-sma...@googlegroups.com
Seth,

some tiny problem: pressing Ctrl+S to save a method or Ctrl+R to revert leaves the suggestion list open. A Key press that's not a Character which ends up in the editing pane should close the suggestion list. Again, maybe a question of taste, but I found it to be "surprising behaviour".

I must admit I still don't understand the meaning of most icons (Yellow Arrow to the left and green connected balls that I think mean "implementor of"), but since these are consistent with the icons that are used in the whole environemt, this is more a critique on VAST's icon set rather than Code Assist.

Joachim

jtu...@objektfabrik.de

unread,
Aug 11, 2011, 7:33:31 AM8/11/11
to va-sma...@googlegroups.com
Seth,

since I am sure you are still looking for ideas to improve Code Assist even further... ;-)

What about supporting wildcards? I may remember that the method I want to call is somewhat ending in 'On:', so why not type '*On:' and wait for Code Assist to come up with suggestions? I guess this is not so much a performance problem, because it would not necessarily affect the normal operation. If I enter a wildcard, I agree to wait a bit longer, and if I don't I want you to be fast ;-) This could and maybe should even go so far as to support wildcards in the middle of an expression. Like 'print*On:'.

I don't think there is a need for several wildcards (0 or 1 letters, 1 or more etc.), a simple 0..n wildcard like * would suffice.

I haven't checked with your design document if it's on the list already. If so, I apologize ;-)

Joachim

Seth Berman

unread,
Aug 11, 2011, 9:26:18 AM8/11/11
to va-sma...@googlegroups.com
Hi Joachim,

I think the regex support is a great idea...it brings something unique to the table and I don't think it would be to difficult to implement.  I will add this to the list for Phase 2.
Thank you for pointing out the Ctrl+S, Ctrl+R issue.  Fixing that is not a big deal, I've just been looking for the appropriate place to put that logic.
Given that, in the case of Ctrl+R, the popup may be out of sync with the text, I will probably consider this a bug and fix it for this upcoming release.

--Seth

jtu...@objektfabrik.de

unread,
Aug 12, 2011, 8:29:08 AM8/12/11
to va-sma...@googlegroups.com
Hi Seth,

now that you came up with the term Regex (I was just talking about a simple * wildcard) ;-)

The old VBRegex goodie that is also available for VAST on VASTGoodies only supports Regex 1.1, which means that quantifiers like {1,5} don't work.

To me it seems like a bad thing that in a world where almost any language supports regex out of the box (I am thinking of JavaScript, Java, Ruby, Perl) there is no decent support for regular expressions in Smalltalk... At least VAST is no worse than the rest of the gang, because Vassily's goodie is used in all dialects, based on the last 1999 version.

But coming back to Code Assist: I am not sure a full blown regex support would be needed. I guess nobody will really ask for methods or classes by a pattern like [A-D|XY]*\d  ;-)))

Joachim

Seth Berman

unread,
Aug 12, 2011, 9:01:41 AM8/12/11
to va-sma...@googlegroups.com
Joachim,

Agreed, in my mind I always translate '*' to ("anything", "whatever", 'I don't care").  I think anything more specific like "show me methods that begin with 'a' following by a 3 letters or 2 digits followed by....." would just be superfluous for this use case.
And as you pointed out....a lot more work..:)

Seth

Marten Feldtmann

unread,
Aug 12, 2011, 1:13:35 PM8/12/11
to va-sma...@googlegroups.com
Hmm, actually if someone is willing to try out external libraries there are at least two up-to-date solutions available:

1) Binding for the simple code page oriented regular expressions via TRE library, documented here
2) Binding for UTF-8 oriented regular expression via ICU library


Reply all
Reply to author
Forward
0 new messages