feat: 初步适配 AngelScript ,增加代码填充功能,但目前未正常工作
|
@ -93,7 +93,7 @@ add_library(QCodeEditor2 STATIC ${SOURCE_FILES} ${DOCUMENT_SRC} ${WIDGETS_SRC}
|
|||
${QNFA_SRC} ${SNIPPET_SRC})
|
||||
|
||||
target_compile_definitions(QCodeEditor2 PUBLIC _QCODE_EDIT_BUILD_
|
||||
_QCODE_EDIT_EMBED_)
|
||||
_QCODE_EDIT_EMBED_ _QCODE_MODEL_)
|
||||
|
||||
target_include_directories(
|
||||
QCodeEditor2
|
||||
|
@ -106,4 +106,5 @@ target_include_directories(
|
|||
target_link_libraries(
|
||||
QCodeEditor2
|
||||
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::PrintSupport)
|
||||
Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::PrintSupport
|
||||
QCodeModel2)
|
||||
|
|
|
@ -272,7 +272,7 @@ void QCodeCompletionEngine::complete(const QDocumentCursor &c,
|
|||
Q_UNUSED(trigger)
|
||||
qWarning("From complete(QDocumentCursor, QString)");
|
||||
qWarning("QCodeCompletionEngine is not self-sufficient : subclasses should "
|
||||
"reimplement at least on of the complete() method...");
|
||||
"reimplement at least one of the complete() method...");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ add_library(
|
|||
qcodebuffer.cpp
|
||||
qcodelexer.cpp
|
||||
qcodeparser.cpp
|
||||
qcodeloader.cpp)
|
||||
qcodeloader.cpp
|
||||
resources.qrc)
|
||||
|
||||
target_include_directories(QCodeModel2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
|
|
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 241 B |
After Width: | Height: | Size: 342 B |
After Width: | Height: | Size: 313 B |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 295 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 346 B |
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 293 B |
After Width: | Height: | Size: 287 B |
After Width: | Height: | Size: 908 B |
|
@ -36,7 +36,7 @@ class QCM_EXPORT QCodeLoader : public QThread {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCodeLoader(QObject *p = 0);
|
||||
QCodeLoader(QObject *p = nullptr);
|
||||
virtual ~QCodeLoader();
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -343,8 +343,7 @@ bool QCodeModel::isCachable(QCodeNode *n, QByteArray &cxt) const {
|
|||
cxt += qn;
|
||||
|
||||
return true;
|
||||
} else if ((t == QCodeNode::Enum) || (t == QCodeNode::Union) ||
|
||||
(t == QCodeNode::Class) || (t == QCodeNode::Struct) ||
|
||||
} else if ((t == QCodeNode::Enum) || (t == QCodeNode::Class) ||
|
||||
(t == QCodeNode::Typedef)) {
|
||||
cxt += qn;
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
enum CacheIndex {
|
||||
ICON_ENUM,
|
||||
ICON_ENUMERATOR,
|
||||
ICON_UNION,
|
||||
ICON_CLASS,
|
||||
ICON_STRUCT,
|
||||
ICON_TYPEDEF,
|
||||
ICON_NAMESPACE,
|
||||
ICON_FUNCTION = ICON_NAMESPACE + 2,
|
||||
|
@ -41,15 +39,11 @@ static QIcon icon(int cacheIndex) {
|
|||
static bool setup = false;
|
||||
|
||||
if (!setup) {
|
||||
q_icon_cache[ICON_UNION] = QIcon(":/completion/CVunion.png");
|
||||
|
||||
q_icon_cache[ICON_ENUM] = QIcon(":/completion/CVenum.png");
|
||||
q_icon_cache[ICON_ENUMERATOR] = QIcon(":/completion/CVenumerator.png");
|
||||
|
||||
q_icon_cache[ICON_CLASS] = QIcon(":/completion/CVclass.png");
|
||||
|
||||
q_icon_cache[ICON_STRUCT] = QIcon(":/completion/CVstruct.png");
|
||||
|
||||
q_icon_cache[ICON_TYPEDEF] = QIcon(":/completion/CVtypedef.png");
|
||||
|
||||
q_icon_cache[ICON_NAMESPACE] = QIcon(":/completion/CVnamespace.png");
|
||||
|
@ -66,9 +60,6 @@ static QIcon icon(int cacheIndex) {
|
|||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_PRIVATE] =
|
||||
QIcon(":/completion/CVprivate_meth.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_SIGNAL] =
|
||||
QIcon(":/completion/CVprotected_signal.png");
|
||||
|
||||
q_icon_cache[ICON_VARIABLE + QCodeNode::VISIBILITY_DEFAULT] =
|
||||
QIcon(":/completion/CVglobal_var.png");
|
||||
|
||||
|
@ -358,27 +349,12 @@ QVariant QCodeNode::data(int r) const {
|
|||
return d;
|
||||
}
|
||||
|
||||
case Struct: {
|
||||
QByteArray d("struct ");
|
||||
d += role(Name);
|
||||
|
||||
QByteArray a = role(Ancestors);
|
||||
|
||||
if (a.length())
|
||||
d += " : " + a;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
case Enum:
|
||||
return QByteArray("enum ") + role(Name);
|
||||
|
||||
case Enumerator:
|
||||
return role(Name) + " = " + role(Value);
|
||||
|
||||
case Union:
|
||||
return QByteArray("union ") + role(Name);
|
||||
|
||||
case Namespace:
|
||||
return QByteArray("namespace ") + role(Name);
|
||||
|
||||
|
@ -406,20 +382,12 @@ QVariant QCodeNode::data(int r) const {
|
|||
// storage class
|
||||
if (m_specifiers & QCodeNode::SPECIFIER_AUTO)
|
||||
specifier += " auto ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_REGISTER)
|
||||
specifier += " register ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_STATIC)
|
||||
specifier += " static ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_EXTERN)
|
||||
specifier += " extern ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_MUTABLE)
|
||||
specifier += " mutable ";
|
||||
|
||||
// cv qualifier (for class members)
|
||||
if (m_specifiers & QCodeNode::SPECIFIER_CONST)
|
||||
specifier += " const ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_VOLATILE)
|
||||
specifier += " volatile ";
|
||||
|
||||
if (specifier.length())
|
||||
signature += " [" + specifier.simplified() + "]";
|
||||
|
@ -444,17 +412,6 @@ QVariant QCodeNode::data(int r) const {
|
|||
|
||||
if (m_qualifiers & QCodeNode::QUALIFIER_CONST)
|
||||
qualifier += " const ";
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_VOLATILE)
|
||||
qualifier += " volatile ";
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_STATIC)
|
||||
qualifier += " static ";
|
||||
|
||||
if (m_qualifiers & QCodeNode::QUALIFIER_PURE_VIRTUAL)
|
||||
qualifier.prepend(" pure virtual ");
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_INLINE)
|
||||
qualifier.prepend(" inline ");
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_VIRTUAL)
|
||||
qualifier.prepend(" virtual ");
|
||||
|
||||
int m_visibility = role(Visibility).toInt();
|
||||
|
||||
|
@ -462,8 +419,6 @@ QVariant QCodeNode::data(int r) const {
|
|||
qualifier.prepend(" public ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_PROTECTED)
|
||||
qualifier.prepend(" protected ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_SIGNAL)
|
||||
qualifier.prepend(" signal ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_PRIVATE)
|
||||
qualifier.prepend(" private ");
|
||||
else
|
||||
|
@ -495,18 +450,12 @@ QVariant QCodeNode::data(int r) const {
|
|||
case Class:
|
||||
return icon(ICON_CLASS);
|
||||
|
||||
case Struct:
|
||||
return icon(ICON_STRUCT);
|
||||
|
||||
case Enum:
|
||||
return icon(ICON_ENUM);
|
||||
|
||||
case Enumerator:
|
||||
return icon(ICON_ENUMERATOR);
|
||||
|
||||
case Union:
|
||||
return icon(ICON_UNION);
|
||||
|
||||
case Namespace:
|
||||
return icon(ICON_NAMESPACE);
|
||||
|
||||
|
|
|
@ -62,7 +62,6 @@ struct QCM_EXPORT QCodeNode {
|
|||
Language = 'l',
|
||||
|
||||
Class = 'c',
|
||||
Struct = 's',
|
||||
|
||||
Function = 'f',
|
||||
|
||||
|
@ -71,8 +70,6 @@ struct QCM_EXPORT QCodeNode {
|
|||
Enum = 'e',
|
||||
Enumerator = 'r',
|
||||
|
||||
Union = 'u',
|
||||
|
||||
Namespace = 'n',
|
||||
|
||||
Typedef = 't'
|
||||
|
@ -87,7 +84,6 @@ struct QCM_EXPORT QCodeNode {
|
|||
enum NodeVisibility {
|
||||
VISIBILITY_DEFAULT = -1,
|
||||
VISIBILITY_PUBLIC,
|
||||
VISIBILITY_SIGNAL,
|
||||
VISIBILITY_PROTECTED,
|
||||
VISIBILITY_PRIVATE
|
||||
};
|
||||
|
@ -95,11 +91,7 @@ struct QCM_EXPORT QCodeNode {
|
|||
enum Specifier {
|
||||
SPECIFIER_NONE = 0,
|
||||
SPECIFIER_CONST = 1,
|
||||
SPECIFIER_VOLATILE = 2,
|
||||
SPECIFIER_MUTABLE = 4,
|
||||
SPECIFIER_AUTO = 8,
|
||||
SPECIFIER_STATIC = 16,
|
||||
SPECIFIER_REGISTER = 32,
|
||||
SPECIFIER_EXTERN = 64
|
||||
};
|
||||
|
||||
|
@ -108,12 +100,8 @@ struct QCM_EXPORT QCodeNode {
|
|||
enum Qualifier {
|
||||
QUALIFIER_NONE = 0,
|
||||
QUALIFIER_CONST = 1,
|
||||
QUALIFIER_VOLATILE = 2,
|
||||
QUALIFIER_STATIC = 4,
|
||||
QUALIFIER_EXTERN = 8,
|
||||
QUALIFIER_VIRTUAL = 16,
|
||||
QUALIFIER_PURE_VIRTUAL = 32,
|
||||
QUALIFIER_INLINE = 64
|
||||
QUALIFIER_ABSTRACT = 2,
|
||||
QUALIFIER_EXTERN = 8
|
||||
};
|
||||
|
||||
typedef QFlags<Qualifier> FunctionQualifier;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
static QList<int> priority = QList<int>()
|
||||
<< QCodeNode::Group << QCodeNode::Language
|
||||
<< QCodeNode::Namespace << QCodeNode::Class
|
||||
<< QCodeNode::Struct << QCodeNode::Union
|
||||
<< QCodeNode::Enum << QCodeNode::Typedef
|
||||
<< QCodeNode::Function << QCodeNode::Variable;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class QCM_EXPORT QCodeProxyModel : public QSortFilterProxyModel {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCodeProxyModel(QObject *p = 0);
|
||||
QCodeProxyModel(QObject *p = nullptr);
|
||||
virtual ~QCodeProxyModel();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>completion/CVclass.png</file>
|
||||
<file>completion/CVenum.png</file>
|
||||
<file>completion/CVenumerator.png</file>
|
||||
<file>completion/CVglobal_meth.png</file>
|
||||
<file>completion/CVglobal_var.png</file>
|
||||
<file>completion/CVnamespace.png</file>
|
||||
<file>completion/CVpackage_meth.png</file>
|
||||
<file>completion/CVpackage_var.png</file>
|
||||
<file>completion/CVprivate_meth.png</file>
|
||||
<file>completion/CVprivate_var.png</file>
|
||||
<file>completion/CVprotected_meth.png</file>
|
||||
<file>completion/CVprotected_var.png</file>
|
||||
<file>completion/CVpublic_meth.png</file>
|
||||
<file>completion/CVpublic_var.png</file>
|
||||
<file>completion/CVtypedef.png</file>
|
||||
<file>completion/classnew.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -4293,375 +4293,375 @@ Do you want them to be saved?</source>
|
|||
<context>
|
||||
<name>ScriptingDialog</name>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="92"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="109"/>
|
||||
<source>ScriptEditor</source>
|
||||
<translation>脚本编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="173"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="190"/>
|
||||
<source>ScriptPermissionDenied</source>
|
||||
<translation>因权限无法打开脚本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="219"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="236"/>
|
||||
<source>File</source>
|
||||
<translation>文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="220"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="237"/>
|
||||
<source>Edit</source>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="222"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="239"/>
|
||||
<source>Debugger</source>
|
||||
<translation>调试器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="226"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="243"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="239"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="256"/>
|
||||
<source>Basic</source>
|
||||
<translation>基础</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="240"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="257"/>
|
||||
<source>New</source>
|
||||
<translation>新建</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="243"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="260"/>
|
||||
<source>OpenF</source>
|
||||
<translation>打开文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="246"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="263"/>
|
||||
<source>RecentFiles</source>
|
||||
<translation>最近打开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="250"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="267"/>
|
||||
<source>Reload</source>
|
||||
<translation>重新加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="255"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="257"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="272"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="274"/>
|
||||
<source>Save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="262"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="279"/>
|
||||
<source>SaveAs</source>
|
||||
<translation>另存为</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="274"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="291"/>
|
||||
<source>General</source>
|
||||
<translation>基本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="276"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="293"/>
|
||||
<source>Undo</source>
|
||||
<translation>撤销</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="281"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="298"/>
|
||||
<source>Redo</source>
|
||||
<translation>恢复</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="287"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="304"/>
|
||||
<source>Cut</source>
|
||||
<translation>剪切</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="291"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="308"/>
|
||||
<source>Copy</source>
|
||||
<translation>复制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="296"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="313"/>
|
||||
<source>Paste</source>
|
||||
<translation>粘贴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="300"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="317"/>
|
||||
<source>Delete</source>
|
||||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="306"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="323"/>
|
||||
<source>Lookup</source>
|
||||
<translation>查询</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="307"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="324"/>
|
||||
<source>Find</source>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="311"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="328"/>
|
||||
<source>Replace</source>
|
||||
<translation>替换</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="316"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="333"/>
|
||||
<source>Goto</source>
|
||||
<translation>跳转</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="328"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="345"/>
|
||||
<source>Display</source>
|
||||
<translation>显示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="355"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="372"/>
|
||||
<source>Scale</source>
|
||||
<translation>缩放</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="357"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="374"/>
|
||||
<source>ResetScale</source>
|
||||
<translation>重置缩放</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="363"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="380"/>
|
||||
<source>Window</source>
|
||||
<translation>窗体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="366"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="454"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="383"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="471"/>
|
||||
<source>Editor</source>
|
||||
<translation>编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="370"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="387"/>
|
||||
<source>Tools</source>
|
||||
<translation>工具</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="375"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="392"/>
|
||||
<source>Layout</source>
|
||||
<translation>布局</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="376"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="393"/>
|
||||
<source>Fullscreen</source>
|
||||
<translation>全屏</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="378"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="395"/>
|
||||
<source>RestoreLayout</source>
|
||||
<translation>恢复默认布局</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="437"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="454"/>
|
||||
<source>BreakPoint</source>
|
||||
<translation>断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="439"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="456"/>
|
||||
<source>ToggleBreakPoint</source>
|
||||
<translation>切换断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="442"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="459"/>
|
||||
<source>AddBreakPoint</source>
|
||||
<translation>添加断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="452"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="469"/>
|
||||
<source>Settings</source>
|
||||
<translation>设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="488"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="505"/>
|
||||
<source>Local</source>
|
||||
<translation>本地</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="494"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="511"/>
|
||||
<source>Global</source>
|
||||
<translation>全局</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="497"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="514"/>
|
||||
<source>Variables</source>
|
||||
<translation>变量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="510"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="527"/>
|
||||
<source>BreakPoints</source>
|
||||
<translation>断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="522"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="539"/>
|
||||
<source>ConsoleOutput</source>
|
||||
<translation>输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="536"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="553"/>
|
||||
<source>StackTrace</source>
|
||||
<translation>栈跟踪</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="550"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="567"/>
|
||||
<source>Watch</source>
|
||||
<translation>监视</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="639"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="849"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1013"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1049"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1064"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1089"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="656"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="866"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1030"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1066"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1081"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1106"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="640"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="657"/>
|
||||
<source>Too much opened files</source>
|
||||
<translation>打开的文件过多,无法继续操作!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="988"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1028"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1005"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1045"/>
|
||||
<source>ChooseFile</source>
|
||||
<translation>选择文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="849"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1013"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1064"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="866"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1030"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1081"/>
|
||||
<source>FilePermission</source>
|
||||
<translation>因文件权限无法继续!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1047"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1064"/>
|
||||
<source>ReloadSuccessfully</source>
|
||||
<translation>文件重新加载成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1049"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1066"/>
|
||||
<source>ReloadUnSuccessfully</source>
|
||||
<translation>文件重新加载失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1076"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1093"/>
|
||||
<source>ChooseSaveFile</source>
|
||||
<translation>请选择保存文件路径:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1062"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1087"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1079"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1104"/>
|
||||
<source>SaveSuccessfully</source>
|
||||
<translation>保存成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1089"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1106"/>
|
||||
<source>SaveUnSuccessfully</source>
|
||||
<translation>保存失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1197"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1212"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1214"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1229"/>
|
||||
<source>CannotSave2RunScript</source>
|
||||
<translation>无法保存,故无法继续运行脚本。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="672"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1272"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="689"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1289"/>
|
||||
<source>ScriptStillRunning</source>
|
||||
<translation>脚本仍在运行,你确定要退出吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="221"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="238"/>
|
||||
<source>View</source>
|
||||
<translation>视图</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="387"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="404"/>
|
||||
<source>Debug</source>
|
||||
<translation>调试</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="390"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="407"/>
|
||||
<source>Run</source>
|
||||
<translation>运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="395"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="412"/>
|
||||
<source>RunWithDbg</source>
|
||||
<translation>调试运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="401"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="418"/>
|
||||
<source>Pause</source>
|
||||
<translation>暂停</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="406"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="423"/>
|
||||
<source>Continue</source>
|
||||
<translation>继续</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="411"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="428"/>
|
||||
<source>Stop</source>
|
||||
<translation>停止</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="415"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="432"/>
|
||||
<source>Restart</source>
|
||||
<translation>重启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="420"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="437"/>
|
||||
<source>StepInto</source>
|
||||
<translation>单步步入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="425"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="442"/>
|
||||
<source>StepOver</source>
|
||||
<translation>单步步过</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="429"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="446"/>
|
||||
<source>StepOut</source>
|
||||
<translation>单步跳出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="445"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="462"/>
|
||||
<source>RemoveBreakPoint</source>
|
||||
<translation>删除断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="461"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="478"/>
|
||||
<source>Info</source>
|
||||
<translation>信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="463"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="480"/>
|
||||
<source>Software</source>
|
||||
<translation>软件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="466"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="483"/>
|
||||
<source>Sponsor</source>
|
||||
<translation>赞助</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="469"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="486"/>
|
||||
<source>Wiki</source>
|
||||
<translation>网页 Wiki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="472"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="489"/>
|
||||
<source>AboutQT</source>
|
||||
<translation>关于 QT</translation>
|
||||
</message>
|
||||
|
|
|
@ -45,7 +45,7 @@ def main():
|
|||
"folder", help="A folder that has contained the binary build")
|
||||
parser.add_argument("-c", "--cc", help="where ISCC.exe locates", default="C:\Program Files (x86)\Inno Setup 6\ISCC.exe")
|
||||
parser.add_argument("-o", "--output", help="where to put the installer")
|
||||
parser.add_argument("--build", action='store_false')
|
||||
parser.add_argument("--no-build", action='store_false')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -157,8 +157,6 @@ def main():
|
|||
print(Fore.GREEN + ">> Copying finished, deploying the software..." + Style.RESET_ALL)
|
||||
|
||||
try:
|
||||
subprocess.run([deploy_exec, os.path.join(exeDebPath, f"qt{qt_version}advanceddocking.dll")], check=True,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
subprocess.run([deploy_exec, os.path.join(exeDebPath, exe_name) ], check=True,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
@ -167,9 +165,6 @@ def main():
|
|||
except FileNotFoundError:
|
||||
exit(-4)
|
||||
|
||||
# ok, remove the ads_lib_deploy
|
||||
os.remove(ads_lib_deploy)
|
||||
|
||||
# generate iss file
|
||||
print(Fore.GREEN + ">> Copying finished, generate ISCC script..." + Style.RESET_ALL)
|
||||
|
||||
|
|
|
@ -205,11 +205,11 @@ static int contextBound(const QToken& unscoped, const QTokenList& context)
|
|||
extern QByteArray join(const QList<QByteArray> &l, QByteArray glue,
|
||||
int max = -1);
|
||||
|
||||
QCodeCompletionBackend *AsCompletion::pBackend = 0;
|
||||
QCodeCompletionBackend *AsCompletion::pBackend = nullptr;
|
||||
unsigned long AsCompletion::instances = 0;
|
||||
|
||||
AsCompletion::AsCompletion(QObject *p)
|
||||
: QCodeCompletionEngine(p), pPopup(0), pModel(0) {
|
||||
: QCodeCompletionEngine(p), pPopup(nullptr), pModel(nullptr) {
|
||||
if (!pBackend)
|
||||
pBackend = new QCodeCompletionBackend;
|
||||
|
||||
|
@ -226,7 +226,7 @@ AsCompletion::AsCompletion(QObject *p)
|
|||
}
|
||||
|
||||
AsCompletion::AsCompletion(QCodeModel *m, QObject *p)
|
||||
: QCodeCompletionEngine(p), pPopup(0), pModel(m) {
|
||||
: QCodeCompletionEngine(p), pPopup(nullptr), pModel(m) {
|
||||
if (!pBackend)
|
||||
pBackend = new QCodeCompletionBackend;
|
||||
|
||||
|
@ -248,14 +248,14 @@ AsCompletion::~AsCompletion() {
|
|||
|
||||
if (!instances && pBackend) {
|
||||
delete pBackend;
|
||||
pBackend = 0;
|
||||
pBackend = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
QCodeCompletionEngine *AsCompletion::clone() {
|
||||
AsCompletion *e = new AsCompletion(pModel);
|
||||
|
||||
foreach (QString t, triggers())
|
||||
for (auto &t : triggers())
|
||||
e->addTrigger(t);
|
||||
|
||||
emit cloned(e);
|
||||
|
@ -263,18 +263,13 @@ QCodeCompletionEngine *AsCompletion::clone() {
|
|||
return e;
|
||||
}
|
||||
|
||||
QString AsCompletion::language() const { return "C++"; }
|
||||
QString AsCompletion::language() const { return "AngelScript"; }
|
||||
|
||||
QStringList AsCompletion::extensions() const {
|
||||
QStringList l;
|
||||
|
||||
l << "c"
|
||||
<< "cc"
|
||||
<< "cpp"
|
||||
<< "cxx"
|
||||
<< "h"
|
||||
<< "hpp"
|
||||
<< "hxx";
|
||||
l << "as"
|
||||
<< "angelscript";
|
||||
|
||||
return l;
|
||||
}
|
||||
|
@ -383,12 +378,12 @@ static void flush(QTokenList::const_iterator beg,
|
|||
++i;
|
||||
--tpl_nest;
|
||||
stillType =
|
||||
stillType && (tpl_nest || *i == "*" || *i == "&" || *i == "::");
|
||||
stillType && (tpl_nest || *i == "*" || *i == "@" || *i == "::");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stillType) {
|
||||
if (tpl_nest || *i == "const" || *i == "static" || *i == "::") {
|
||||
if (tpl_nest || *i == "const" || *i == "::") {
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
|
@ -396,7 +391,7 @@ static void flush(QTokenList::const_iterator beg,
|
|||
if (++i == end)
|
||||
break;
|
||||
|
||||
stillType = *i == "*" || *i == "&" || *i == "<" || *i == "::";
|
||||
stillType = *i == "*" || *i == "@" || *i == "<" || *i == "::";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -457,9 +452,6 @@ static QByteArray trimmedType(const QByteArray &t, bool &ptr) {
|
|||
|
||||
QByteArray s = t;
|
||||
|
||||
if (s.startsWith("static "))
|
||||
s.remove(0, 7);
|
||||
|
||||
if (s.startsWith("const "))
|
||||
s.remove(0, 6);
|
||||
|
||||
|
@ -470,7 +462,7 @@ static QByteArray trimmedType(const QByteArray &t, bool &ptr) {
|
|||
ptr = true;
|
||||
s.remove(i, 1);
|
||||
--i;
|
||||
} else if (s.at(i) == '&') {
|
||||
} else if (s.at(i) == '@') {
|
||||
s.remove(i, 1);
|
||||
--i;
|
||||
} else if ((s.at(i) == ' ') &&
|
||||
|
@ -627,7 +619,7 @@ QByteArray AsCompletion::functionLookup(QCodeNode *n, const QByteArray &s) {
|
|||
QByteArray cn = c->role(QCodeNode::Name), tpl;
|
||||
|
||||
if (ctype == QCodeNode::Group ||
|
||||
(ctype == QCodeNode::Language && cn == "C++") ||
|
||||
(ctype == QCodeNode::Language && cn == "AngelScript") ||
|
||||
(ctype == QCodeNode::Namespace && m_namespaces.contains(cn))) {
|
||||
foreach (QCodeNode *child, c->children)
|
||||
stack.push(child);
|
||||
|
@ -716,7 +708,7 @@ QCodeNode *AsCompletion::lookup(const QByteArray &t) {
|
|||
TRACE_IF(n, "found in locals")
|
||||
|
||||
if (!n && scope_local && pModel) {
|
||||
n = pModel->findNode("C++", t);
|
||||
n = pModel->findNode("AngelScript", t);
|
||||
|
||||
TRACE_IF(n, "found in projects")
|
||||
}
|
||||
|
@ -912,8 +904,6 @@ void AsCompletion::hierarchy(QCodeNode *n, QList<QCodeNode *> &l,
|
|||
|
||||
// bool bPriv = a.contains("private");
|
||||
|
||||
remove(a, "virtual");
|
||||
|
||||
remove(a, "public");
|
||||
remove(a, "private");
|
||||
remove(a, "protected");
|
||||
|
@ -998,7 +988,7 @@ void AsCompletion::getMembers(QTokenList::const_iterator beg,
|
|||
n = nsAwareLookup(ts);
|
||||
int ntype = n ? n->type() : 0;
|
||||
|
||||
if (n && (ntype == QCodeNode::Class || ntype == QCodeNode::Struct)) {
|
||||
if (n && (ntype == QCodeNode::Class)) {
|
||||
// ctors
|
||||
type = symbol;
|
||||
matchForward(i, "(", ")", end);
|
||||
|
@ -1289,9 +1279,7 @@ void AsCompletion::getMembers(QTokenList::const_iterator beg,
|
|||
break;
|
||||
} else if (op == "::") {
|
||||
if ((nt == QCodeNode::Enum) ||
|
||||
(nt == QCodeNode::Union) ||
|
||||
(nt == QCodeNode::Class) ||
|
||||
(nt == QCodeNode::Struct) ||
|
||||
(nt == QCodeNode::Namespace)) {
|
||||
++i;
|
||||
type = symbol;
|
||||
|
@ -1300,8 +1288,7 @@ void AsCompletion::getMembers(QTokenList::const_iterator beg,
|
|||
}
|
||||
} else if (op == "(") {
|
||||
|
||||
if ((nt == QCodeNode::Class) ||
|
||||
(nt == QCodeNode::Struct)) {
|
||||
if (nt == QCodeNode::Class) {
|
||||
type = symbol;
|
||||
updateContext(child, &cxt, &scxt);
|
||||
i += 2;
|
||||
|
@ -1376,7 +1363,7 @@ void AsCompletion::complete(QCodeStream *s, const QString &trig) {
|
|||
|
||||
if (pPopup && pPopup->editor() != editor()) {
|
||||
delete pPopup;
|
||||
pPopup = 0;
|
||||
pPopup = nullptr;
|
||||
}
|
||||
|
||||
if (!pPopup) {
|
||||
|
|
|
@ -27,24 +27,25 @@ private:
|
|||
};
|
||||
|
||||
class AsCompletion : public QCodeCompletionEngine {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AsCompletion(QObject *p = 0);
|
||||
AsCompletion(QCodeModel *m, QObject *p = 0);
|
||||
AsCompletion(QObject *p = nullptr);
|
||||
AsCompletion(QCodeModel *m, QObject *p = nullptr);
|
||||
|
||||
virtual ~AsCompletion();
|
||||
|
||||
virtual QCodeCompletionEngine *clone();
|
||||
virtual QCodeCompletionEngine *clone() override;
|
||||
|
||||
virtual QString language() const;
|
||||
virtual QStringList extensions() const;
|
||||
virtual QString language() const override;
|
||||
virtual QStringList extensions() const override;
|
||||
|
||||
void init();
|
||||
|
||||
QCodeCompletionBackend *backend() const;
|
||||
|
||||
protected:
|
||||
virtual void setCodeModel(QCodeModel *m);
|
||||
virtual void complete(QCodeStream *s, const QString &trigger);
|
||||
virtual void setCodeModel(QCodeModel *m) override;
|
||||
virtual void complete(QCodeStream *s, const QString &trigger) override;
|
||||
|
||||
public:
|
||||
void hierarchy(QCodeNode *n, QList<QCodeNode *> &l,
|
||||
|
|
|
@ -303,10 +303,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
|
||||
if (type == QCodeNode::Class) {
|
||||
visibility = QCodeNode::VISIBILITY_PRIVATE;
|
||||
} else if (type == QCodeNode::Struct) {
|
||||
visibility = QCodeNode::VISIBILITY_PUBLIC;
|
||||
} else if ((type == QCodeNode::Union) || (type == QCodeNode::Enum) ||
|
||||
(type == QCodeNode::Namespace)) {
|
||||
} else if ((type == QCodeNode::Enum) || (type == QCodeNode::Namespace)) {
|
||||
visibility = QCodeNode::VISIBILITY_PUBLIC;
|
||||
}
|
||||
|
||||
|
@ -323,8 +320,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
// qDebug("\"%s\"", token.constData());
|
||||
|
||||
switch (k) {
|
||||
case KEYWORD_CLASS:
|
||||
case KEYWORD_STRUCT: {
|
||||
case KEYWORD_CLASS: {
|
||||
if (ltemplates.count() == 1 && ltemplates.at(0).isEmpty()) {
|
||||
// specialization : discard
|
||||
buffer_unused.clear();
|
||||
|
@ -394,7 +390,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
name = "<anonymous>";
|
||||
}
|
||||
|
||||
QByteArray roles = (k == KEYWORD_STRUCT) ? "s@" : "c@";
|
||||
QByteArray roles = "c@";
|
||||
|
||||
#ifdef _TRACE_PARSING_
|
||||
qDebug("%s %s", (k == KEYWORD_STRUCT) ? "struct" : "class",
|
||||
|
@ -405,8 +401,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
roles += "@";
|
||||
|
||||
// QList<QByteArray> ancestors;
|
||||
QByteArray rule,
|
||||
drule = (k == KEYWORD_CLASS) ? "private" : "public";
|
||||
QByteArray rule, drule = "private";
|
||||
|
||||
if (tokens.at(id) == ":") {
|
||||
while (filter(++id, end)) {
|
||||
|
@ -677,73 +672,6 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
break;
|
||||
}
|
||||
|
||||
case KEYWORD_UNION: {
|
||||
ltemplates.clear();
|
||||
|
||||
QByteArray name;
|
||||
|
||||
if (((id + 1) < end && tokens.at(id + 1) != "{") &&
|
||||
((id + 2) < end && tokens.at(id + 2) != "{")) {
|
||||
// twisted variable declaration...
|
||||
++id;
|
||||
break;
|
||||
}
|
||||
|
||||
if (tokens.at(id + 1) == "{") {
|
||||
// anonymous enum
|
||||
name = "<anonymous>";
|
||||
} else if (tokens.at(id + 2) == "{") {
|
||||
// named enum
|
||||
name = tokens.at(++id);
|
||||
} else {
|
||||
qWarning("Syntax error : expected \'{\' after \"union\" in %s",
|
||||
sContext.constData());
|
||||
buffer_unused.clear();
|
||||
++id;
|
||||
break;
|
||||
}
|
||||
|
||||
++id;
|
||||
first = id + 1;
|
||||
|
||||
match(tokens, id, end, '{', '}');
|
||||
|
||||
if (buffer_unused.count()) {
|
||||
qWarning(
|
||||
"Syntax error : expecting \';\' before \"union\" in %s",
|
||||
sContext.constData());
|
||||
dump(buffer_unused);
|
||||
++id;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef _TRACE_PARSING_
|
||||
qDebug("union %s", name.constData());
|
||||
#endif
|
||||
|
||||
QCodeNode *un = getNode();
|
||||
un->line = line;
|
||||
un->roles =
|
||||
QByteArray("u@") + name + "@@" + QByteArray::number(visibility);
|
||||
|
||||
// if ( l ) qDebug("union at line %i", line);
|
||||
|
||||
if (bNeedCxt)
|
||||
n->roles += "@" + sContext;
|
||||
|
||||
un->attach(pScope);
|
||||
|
||||
update(un, l, tokens, first, id, false);
|
||||
|
||||
while ((id < end) && (tokens.at(id) != ";"))
|
||||
++id;
|
||||
|
||||
if (id < end)
|
||||
++id;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case KEYWORD_NAMESPACE: {
|
||||
ltemplates.clear();
|
||||
|
||||
|
@ -848,9 +776,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
++id;
|
||||
|
||||
switch (keyword(tokens.at(id))) {
|
||||
case KEYWORD_STRUCT:
|
||||
case KEYWORD_ENUM:
|
||||
case KEYWORD_UNION: {
|
||||
case KEYWORD_ENUM: {
|
||||
++id;
|
||||
|
||||
QByteArray name;
|
||||
|
@ -1197,47 +1123,19 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
int nodeType = pScope->type();
|
||||
|
||||
bool cont = false,
|
||||
inClass = ((nodeType == QCodeNode::Class) ||
|
||||
(nodeType == QCodeNode::Struct));
|
||||
inClass = (nodeType == QCodeNode::Class);
|
||||
|
||||
if (!inClass) {
|
||||
|
||||
if (*ba == "static") {
|
||||
ts |= QCodeNode::SPECIFIER_STATIC;
|
||||
|
||||
if (((ba + 1) < buffer_end) &&
|
||||
(*(ba + 1) == "const")) {
|
||||
++ba;
|
||||
ts |= QCodeNode::SPECIFIER_CONST;
|
||||
}
|
||||
|
||||
} else if (*ba == "extern")
|
||||
if (*ba == "extern")
|
||||
ts |= QCodeNode::SPECIFIER_EXTERN;
|
||||
else if (*ba == "auto")
|
||||
ts |= QCodeNode::SPECIFIER_AUTO;
|
||||
else if (*ba == "register")
|
||||
ts |= QCodeNode::SPECIFIER_REGISTER;
|
||||
else if (*ba == "const")
|
||||
ts |= QCodeNode::SPECIFIER_CONST;
|
||||
else if (*ba == "volatile")
|
||||
ts |= QCodeNode::SPECIFIER_VOLATILE;
|
||||
else if (*ba == "mutable")
|
||||
ts |= QCodeNode::SPECIFIER_MUTABLE;
|
||||
else
|
||||
--ba;
|
||||
} else {
|
||||
if (*ba == "static") {
|
||||
ts |= QCodeNode::SPECIFIER_STATIC;
|
||||
|
||||
if ((ba + 1) < buffer_end &&
|
||||
*(ba + 1) == "const") {
|
||||
++ba;
|
||||
ts |= QCodeNode::SPECIFIER_CONST;
|
||||
}
|
||||
|
||||
} else if (*ba == "mutable")
|
||||
ts |= QCodeNode::SPECIFIER_MUTABLE;
|
||||
else if (*ba == "const")
|
||||
if (*ba == "const")
|
||||
ts |= QCodeNode::SPECIFIER_CONST;
|
||||
else
|
||||
--ba;
|
||||
|
@ -1414,9 +1312,6 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
} else if (buffer_unused.last() == "private") {
|
||||
visa = true;
|
||||
visibility = QCodeNode::VISIBILITY_PRIVATE;
|
||||
} else if (buffer_unused.last() == "signals") {
|
||||
visa = true;
|
||||
visibility = QCodeNode::VISIBILITY_SIGNAL;
|
||||
} else {
|
||||
// qWarning("weird syntactic construct in %s",
|
||||
// sContext.constData());
|
||||
|
@ -1469,14 +1364,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
|
||||
QCodeNode::FunctionQualifier fq = QCodeNode::QUALIFIER_NONE;
|
||||
|
||||
int pref_idx = buffer_unused.indexOf("inline");
|
||||
|
||||
if (pref_idx != -1) {
|
||||
fq |= QCodeNode::QUALIFIER_INLINE;
|
||||
buffer_unused.removeAt(pref_idx);
|
||||
}
|
||||
|
||||
pref_idx = buffer_unused.indexOf("explicit");
|
||||
int pref_idx = buffer_unused.indexOf("explicit");
|
||||
|
||||
if (pref_idx != -1)
|
||||
buffer_unused.removeAt(pref_idx);
|
||||
|
@ -1539,8 +1427,7 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
|
||||
// maybe ctor or dtor
|
||||
|
||||
if (((pScope->type() == QCodeNode::Class) ||
|
||||
(pScope->type() == QCodeNode::Struct)) &&
|
||||
if ((pScope->type() == QCodeNode::Class) &&
|
||||
(name == pScope->role(QCodeNode::Name))) {
|
||||
isCtorDtor = true;
|
||||
|
||||
|
@ -1551,8 +1438,8 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
}
|
||||
|
||||
if (buffer_unused.count() &&
|
||||
buffer_unused.at(0) == "virtual") {
|
||||
fq |= QCodeNode::QUALIFIER_VIRTUAL;
|
||||
buffer_unused.at(0) == "abstract") {
|
||||
fq |= QCodeNode::QUALIFIER_ABSTRACT;
|
||||
buffer_unused.removeAt(0);
|
||||
}
|
||||
|
||||
|
@ -1572,10 +1459,6 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
// anything else
|
||||
if (buffer_unused.at(0) == "extern")
|
||||
fq |= QCodeNode::QUALIFIER_EXTERN;
|
||||
else if (buffer_unused.at(0) == "static")
|
||||
fq |= QCodeNode::QUALIFIER_STATIC;
|
||||
else if (buffer_unused.at(0) == "virtual")
|
||||
fq |= QCodeNode::QUALIFIER_VIRTUAL;
|
||||
else
|
||||
goto skip_qualifiers;
|
||||
|
||||
|
@ -1640,12 +1523,6 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
break;
|
||||
} else if (tokens.at(id) == "const")
|
||||
fq |= QCodeNode::QUALIFIER_CONST;
|
||||
else if (tokens.at(id) == "volatile")
|
||||
fq |= QCodeNode::QUALIFIER_VOLATILE;
|
||||
else if (tokens.at(id) == "=") {
|
||||
if (((id + 1) < end) && (tokens.at(id + 1) == "0"))
|
||||
fq |= QCodeNode::QUALIFIER_PURE_VIRTUAL;
|
||||
}
|
||||
|
||||
++id;
|
||||
}
|
||||
|
@ -1653,10 +1530,6 @@ void QAsParser::update(QCodeNode *n, QCodeLexer *l, QTokenList &tokens, int id,
|
|||
if (!retval.endsWith("::") &&
|
||||
!retval.endsWith(":: ~") // small quirk handling...
|
||||
) {
|
||||
if (retval.startsWith("inline ")) {
|
||||
retval.remove(0, 7);
|
||||
fq |= QCodeNode::QUALIFIER_INLINE;
|
||||
}
|
||||
|
||||
prettify(name);
|
||||
prettify(retval);
|
||||
|
@ -1876,10 +1749,8 @@ static const QAsParser::KeywordId IdTable[] = {
|
|||
QCppParser::KEYWORD_RETURN,
|
||||
QCppParser::KEYWORD_SHORT,
|
||||
QCppParser::KEYWORD_SIGNED,
|
||||
QCppParser::KEYWORD_STATIC,
|
||||
*/
|
||||
|
||||
QAsParser::KEYWORD_STRUCT,
|
||||
*/
|
||||
|
||||
/*
|
||||
QCppParser::KEYWORD_SWITCH,
|
||||
|
@ -1898,8 +1769,6 @@ static const QAsParser::KeywordId IdTable[] = {
|
|||
|
||||
// QCppParser::KEYWORD_TYPENAME,
|
||||
|
||||
QAsParser::KEYWORD_UNION,
|
||||
|
||||
// QCppParser::KEYWORD_UNSIGNED,
|
||||
|
||||
QAsParser::KEYWORD_USING,
|
||||
|
|
|
@ -12,7 +12,6 @@ public:
|
|||
KEYWORD_NONE = -1,
|
||||
|
||||
KEYWORD_ATTRIBUTE,
|
||||
KEYWORD_ASM,
|
||||
KEYWORD_AUTO,
|
||||
KEYWORD_BOOL,
|
||||
KEYWORD_BREAK,
|
||||
|
@ -40,19 +39,16 @@ public:
|
|||
KEYWORD_INT,
|
||||
KEYWORD_INTERNAL,
|
||||
KEYWORD_LONG,
|
||||
KEYWORD_MUTABLE,
|
||||
KEYWORD_NAMESPACE,
|
||||
KEYWORD_NEW,
|
||||
KEYWORD_OPERATOR,
|
||||
KEYWORD_PRIVATE,
|
||||
KEYWORD_PROTECTED,
|
||||
KEYWORD_PUBLIC,
|
||||
KEYWORD_REGISTER,
|
||||
KEYWORD_RETURN,
|
||||
KEYWORD_SHORT,
|
||||
KEYWORD_SIGNED,
|
||||
KEYWORD_STATIC,
|
||||
KEYWORD_STRUCT,
|
||||
KEYWORD_SWITCH,
|
||||
KEYWORD_SIZEOF,
|
||||
KEYWORD_TEMPLATE,
|
||||
|
@ -61,13 +57,10 @@ public:
|
|||
KEYWORD_TRY,
|
||||
KEYWORD_TYPEDEF,
|
||||
KEYWORD_TYPENAME,
|
||||
KEYWORD_UNION,
|
||||
KEYWORD_UNSIGNED,
|
||||
KEYWORD_USING,
|
||||
KEYWORD_VIRTUAL,
|
||||
KEYWORD_VOID,
|
||||
KEYWORD_VOLATILE,
|
||||
KEYWORD_WCHAR_T,
|
||||
KEYWORD_WHILE,
|
||||
|
||||
KEYWORD_COUNT
|
||||
|
|
|
@ -513,8 +513,7 @@ bool QCodeCompletionModel::match(QCodeNode *n,
|
|||
);
|
||||
*/
|
||||
|
||||
if ((((type == QCodeNode::Class) || (type == QCodeNode::Struct) ||
|
||||
(type == QCodeNode::Union) || (type == QCodeNode::Typedef)) &&
|
||||
if ((((type == QCodeNode::Class) || (type == QCodeNode::Typedef)) &&
|
||||
!(filter & QCodeCompletionWidget::KeepSubTypes)) ||
|
||||
((type == QCodeNode::Enum) &&
|
||||
!(filter & QCodeCompletionWidget::KeepEnums)) ||
|
||||
|
@ -525,23 +524,19 @@ bool QCodeCompletionModel::match(QCodeNode *n,
|
|||
((visibility == QCodeNode::VISIBILITY_PUBLIC) &&
|
||||
!(filter & QCodeCompletionWidget::Public)) ||
|
||||
((type == QCodeNode::Variable) &&
|
||||
(((specifiers & QCodeNode::SPECIFIER_STATIC) &&
|
||||
!(filter & QCodeCompletionWidget::KeepStatic)) ||
|
||||
((!(filter & QCodeCompletionWidget::KeepStatic)) ||
|
||||
((specifiers & QCodeNode::SPECIFIER_CONST) &&
|
||||
!(filter & QCodeCompletionWidget::KeepConst)) ||
|
||||
(!(specifiers & QCodeNode::SPECIFIER_STATIC) &&
|
||||
(filter & QCodeCompletionWidget::IsStatic))
|
||||
((filter & QCodeCompletionWidget::IsStatic))
|
||||
// ||
|
||||
// (!(specifiers & QCodeNode::SPECIFIER_CONST) &&
|
||||
//(filter & QCodeCompletionWidget::IsConst))
|
||||
)) ||
|
||||
((type == QCodeNode::Function) &&
|
||||
(((qualifiers & QCodeNode::QUALIFIER_STATIC) &&
|
||||
!(filter & QCodeCompletionWidget::KeepStatic)) ||
|
||||
((!(filter & QCodeCompletionWidget::KeepStatic)) ||
|
||||
((qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
||||
!(filter & QCodeCompletionWidget::KeepConst)) ||
|
||||
(!(qualifiers & QCodeNode::QUALIFIER_STATIC) &&
|
||||
(filter & QCodeCompletionWidget::IsStatic) &&
|
||||
((filter & QCodeCompletionWidget::IsStatic) &&
|
||||
(n->parent->type() != QCodeNode::Namespace)) ||
|
||||
(!(qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
||||
(filter & QCodeCompletionWidget::IsConst)) ||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QFile>
|
||||
#include <QPixmap>
|
||||
|
||||
#include "qlanguagefactory.h"
|
||||
#include "qlinemarkpanel.h"
|
||||
#include "qlinenumberpanel.h"
|
||||
#include "qpanellayout.h"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <QTimerEvent>
|
||||
#include <QWindow>
|
||||
|
||||
#include "../class/eventfilter.h"
|
||||
#include "class/eventfilter.h"
|
||||
|
||||
int Toast::LENGTH_LONG = 4000;
|
||||
int Toast::LENGTH_SHORT = 1500;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "QWingRibbon/ribbontabcontent.h"
|
||||
#include "Qt-Advanced-Docking-System/src/DockAreaWidget.h"
|
||||
#include "aboutsoftwaredialog.h"
|
||||
#include "class/ascompletion.h"
|
||||
#include "class/languagemanager.h"
|
||||
#include "class/qkeysequences.h"
|
||||
#include "class/settingmanager.h"
|
||||
|
@ -11,6 +12,8 @@
|
|||
#include "class/wingmessagebox.h"
|
||||
#include "control/toast.h"
|
||||
#include "qcodeeditwidget/qeditconfig.h"
|
||||
#include "qcodeloader.h"
|
||||
#include "qcodemodel.h"
|
||||
#include "qdocumentline.h"
|
||||
#include "qeditor.h"
|
||||
#include "qformatscheme.h"
|
||||
|
@ -73,8 +76,22 @@ ScriptingDialog::ScriptingDialog(QWidget *parent)
|
|||
break;
|
||||
}
|
||||
QDocument::setDefaultFormatScheme(format);
|
||||
|
||||
m_codeModel = new QCodeModel(this);
|
||||
m_codeModel->setCodeLoader(new QCodeLoader(this));
|
||||
|
||||
// m_codeProxy = new QCodeProxyModel(this);
|
||||
// m_codeProxy->setSourceModel(m_codeModel);
|
||||
// m_codeProxy->setDynamicSortFilter(true);
|
||||
|
||||
// m_codeView = new QCodeView(this);
|
||||
// m_codeView->setModel(m_codeProxy);
|
||||
// m_codeView->setSortingEnabled(true);
|
||||
// m_codeView->header()->hide();
|
||||
|
||||
m_language = new QLanguageFactory(format, this);
|
||||
m_language->addDefinitionPath(QStringLiteral(":/qcodeedit"));
|
||||
m_language->addCompletionEngine(new AsCompletion(m_codeModel, this));
|
||||
|
||||
auto lmic = QLineMarksInfoCenter::instance();
|
||||
lmic->loadMarkTypes(QCE::fetchDataFile(":/qcodeedit/marks.qxm"));
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "model/dbgbreakpointmodel.h"
|
||||
#include "model/dbgcallstackmodel.h"
|
||||
#include "model/dbgvarshowmodel.h"
|
||||
#include "qcodeproxymodel.h"
|
||||
#include "qcodeview.h"
|
||||
#include "qlanguagefactory.h"
|
||||
#include "utilities.h"
|
||||
|
||||
|
@ -233,6 +235,9 @@ private:
|
|||
ads::CDockManager *m_dock = nullptr;
|
||||
ads::CDockAreaWidget *m_editorViewArea = nullptr;
|
||||
QLanguageFactory *m_language = nullptr;
|
||||
QCodeView *m_codeView = nullptr;
|
||||
QCodeModel *m_codeModel = nullptr;
|
||||
QCodeProxyModel *m_codeProxy = nullptr;
|
||||
QByteArray _defaultLayout;
|
||||
|
||||
ScriptEditor *m_curEditor = nullptr;
|
||||
|
|