hugopl / rubycreator Goto Github PK
View Code? Open in Web Editor NEWPlugins to add Ruby language support to QtCreator IDE.
Home Page: http://hugopl.github.io/RubyCreator/
License: GNU Lesser General Public License v3.0
Plugins to add Ruby language support to QtCreator IDE.
Home Page: http://hugopl.github.io/RubyCreator/
License: GNU Lesser General Public License v3.0
Auto folding comments if they start at first line.
Nice to do this because most of those comments are license headers meant to annoy the developer.
Have a look at https://www.qt.io/blog/building-qt-creator-plugins-with-github-actions where I described how you can use GitHub Actions to build a Qt Creator plugin for Linux, mac, and Windows.
So it doesn't consume CPU while doing other tasks like running tests.
Code indent is buggy, try it and see.
Code navigation should display a combobox when multiple entries was found. Like QtC does when you press F2 on a virtual funcion call with more than one implementation.
Add support for file renames.
Missing a HighlightFactory to get syntax highlight on diff view.
Version 4.5 introduced line annotations, which is a very useful feature. It would be nice to have rubocop warnings appear as annotations.
Do you support Rubinius?
Many times you want to open a file but it's not in the project because it's a txt, a js, etc... better to add All files and let CodeModel decide if the file will be parsed or not.
I am getting following error
#include <texteditor/snippets/isnippetprovider.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:1178: .obj/release-shared/RubyCodeStylePreferencesFactory.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../editor/../RubyPlugin.h:5,
from ../editor/RubyEditorDocument.cpp:3:
../editor/../editor/RubyQuickFixAssistProvider.h:4:10: fatal error: texteditor/codeassist/quickfixassistprovider.h: No such file or directory
#include <texteditor/codeassist/quickfixassistprovider.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:1246: .obj/release-shared/RubyEditorDocument.o] Error 1
In file included from ../RubyPlugin.h:5,
from ../RubyPlugin.cpp:1:
../editor/RubyQuickFixAssistProvider.h:4:10: fatal error: texteditor/codeassist/quickfixassistprovider.h: No such file or directory
#include <texteditor/codeassist/quickfixassistprovider.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:1109: .obj/release-shared/RubyPlugin.o] Error 1
In file included from ../editor/RubyCompletionAssist.cpp:1:
../editor/RubyCompletionAssist.h:19:10: error: ‘bool Ruby::CompletionAssistProvider::supportsEditor(Core::Id) const’ marked ‘override’, but does not override
bool supportsEditor(Core::Id editorId) const override;
^~~~~~~~~~~~~~
In file included from ../editor/RubyAmbiguousMethodAssistProvider.cpp:1:
../editor/RubyAmbiguousMethodAssistProvider.h:16:10: error: ‘bool Ruby::AmbigousMethodAssistProvider::supportsEditor(Core::Id) const’ marked ‘override’, but does not override
bool supportsEditor(Core::Id editorId) const override;
^~~~~~~~~~~~~~
In file included from ../editor/RubyAutoCompleter.cpp:1:
../editor/RubyAutoCompleter.h:22:9: error: ‘int Ruby::AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor&, const TextEditor::TabSettings&)’ marked ‘override’, but does not override
int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, const TextEditor::TabSettings &tabSettings) override;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../editor/RubyEditorFactory.cpp:1:
../editor/RubyAutoCompleter.h:22:9: error: ‘int Ruby::AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor&, const TextEditor::TabSettings&)’ marked ‘override’, but does not override
int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, const TextEditor::TabSettings &tabSettings) override;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../editor/RubyEditorFactory.cpp:2:
../editor/RubyCompletionAssist.h:19:10: error: ‘bool Ruby::CompletionAssistProvider::supportsEditor(Core::Id) const’ marked ‘override’, but does not override
bool supportsEditor(Core::Id editorId) const override;
^~~~~~~~~~~~~~
In file included from ../editor/RubyEditorFactory.cpp:3:
../editor/RubyEditorDocument.h:13:17: error: ‘QuickFixAssistProvider’ in namespace ‘TextEditor’ does not name a type
TextEditor::QuickFixAssistProvider *quickFixAssistProvider() const override;
^~~~~~~~~~~~~~~~~~~~~~
../editor/RubyEditorDocument.h:13:5: note: suggested alternative: ‘IAssistProvider’
TextEditor::QuickFixAssistProvider *quickFixAssistProvider() const override;
^~~~~~~~~~
IAssistProvider
make: *** [Makefile:1156: .obj/release-shared/RubyAutoCompleter.o] Error 1
In file included from ../editor/RubyEditorWidget.cpp:1:
../editor/RubyEditorWidget.h:21:5: error: ‘Link’ does not name a type; did you mean ‘QLine’?
Link findLinkAt(const QTextCursor &cursor, bool, bool inNextSplit) override;
^~~~
QLine
../editor/RubyAmbiguousMethodAssistProvider.cpp:30:10: error: ‘bool Ruby::AmbigousMethodProposal::isFragile() const’ marked ‘override’, but does not override
bool isFragile() const override { return true; }
^~~~~~~~~
In file included from ../editor/RubyEditorWidget.cpp:3:
../editor/RubyAmbiguousMethodAssistProvider.h:16:10: error: ‘bool Ruby::AmbigousMethodAssistProvider::supportsEditor(Core::Id) const’ marked ‘override’, but does not override
bool supportsEditor(Core::Id editorId) const override;
^~~~~~~~~~~~~~
In file included from ../editor/RubyEditorWidget.cpp:4:
../editor/RubyAutoCompleter.h:22:9: error: ‘int Ruby::AutoCompleter::paragraphSeparatorAboutToBeInserted(QTextCursor&, const TextEditor::TabSettings&)’ marked ‘override’, but does not override
int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, const TextEditor::TabSettings &tabSettings) override;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../editor/RubyEditorFactory.cpp:11:
../editor/RubyEditorWidget.h:21:5: error: ‘Link’ does not name a type; did you mean ‘QLine’?
Link findLinkAt(const QTextCursor &cursor, bool, bool inNextSplit) override;
^~~~
QLine
../editor/RubyEditorFactory.cpp: In constructor ‘Ruby::EditorFactory::EditorFactory()’:
../editor/RubyEditorFactory.cpp:34:5: error: ‘setCommentStyle’ was not declared in this scope
setCommentStyle(Utils::CommentDefinition::HashStyle);
^~~~~~~~~~~~~~~
../editor/RubyEditorFactory.cpp:34:5: note: suggested alternative: ‘QStyleSheetStyle’
setCommentStyle(Utils::CommentDefinition::HashStyle);
^~~~~~~~~~~~~~~
QStyleSheetStyle
../editor/RubyEditorWidget.cpp:50:31: error: ‘Link’ in ‘class TextEditor::TextEditorWidget’ does not name a type
TextEditor::TextEditorWidget::Link EditorWidget::findLinkAt(const QTextCursor &cursor, bool, bool inNextSplit)
^~~~
make: *** [Makefile:1206: .obj/release-shared/RubyCompletionAssist.o] Error 1
make: *** [Makefile:1148: .obj/release-shared/RubyAmbiguousMethodAssistProvider.o] Error 1
make: *** [Makefile:1298: .obj/release-shared/RubyEditorFactory.o] Error 1
make: *** [Makefile:1348: .obj/release-shared/RubyEditorWidget.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
==> ERROR: Makepkg was unable to build rubycreator.
==> Restart building rubycreator ? [y/N]
==> ------------------------------------
==> n
I am using Arch linux with qt 5.10.1, qtcreator 4.6.1based on Qt 5.10.1 and gcc 8.1
I have already a Qt from official site (installed using official installer).
In the Terminal when I run ./configure
it fails with Sorry, can not find the QtCreator version.
message.
What is the problem?
Starting up QtCreator from some DE starts the IDE without the current environment set, so the plugin can't find rubocop if e.g. it's only installed through rvm.
Code folding doesn't fold else and elsif
If a file is excluded on .rubocop.yml file, the editor should not show ant rubocop highlighting.
A fancy WebSite is the better way to attract users.
something like:
def foo(a = {})
bar
end
Doesn't not indent right.
There's no built-in Ruby code style, it's annoying to configure it often.
This would be achieve using the QtC generic highlighter, but it seems buggy or at least doesn't work for me (qtc 3.3) anymore.
E.g.:
foo = <<eot
hello
world
eot
Like we have on C++, when the cursor still on a identifier, highlight all occurrences on the current scope.
Syntax highlighting doesn't proper highlight "asd#{code}"
System
OS: Arch Linux x86_64
Kernel Release: 4.5.1-1-ARCH
Building from source gives the following error, after following instructions from the readme.
Output
g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=gnu++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/src -Iqt-creator-opensource-src-4.0.0/src/libs -I/home/martoko/RubyCreator/build/qt-creator-opensource-src-4.0.0/tools -Iqt-creator-opensource-src-4.0.0/src/plugins -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtConcurrent -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -I.moc/release-shared -I/usr/lib/qt/mkspecs/linux-g++ -o .obj/release-shared/RubyAmbiguousMethodAssistProvider.o ../editor/RubyAmbiguousMethodAssistProvider.cpp
../editor/RubyAmbiguousMethodAssistProvider.cpp: In constructor ‘Ruby::AmbigousMethodProposal::AmbigousMethodProposal(int, const QList<TextEditor::AssistProposalItem*>&)’:
../editor/RubyAmbiguousMethodAssistProvider.cpp:27:43: error: no matching function for call to ‘TextEditor::GenericProposal::GenericProposal(int&, const QList<TextEditor::AssistProposalItem*>&)’
: GenericProposal(cursorPos, items)
^
In file included from ../editor/RubyAmbiguousMethodAssistProvider.cpp:10:0:
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:41:5: note: candidate: TextEditor::GenericProposal::GenericProposal(int, const QList<TextEditor::AssistProposalItemInterface*>&)
GenericProposal(int cursorPos, const QList<AssistProposalItemInterface *> &items);
^
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:41:5: note: no known conversion for argument 2 from ‘const QList<TextEditor::AssistProposalItem*>’ to ‘const QList<TextEditor::AssistProposalItemInterface*>&’
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:40:5: note: candidate: TextEditor::GenericProposal::GenericProposal(int, TextEditor::GenericProposalModel*)
GenericProposal(int cursorPos, GenericProposalModel *model);
^
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:40:5: note: no known conversion for argument 2 from ‘const QList<TextEditor::AssistProposalItem*>’ to ‘TextEditor::GenericProposalModel*’
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:37:25: note: candidate: constexpr TextEditor::GenericProposal::GenericProposal(const TextEditor::GenericProposal&)
class TEXTEDITOR_EXPORT GenericProposal : public IAssistProposal
^
qt-creator-opensource-src-4.0.0/src/plugins/texteditor/codeassist/genericproposal.h:37:25: note: candidate expects 1 argument, 2 provided
../editor/RubyAmbiguousMethodAssistProvider.cpp: At global scope:
../editor/RubyAmbiguousMethodAssistProvider.cpp:48:10: error: ‘void Ruby::AmbigousMethodProposalItem::apply(TextEditor::TextEditorWidget*, int) const’ marked ‘override’, but does not override
void apply(TextEditor::TextEditorWidget*, int) const Q_DECL_OVERRIDE
^
Makefile:1000: recipe for target '.obj/release-shared/RubyAmbiguousMethodAssistProvider.o' failed
make: *** [.obj/release-shared/RubyAmbiguousMethodAssistProvider.o] Error 1
Upon building from AUR, I recieve the following error
Output
==> Making package: rubycreator-git VERSION-1 (Fri 13 May 23:47:43 CEST 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Cloning RubyCreator git repo...
Cloning into bare repository '/var/cache/pacman/pkg/rubycreator-git16344/rubycreator-git/RubyCreator'...
==> Validating source files with md5sums...
RubyCreator ... Skipped
==> Extracting sources...
-> Creating working copy of RubyCreator git repo...
Cloning into 'RubyCreator'...
done.
fatal: Cannot update paths and switch to branch 'makepkg' at the same time.
Did you intend to checkout 'origin/qtc-3.5' which can not be resolved as commit?
==> ERROR: Failure while creating working copy of RubyCreator git repo
Aborting...
e.g. %r{hey}i
Would be nice to have those red wave red lines on errors found by rubocop.
By easier I mean:
Code like:
i += 1 while i < 10
mess up with the indenter because it expect an end
for that while
.
Autocompletion on Foo:: only show symbols
e.g.
some_method(foo: bar, hey: ho)
foo:
and hey:
should be highlighted as symbols.
Would be nice to have an auto completion based on methods and identifiers found in the current file.
In case of constants, based on project constants.
Hi,
There have been released a new version of Qt Creator (4.12) and RubyCreator doesn't build against it. Have you looked into it already or you haven't had time for that yet? I'm not familiar with Qt Creator plugin development, so I may look at it on weekend to fix, but if you have already started, that would be definitely faster.
"def foo param1, param2" should highlight foo and param differently
I built Qt and QtCreator from trunk and a lot of classes are suddenly very different / renamed / missing methods.
What should I do?
When I tried to compile the plugin this was its output. What can I do to make it compile successfully?
Since pasting the code here is a mess, I have uploaded the file with all of the output information I could gather...
rubycreatoroutput.txt
A useful feature would jump from controller actions into views with a single key stroke, like we do on C++ plugin to jump between declaration and implementation.
Hi,
I had been using this plugin on my daily work since 2014 , however at some point I got tired of C++ (the language that for many years was my language of choice for a lot of things), QtCreator frequent API breakages also played a small role in this lack of mood to work on this plugin. So in 2020 I started writing an editor for me with the things I liked in QtCreator and other editors and at some point in 2020 I finally was using this new editor on my daily work 🎉 instead of RubyCreator.
What this mean? Basically If I don't use a project nether I'm not paid to work on it I have no interest in spending my free time working on it.
For the few people using it, an alternative to keep on QtCreator is to use QtCreator with a ruby language server.
P.S.: I should be archiving this repository in few weeks, so if someone want to keep a fork just tell me and I put a link in the README to redirect the few people that arrive here.
P.S.: Why writing yet another editor? Because is fun and I decide what to do with my time.
This code isn't correctly highlighted:
foo = %w(bar
bee
boo)
e.g.
%w(hi
hello)
Is not highlighted correctly.
When you hit F2 on a method to go to the method definition, if multiple methods exists with this very same name, the methods defined in the same file should be listed first.
Make errors with the follow error:
No rule to make target '../Ruby.pluginspec', needed by '/usr/lib/qtcreator/plugins/Ruby.pluginspec'.
Syntax highlighting doesn't highlight %w, %q, etc.
Taking care of it's own rubocop copy will solve problems of not finding an usable rubocop.
However, if a project has rubocop in it's gem, the project rubocop should be used instead.
e.g.
def foo=
, def <=>
, etc..
Rubocop process should reload rubocop config when it changes.
And one, two, thress should be indexed in the code model as 3 different symbols, so autocomplete will work nicelly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.