These are chat archives for ceylon/ceylon-ide-eclipse

19th
May 2016
Bastien Jansen
@bjansen
May 19 2016 09:29
I just pushed two huge commits on ide-common and ide-eclipse, related to the removal of DocumentChanges
i.e. I have tested my changes but I still expect a few minor regressions :)
hopefully they'll be easy to fix
now I have to adapt a bunch of things in ide-intellij :(
Gavin King
@gavinking
May 19 2016 11:34
@bjansen yt?
Bastien Jansen
@bjansen
May 19 2016 11:35
yeah
did I break things? :)
Gavin King
@gavinking
May 19 2016 11:37
i have not yet noticed
wanted to mention a couple of things
did you see my new API for collecting/adding imports?
Bastien Jansen
@bjansen
May 19 2016 11:38
yeah, I used it in a few places
Gavin King
@gavinking
May 19 2016 11:38
good
Bastien Jansen
@bjansen
May 19 2016 11:38
but it's not delegating anymore
Gavin King
@gavinking
May 19 2016 11:38
ah much better
Bastien Jansen
@bjansen
May 19 2016 11:38
importProposals became an object
Gavin King
@gavinking
May 19 2016 11:39
that’s what I wanted to say
ok, perfect
this was exactly what i was going to mention
ok, so next thing:
Bastien Jansen
@bjansen
May 19 2016 11:39
so you can either use importProposals all the time, or use CommonImportProposals to do multiple consecutive operations on the same document
Gavin King
@gavinking
May 19 2016 11:39
perfect — exactly what I hoped
we need a much better way to abstract Proposals
I wound up sticking some crappy formal methods on QuickFixData
but that’s no good
Bastien Jansen
@bjansen
May 19 2016 11:40
yes, I saw that, and I added more of these methods, but I don't think they are in the right place
Gavin King
@gavinking
May 19 2016 11:41
no, definitely not
we need to think about that much more
perhaps there is some way to move almost all the functionality into common
instead of having the abstractness
or perhaps not; I’m not sure
but we need something better
Bastien Jansen
@bjansen
May 19 2016 11:42
well, all proposals are always a description, a text change, an icon and possibly a callback, so maybe we should create an abstraction for that, and then make the IDEs use that object to make the "visual" proposal
Gavin King
@gavinking
May 19 2016 11:42
well the thing is sometimes thery are more:
  • a linked mode
  • an accelerator key
and it’s the stuff about the linked mode that is currently the sticking point
Bastien Jansen
@bjansen
May 19 2016 11:43
the accelerator key is part of the view imo
Gavin King
@gavinking
May 19 2016 11:44
well ok, fine, but currently there is just one Proposal object
the accelerator key forms part of the proposal label in the Eclipse IDE
Bastien Jansen
@bjansen
May 19 2016 11:44
I was thinking, maybe we could move the linked mode stuff to platformServices, i.e. add a function like callLinkedMode(document, positions)
Gavin King
@gavinking
May 19 2016 11:44
that sounds pretty good to me
Bastien Jansen
@bjansen
May 19 2016 11:44
so we don't have to inherit a LinkedMode object
Gavin King
@gavinking
May 19 2016 11:45
the sticking point might be that there is some use of inheritance within linked modes
Bastien Jansen
@bjansen
May 19 2016 11:45
and if the IDE doesn't support linked modes, it just leave the function empty
Gavin King
@gavinking
May 19 2016 11:45
but perhaps that is not a huge pronlem
Bastien Jansen
@bjansen
May 19 2016 11:46
I'll have a look this afternoon or tomorrow I think
Gavin King
@gavinking
May 19 2016 11:46
great, thanks
Bastien Jansen
@bjansen
May 19 2016 11:47
are you planning to work a little during your vacation?
Gavin King
@gavinking
May 19 2016 11:50
nope :)
Bastien Jansen
@bjansen
May 19 2016 11:55
good ;)
Gavin King
@gavinking
May 19 2016 11:56
@bjansen can’t build
     [exec] /Users/gavin/ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/source/com/redhat/ceylon/eclipse/core/vfs/eclipseVFS.ceylon:41: error: Ceylon backend error: IFolderVirtualFile is not abstract and does not override abstract method getChildren() in BaseResourceVirtualFile
     [exec] shared class IFolderVirtualFile
     [exec] ^
Bastien Jansen
@bjansen
May 19 2016 11:57
I didn't touch that part, so maybe ide-common needs to be built or something like that?
Gavin King
@gavinking
May 19 2016 12:00
this was with ant clean-all dist sdk eclipse
Bastien Jansen
@bjansen
May 19 2016 12:06
wait actually I have the same error
but nothing in the IDE
and
     [exec] /Users/bastien/Dev/ceylon/ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/source/com/redhat/ceylon/eclipse/core/vfs/eclipseVFS.ceylon:58: error: type of member must be assignable to type of refined member 'children' in 'ResourceVirtualFile': type cannot be determined
     [exec]     shared actual JList<out ResourceVirtualFile<IProject,IResource, IFolder, IFile>> children {
     [exec]                   ^
so it looks like the JDT model loader can handle it, but not the CLI
Gavin King
@gavinking
May 19 2016 12:09
could be. there are still a number of diffs
Bastien Jansen
@bjansen
May 19 2016 12:10
but Jenkins was able to build that last night, so I'm not sure what's happening
Bastien Jansen
@bjansen
May 19 2016 15:53
@gavinking while trying to remove the Indents interface, I moved indentWithSpaces and indentSpaces from CommonDocument to PlatformServices, because those settings are not really per-document, and sometimes the eclipse plugin will try to access them outside of a document
Bastien Jansen
@bjansen
May 19 2016 16:23
ok, so Indents is gone as well
Gavin King
@gavinking
May 19 2016 16:28
@bjansen that’s not true
oh wait, ok, i see
intends isn’t per-document, that’s true
line delimiter is
fine
Bastien Jansen
@bjansen
May 19 2016 16:29
it's per-project, or maybe global to the IDE
yes
the line delimiter is still in CommonDocument
Gavin King
@gavinking
May 19 2016 16:29
ok, sure, np
Bastien Jansen
@bjansen
May 19 2016 16:30
I think we're finally starting to have nice abstractions in ceylon-ide-common
Gavin King
@gavinking
May 19 2016 16:30
yes
it’s a good start, I agree
Bastien Jansen
@bjansen
May 19 2016 16:30
I mean we still have 58 calls to unsafeCast, but it's way better than before
Gavin King
@gavinking
May 19 2016 16:30
we need to investigate whether some of these patterns can be extended to the refactoring stuff
I’m hopeful we can remove some of those 58 :)
Bastien Jansen
@bjansen
May 19 2016 16:31
I'm starting to think the completion manager and quick fix manager could be objects, instead of interfaces/classes that need to be extended in both IDEs
Gavin King
@gavinking
May 19 2016 16:31
i hope so
i hope they can be
Bastien Jansen
@bjansen
May 19 2016 16:31
if we manage to make a proper abstraction of proposals
Gavin King
@gavinking
May 19 2016 16:31
right
that is the sticking point
and that’s really mainly about the linked mode stuff, i believe
Bastien Jansen
@bjansen
May 19 2016 16:34
basically, the link mode is a set of positions+proposals, and a document to work on, right?
we could add an object similar to CommonDocument that contains these parameters, then delegate instead of inheriting a LinkedModeSupport
Bastien Jansen
@bjansen
May 19 2016 17:41
great, eclipseQuickFixManager currently boils down to:
object eclipseQuickFixManager
        extends IdeQuickFixManager<IDocument,ICompletionProposal,LinkedModeModel,EclipseQuickFixData>() {

    specifyTypeQuickFix => eclipseSpecifyTypeQuickFix;
    declareLocalQuickFix => eclipseDeclareLocalQuickFix;

}
which means, once we can abstract the linked mode, we won't need to subclass the manager anymore