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

Xcode9 cannot install XVim. #1074

Closed
daiki1003 opened this issue Jun 6, 2017 · 124 comments
Closed

Xcode9 cannot install XVim. #1074

daiki1003 opened this issue Jun 6, 2017 · 124 comments

Comments

@daiki1003
Copy link

I installed Xcode9 beta today and tried to install XVim.
But Xvim shows build error written above.

DVTTextSidebarViewHook.h: 11

DVTTextSidebarView.h file not found

Plz fix it.

Thx for your reading this issue.

@keith
Copy link
Contributor

keith commented Jun 6, 2017

This is unsurprising since the new source editor is said to be written from the ground up. This will likely require a decent amount of investigation since the class hierarchy that XVim is hooking in to will have changed 100%.

It would be helpful if you (or anyone else) could start looking in to this so we can understand the scope of changes that need to be made!

@jklausa
Copy link

jklausa commented Jun 6, 2017

It was said multiple time during SOTU that the Source Editor was rewritten in Swift, so there's a chance that without the runtime dynamism of Obj-C, it might not be possible to hack Xcode to run Xvim.

(or maybe i completely misunderstand the implication of the Swift rewrite; in which case disregard)

@keith
Copy link
Contributor

keith commented Jun 6, 2017

I'm assuming (but obviously haven't checked) that much of the logic will still live in classes inheriting from NSObject. Which, depending on which Swift version their using, might mean enough of it is exposed that this will work. If they're using the new @objc behavior, it might be more difficult.

@keith
Copy link
Contributor

keith commented Jun 6, 2017

If anyone wants to start looking at this, I think IDEPegasusSourceEditor.ideplugin would be a good place to start.

@JugglerShu
Copy link
Contributor

I successfully hooked keyDown method of the IDEPegususSourceEditor.SourceCodeEditorView. Unfortunately there are a lot of other changes XVim must adjust to new Xcode. I'm working on it.

@JugglerShu
Copy link
Contributor

By the way, does anyone know about the swift namespace -> objective-c internal naming convention?
Since the editor in new Xcode written in swift and uses namespace, the internal class name for IDEPegususSourceEditor.SourceCodeEditorView is something like "_TtC22IDEPegasusSourceEditor20SourceCodeEditorView".
I think 22 and 20 are the number of characters but don't know what _TtC part means. (maybe representing T..t..Class? )

This is not mandatory for XVim but if I can easily convert these names it would be helpful.

@keith
Copy link
Contributor

keith commented Jun 7, 2017

You can run xcrun swift-demangle SYMBOL to see what it translates to:

$ xcrun swift-demangle _TtC22IDEPegasusSourceEditor20SourceCodeEditorView
_TtC22IDEPegasusSourceEditor20SourceCodeEditorView ---> IDEPegasusSourceEditor.SourceCodeEditorView

Here's a rundown of the "magic" characters though: https://mikeash.com/pyblog/friday-qa-2014-08-15-swift-name-mangling.html

@JugglerShu
Copy link
Contributor

@keith Thanks!

@JugglerShu
Copy link
Contributor

JugglerShu commented Jun 13, 2017

The editor in Xcode 9.0 deosn't use NSTextView. I have to migrate some NSTextView dependent code to fit to new Xcode 9.0's class "_TtC12SourceEditor16SourceEditorView". I already confirmed that I can move cursor with hjkl so it should work but still need some amount of time.

@daiki1003
Copy link
Author

@JugglerShu Thanks a lot!
I'm so looking forward to your fixing!

@dabing1022
Copy link

I'm so so so so looking forward to your fixing! @JugglerShu

@antmd
Copy link
Contributor

antmd commented Jun 18, 2017

@JugglerShu If there's any conversion work which I can help with, let me know. I'd rather have vim key bindings instead of 'ultra smooth scrolling' in Pegasus.

@crossle
Copy link

crossle commented Jun 20, 2017

All not used to without vim on Xcode 9

@JugglerShu
Copy link
Contributor

@antmd Thanks. Yea I think there a a lot you can help but I think creating basic structure in my side and sharing it with others, approving PR would work better than explaining everything in text message.
Xcode 9's editor is completely different from the older one. So I think I have to make big change in the XVim classes. I might be misunderstanding Xcode9 classes because it seems Xcode9's debugger itself is not still complete and not showing the information correctly. I'm still in studying relationships in the editor class and other related objects.

@baek-jinoo
Copy link

Very much appreciate the work @JugglerShu. Just backed the bounty for this issue.

@spenrose
Copy link
Contributor

@dabing1022
Copy link

Hi,any progress on this?

@Tom-Le
Copy link

Tom-Le commented Jul 5, 2017

Let's be patient. I'm sure @JugglerShu will let us know when he's made more progress with studying Xcode 9's new editor. Also count me in if you need a hand.

@tim-phillips
Copy link

tim-phillips commented Jul 13, 2017

Assign us work @JugglerShu if you need the help. We're willing and able bodies and minds.

@hyouuu
Copy link

hyouuu commented Jul 14, 2017

Same here - although I'm terrible at lower level stuff, could probably help with some aspects!

@tuchangwei
Copy link

very uncomfortable without XVim. 😂

@JugglerShu
Copy link
Contributor

Sorry for waiting you long. For Xcode9 I think I have to rewrite, re-structure the XVim. Some main component (like calculating movements) can be reused but actual event handling will be rewritten.
I think the first release of XVim would be with really limited features like movements, yank, paste.

@fontno
Copy link

fontno commented Jul 17, 2017

@JugglerShu Thanks for your work and for updating us. I am more than happy and I think others would certainly agree, to just have features like movements, yank, paste. This is 90% of XVim to me anyway and 100% percent better than no XVim at all.

@mossheim
Copy link

@JugglerShu Thank you so much for all your work on this. XVim has made my life so much better the last few months!

@haaakon
Copy link

haaakon commented Aug 7, 2017

Any progress @JugglerShu ? Looks like people are eager to help if you can delegate some work? Looking forward to getting it to work on XCode 9 :)

@JugglerShu
Copy link
Contributor

Sorry for late response. Hm... I have to find a time to work on XVim more. I only have weekends to work on it now.
I would love to assign some tasks but it is still difficult task because XVim is not a simple application. The main tasks are to find out which classes/objects we should hook and which methods can be usable for Vim emulation. I hope I can make it by the release of Xcode 9 GM.

@lando2319
Copy link

lando2319 commented Aug 8, 2017 via email

@ebaker355
Copy link

I hope I can make it by the release of Xcode 9 GM

The source editor in Xcode 9 is still a moving target. Beta 5 was just released and introduces code folding, etc. I'm sure that makes assigning tasks much more difficult this early on, but should become easier as Xcode 9 stabilizes.

@michaelnew
Copy link

I wish Apple understood how important this plugin is to developers.

@daiki1003
Copy link
Author

@michaelnew
I think so too.
Or I strongly hope Apple will implement vim like editing mode.

@squarefrog
Copy link
Contributor

squarefrog commented Oct 10, 2017

@antmd Movement is really weird for me. h and l work as expected, but j jumps down 3 lines, and k goes down instead of up.

Heres a gif: http://gph.is/2y5DiQd

@cor
Copy link

cor commented Oct 10, 2017

@squarefrog I haven't tried @antmd's experiment yet, but could this have something to do with line wrapping?

@squarefrog
Copy link
Contributor

@cor could be. I just tried it again, with a single view, the whole width of my screen, so that no wrapping occurs. I've observed the same behaviour but with another nuance. When using k, the cursor goes down until it hits an empty line (I like to strip spaces), then it gets 'stuck'. It wont move any further.

@JugglerShu
Copy link
Contributor

@haaakon I think @antmd already has the full right to XVim project and repositories. Let me know if you have any problems on managing project/repos.

@antmd
Copy link
Contributor

antmd commented Oct 10, 2017

@JugglerShu thanks. I have merged back to master. I also added back some more functions (xvimrc, proper vim-like search, etc.). New issues should be raised here: https://github.com/XVimProject/XVim2/issues

@antmd
Copy link
Contributor

antmd commented Oct 10, 2017

@squarefrog please open an issue here: https://github.com/XVimProject/XVim2/issues. A screen cast would be nice for hard-to describe issues, but isn't necessary. Thanks.

@squarefrog
Copy link
Contributor

squarefrog commented Oct 10, 2017

Will do. While this is an excellent starting point, it does seem that a lot of previous functionality is either not there, or has unexpected behaviour. This isn't true - I had both XVim and XVim2 installed which unsurprisingly didn't work as intended 🤦‍♀️

It does reinforce that there would be a huge benefit to focussing on integrating NeoVim or something similar, as the behaviour would be more consistent between XVim and Vim proper.

I'm unsure of the current state-of-play with integration though, so I don't know if its still feasible.

@ShiyiZhao
Copy link

@basketwang, have you fixed the directory not found issue? I am still encountering, even after I renamed the folder :(

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks'
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Frameworks'
ld: framework not found DVTKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld build/Release/XVim2.xcplugin/Contents/MacOS/XVim2 normal x86_64

@squarefrog
Copy link
Contributor

@ShiyiZhao there are two things you can try here

  1. look at what’s set as the current Xcode using xcode-select. Look at the install readme for more information.

  2. rename your prefixed Xcode temporarily so you can sign it, then rename it back to your preferred name.

@basketwang
Copy link

@ShiyiZhao you need fix the XVim2.xcodeproj/project.pbxproj
you could search for xcode.app, which is a hard coded path. For a temporary fix, you can change it to your app name. long term, we should replace it with a variable.
Let me know if it works for you. :)

@ShiyiZhao
Copy link

Thank you @squarefrog and @basketwang! I changed my app name to Xcode.app, updated the xcode-select and also fixed a silly bug(where I have two Applications folder, and I put it in the wrong one initially, lol). And now it works! Cheers~

@hyouuu
Copy link

hyouuu commented Oct 11, 2017

This is awesome - thanks so much @antmd and every contributors!!

@zyqhi
Copy link

zyqhi commented Oct 11, 2017

XVim is the only Xcode plugin indispensable for me. Thank you @antmd and @JugglerSh, thank you for your work.

@antmd
Copy link
Contributor

antmd commented Oct 11, 2017

I haven't had any show-stopper issues raised on XVim2, so I'm closing this issue now. Please move further feature requests and discussion to XVim2. See you there!

@antmd antmd closed this as completed Oct 11, 2017
@zoltanbognar
Copy link

Hi
I know that this is closed but
I trying to install xvim2 but it doesn't compile
ld: /Applications/Xcode 9.app/Contents/PlugIns/IDEPegasusSourceEditor.ideplugin/Contents/MacOS/IDEPegasusSourceEditor compiled with newer version of Swift language (4.0) than previous files (3.0) file '/Applications/Xcode 9.app/Contents/PlugIns/IDEPegasusSourceEditor.ideplugin/Contents/MacOS/IDEPegasusSourceEditor' for architecture x86_64

Thanks

Zoltan

@thesoundhead
Copy link

Thank you, I highly appreciate your fast work! This makes the hassle with Xcode 9 at least somewhat comfortable.

@antmd
Copy link
Contributor

antmd commented Oct 11, 2017

@zoltanbognar
It looks like the need to link to Xcode's libraries at compile time is complicating things.
I've created a branch called 'nolink' in XVim2. This version does not need to link with Xcode libraries at compile time. You can try checking out that branch and see if it works.

@baek-jinoo
Copy link

baek-jinoo commented Oct 11, 2017

I've tried using the nolink branch, but I'm still getting an error when doing make:

The following build commands failed:
	Ld build/Release/XVim2.xcplugin/Contents/MacOS/XVim2 normal x86_64
	GenerateDSYMFile build/Release/XVim2.xcplugin.dSYM build/Release/XVim2.xcplugin/Contents/MacOS/XVim2
(2 failures)
make: *** [release] Error 65

@dylanhand
Copy link

dylanhand commented Oct 12, 2017 via email

@zoltanbognar
Copy link

Big Thank You - nolink branch is working now for me - I love it - thank You thank You - now I can swithc to xcode 9

@baek-jinoo
Copy link

It didn't work for me because I changed the name of Xcode.app to Xcode_9.app in the /Applications folder. It works now that I changed it back to Xcode.app and did make. Thanks for the great work!!

@ghost
Copy link

ghost commented Oct 13, 2017

I'm exciting.
XVim2 work for me.
Not only h j k l move, Yank, Put, Delete, Visual mode and more, works perfectly. Very very thank you🎉

@nafu
Copy link

nafu commented Oct 16, 2017

XVim2 works 🎉
Thanks @antmd @JugglerShu 💚

@dabing1022
Copy link

Cheers!

@DrewKiino
Copy link

thank you @antmd @JugglerShu doing god's work over here. I couldn't switch over to xcode 9 even if my work forced me to do it lmao. ended up having to code in xcode 8 then submitted with xcode 9 as a work around.

@lando2319
Copy link

I'm up and running on XVim, incredible. Thanks to everyone who contributed code and bounty source money to make this happen.

Great to see there are others who are as committed as I am to the Vim Experience.

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

No branches or pull requests