basicly done
This commit is contained in:
parent
2a18f3f47a
commit
6b891a6626
|
@ -287,7 +287,6 @@ void Editor::loadFile(QString filename) {
|
||||||
checkSyntaxInBack();
|
checkSyntaxInBack();
|
||||||
}
|
}
|
||||||
reparseTodo();
|
reparseTodo();
|
||||||
|
|
||||||
saveAutoBackup();
|
saveAutoBackup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1041,11 +1040,12 @@ void Editor::keyPressEvent(QKeyEvent *event)
|
||||||
return;
|
return;
|
||||||
case '(': {
|
case '(': {
|
||||||
if (!selAvail()) {
|
if (!selAvail()) {
|
||||||
QChar nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
|
// QChar nextCh = nextNonSpaceChar(caretY()-1,caretX()-1);
|
||||||
if (!isIdentChar(nextCh) && nextCh!='('
|
// if (!isIdentChar(nextCh) && nextCh!='('
|
||||||
&& nextCh!='"' && nextCh!='\'' ){
|
// && nextCh!='"' && nextCh!='\'' ){
|
||||||
handled = handleSymbolCompletion(ch);
|
// handled = handleSymbolCompletion(ch);
|
||||||
}
|
// }
|
||||||
|
handled = handleSymbolCompletion(ch);
|
||||||
} else {
|
} else {
|
||||||
handled = handleSymbolCompletion(ch);
|
handled = handleSymbolCompletion(ch);
|
||||||
}
|
}
|
||||||
|
@ -3513,6 +3513,57 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete, CodeComple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scan the current function body
|
||||||
|
QSet<QString> keywords;
|
||||||
|
|
||||||
|
if (syntaxer()->language() != QSynedit::ProgrammingLanguage::CPP ) {
|
||||||
|
if (syntaxer()->language()==QSynedit::ProgrammingLanguage::ATTAssembly) {
|
||||||
|
if (word.startsWith("."))
|
||||||
|
keywords = QSynedit::ASMSyntaxer::ATTDirectives;
|
||||||
|
else if (word.startsWith("%"))
|
||||||
|
keywords = QSynedit::ASMSyntaxer::ATTRegisters;
|
||||||
|
else {
|
||||||
|
keywords = QSynedit::ASMSyntaxer::InstructionNames;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int pos = word.lastIndexOf(".");
|
||||||
|
if (pos>=0) {
|
||||||
|
QString scopeWord=word.left(pos);
|
||||||
|
word = word.mid(pos+1);
|
||||||
|
QMap<QString, QSet<QString> > scopedKeywords = syntaxer()->scopedKeywords();
|
||||||
|
keywords = scopedKeywords.value(scopeWord, QSet<QString>());
|
||||||
|
} else
|
||||||
|
keywords = syntaxer()->keywords();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch(calcParserLanguage()) {
|
||||||
|
case ParserLanguage::CPlusPlus:
|
||||||
|
foreach (const QString& keyword, CppKeywords.keys()) {
|
||||||
|
keywords.insert(keyword);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ParserLanguage::C:
|
||||||
|
keywords = CKeywords;
|
||||||
|
break;
|
||||||
|
#ifdef ENABLE_SDCC
|
||||||
|
case ParserLanguage::SDCC:
|
||||||
|
keywords = CKeywords;
|
||||||
|
foreach (const QString& keyword, SDCCKeywords.keys()) {
|
||||||
|
keywords.insert(keyword);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (pSettings->editor().enableCustomCTypeKeywords()) {
|
||||||
|
foreach (const QString& keyword, pSettings->editor().customCTypeKeywords()) {
|
||||||
|
keywords.insert(keyword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == CodeCompletionType::KeywordsOnly && keywords.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
mCompletionPopup->setRecordUsage(pSettings->codeCompletion().recordUsage());
|
mCompletionPopup->setRecordUsage(pSettings->codeCompletion().recordUsage());
|
||||||
mCompletionPopup->setSortByScope(pSettings->codeCompletion().sortByScope());
|
mCompletionPopup->setSortByScope(pSettings->codeCompletion().sortByScope());
|
||||||
mCompletionPopup->setShowKeywords(pSettings->codeCompletion().showKeywords());
|
mCompletionPopup->setShowKeywords(pSettings->codeCompletion().showKeywords());
|
||||||
|
@ -3566,54 +3617,6 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete, CodeComple
|
||||||
}
|
}
|
||||||
pMainWindow->functionTip()->hide();
|
pMainWindow->functionTip()->hide();
|
||||||
mCompletionPopup->show();
|
mCompletionPopup->show();
|
||||||
// Scan the current function body
|
|
||||||
QSet<QString> keywords;
|
|
||||||
|
|
||||||
if (syntaxer()->language() != QSynedit::ProgrammingLanguage::CPP ) {
|
|
||||||
if (syntaxer()->language()==QSynedit::ProgrammingLanguage::ATTAssembly) {
|
|
||||||
if (word.startsWith("."))
|
|
||||||
keywords = QSynedit::ASMSyntaxer::ATTDirectives;
|
|
||||||
else if (word.startsWith("%"))
|
|
||||||
keywords = QSynedit::ASMSyntaxer::ATTRegisters;
|
|
||||||
else {
|
|
||||||
keywords = QSynedit::ASMSyntaxer::InstructionNames;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int pos = word.lastIndexOf(".");
|
|
||||||
if (pos>=0) {
|
|
||||||
QString scopeWord=word.left(pos);
|
|
||||||
word = word.mid(pos+1);
|
|
||||||
QMap<QString, QSet<QString> > scopedKeywords = syntaxer()->scopedKeywords();
|
|
||||||
keywords = scopedKeywords.value(scopeWord, QSet<QString>());
|
|
||||||
} else
|
|
||||||
keywords = syntaxer()->keywords();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(calcParserLanguage()) {
|
|
||||||
case ParserLanguage::CPlusPlus:
|
|
||||||
foreach (const QString& keyword, CppKeywords.keys()) {
|
|
||||||
keywords.insert(keyword);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ParserLanguage::C:
|
|
||||||
keywords = CKeywords;
|
|
||||||
break;
|
|
||||||
#ifdef ENABLE_SDCC
|
|
||||||
case ParserLanguage::SDCC:
|
|
||||||
keywords = CKeywords;
|
|
||||||
foreach (const QString& keyword, SDCCKeywords.keys()) {
|
|
||||||
keywords.insert(keyword);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (pSettings->editor().enableCustomCTypeKeywords()) {
|
|
||||||
foreach (const QString& keyword, pSettings->editor().customCTypeKeywords()) {
|
|
||||||
keywords.insert(keyword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (word.isEmpty()) {
|
if (word.isEmpty()) {
|
||||||
//word=getWordAtPosition(this,caretXY(),pBeginPos,pEndPos, WordPurpose::wpCompletion);
|
//word=getWordAtPosition(this,caretXY(),pBeginPos,pEndPos, WordPurpose::wpCompletion);
|
||||||
|
|
|
@ -566,7 +566,7 @@ signals:
|
||||||
void cleared();
|
void cleared();
|
||||||
void deleted(int startLine, int count);
|
void deleted(int startLine, int count);
|
||||||
void inserted(int startLine, int count);
|
void inserted(int startLine, int count);
|
||||||
void putted(int startLine, int count);
|
void putted(int line);
|
||||||
protected:
|
protected:
|
||||||
QString getTextStr() const;
|
QString getTextStr() const;
|
||||||
void setUpdateState(bool Updating);
|
void setUpdateState(bool Updating);
|
||||||
|
|
|
@ -970,7 +970,6 @@ void QSynEditPainter::paintLines()
|
||||||
int lineWidth;
|
int lineWidth;
|
||||||
QList<int> glyphStartCharList = mEdit->mDocument->getGlyphStartCharList(vLine-1,sLine);
|
QList<int> glyphStartCharList = mEdit->mDocument->getGlyphStartCharList(vLine-1,sLine);
|
||||||
QList<int> glyphStartPositionsList = mEdit->mDocument->getGlyphStartPositionList(vLine-1,sLine, lineWidth);
|
QList<int> glyphStartPositionsList = mEdit->mDocument->getGlyphStartPositionList(vLine-1,sLine, lineWidth);
|
||||||
{
|
|
||||||
// Initialize highlighter with line text and range info. It is
|
// Initialize highlighter with line text and range info. It is
|
||||||
// necessary because we probably did not scan to the end of the last
|
// necessary because we probably did not scan to the end of the last
|
||||||
// line - the internal highlighter range might be wrong.
|
// line - the internal highlighter range might be wrong.
|
||||||
|
|
|
@ -328,7 +328,7 @@ bool QSynEdit::canRedo() const
|
||||||
int QSynEdit::maxScrollWidth() const
|
int QSynEdit::maxScrollWidth() const
|
||||||
{
|
{
|
||||||
int maxWidth = mDocument->longestLineWidth();
|
int maxWidth = mDocument->longestLineWidth();
|
||||||
if (mSyntaxer->supportFolding())
|
if (useCodeFolding())
|
||||||
maxWidth += stringWidth(syntaxer()->foldString(""),maxWidth);
|
maxWidth += stringWidth(syntaxer()->foldString(""),maxWidth);
|
||||||
if (mOptions.testFlag(eoScrollPastEol))
|
if (mOptions.testFlag(eoScrollPastEol))
|
||||||
return std::max(maxWidth ,1);
|
return std::max(maxWidth ,1);
|
||||||
|
@ -3478,7 +3478,7 @@ void QSynEdit::findSubFoldRange(PCodeFoldingRanges topFoldRanges, PCodeFoldingRa
|
||||||
PCodeFoldingRange collapsedFold;
|
PCodeFoldingRange collapsedFold;
|
||||||
int line = 0;
|
int line = 0;
|
||||||
QString curLine;
|
QString curLine;
|
||||||
if (mSyntaxer->supportFolding())
|
if (!useCodeFolding())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (line < mDocument->count()) { // index is valid for LinesToScan and fLines
|
while (line < mDocument->count()) { // index is valid for LinesToScan and fLines
|
||||||
|
@ -6596,18 +6596,18 @@ void QSynEdit::onLinesCleared()
|
||||||
|
|
||||||
void QSynEdit::onLinesDeleted(int line, int count)
|
void QSynEdit::onLinesDeleted(int line, int count)
|
||||||
{
|
{
|
||||||
if (mUseCodeFolding)
|
if (useCodeFolding())
|
||||||
foldOnLinesDeleted(line + 1, count);
|
foldOnLinesDeleted(line + 1, count);
|
||||||
if (mSyntaxer->needsLineState()) {
|
if (mSyntaxer->needsLineState()) {
|
||||||
reparseLines(line, mDocument->count());
|
reparseLines(line, mDocument->count());
|
||||||
}
|
}
|
||||||
invalidateLines(line + 1, INT_MAX);
|
invalidateLines(line + 1, INT_MAX);
|
||||||
// invalidateGutterLines(index + 1, INT_MAX);
|
//invalidateGutterLines(line + 1, INT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSynEdit::onLinesInserted(int line, int count)
|
void QSynEdit::onLinesInserted(int line, int count)
|
||||||
{
|
{
|
||||||
if (mUseCodeFolding)
|
if (useCodeFolding())
|
||||||
foldOnLinesInserted(line + 1, count);
|
foldOnLinesInserted(line + 1, count);
|
||||||
if (mSyntaxer->needsLineState()) {
|
if (mSyntaxer->needsLineState()) {
|
||||||
reparseLines(line, mDocument->count());
|
reparseLines(line, mDocument->count());
|
||||||
|
@ -6616,7 +6616,7 @@ void QSynEdit::onLinesInserted(int line, int count)
|
||||||
reparseLines(line, line + count);
|
reparseLines(line, line + count);
|
||||||
}
|
}
|
||||||
invalidateLines(line + 1, INT_MAX);
|
invalidateLines(line + 1, INT_MAX);
|
||||||
// invalidateGutterLines(index + 1, INT_MAX);
|
//invalidateGutterLines(line + 1, INT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSynEdit::onLinesPutted(int line)
|
void QSynEdit::onLinesPutted(int line)
|
||||||
|
@ -6624,9 +6624,11 @@ void QSynEdit::onLinesPutted(int line)
|
||||||
if (mSyntaxer->needsLineState()) {
|
if (mSyntaxer->needsLineState()) {
|
||||||
reparseLines(line, mDocument->count());
|
reparseLines(line, mDocument->count());
|
||||||
invalidateLines(line + 1, INT_MAX);
|
invalidateLines(line + 1, INT_MAX);
|
||||||
|
//invalidateGutterLines(line +1 , INT_MAX);
|
||||||
} else {
|
} else {
|
||||||
reparseLines(line, line+1);
|
reparseLines(line, line+1);
|
||||||
invalidateLine( line + 1 );
|
invalidateLine( line + 1 );
|
||||||
|
//invalidateGutterLine(line +1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6711,7 +6713,7 @@ void QSynEdit::setBlockEnd(BufferCoord value)
|
||||||
value.ch = 1;
|
value.ch = 1;
|
||||||
} else {
|
} else {
|
||||||
int maxLen = mDocument->longestLineWidth();
|
int maxLen = mDocument->longestLineWidth();
|
||||||
if (mSyntaxer->supportFolding())
|
if (useCodeFolding())
|
||||||
maxLen += stringWidth(mSyntaxer->foldString(""),maxLen);
|
maxLen += stringWidth(mSyntaxer->foldString(""),maxLen);
|
||||||
value.ch = minMax(value.ch, 1, maxLen+1);
|
value.ch = minMax(value.ch, 1, maxLen+1);
|
||||||
}
|
}
|
||||||
|
@ -6818,7 +6820,7 @@ void QSynEdit::setBlockBegin(BufferCoord value)
|
||||||
value.ch = 1;
|
value.ch = 1;
|
||||||
} else {
|
} else {
|
||||||
int maxLen = mDocument->longestLineWidth();
|
int maxLen = mDocument->longestLineWidth();
|
||||||
if (mSyntaxer->supportFolding())
|
if (useCodeFolding())
|
||||||
maxLen += stringWidth(mSyntaxer->foldString(""),maxLen);
|
maxLen += stringWidth(mSyntaxer->foldString(""),maxLen);
|
||||||
value.ch = minMax(value.ch, 1, maxLen+1);
|
value.ch = minMax(value.ch, 1, maxLen+1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,7 +533,7 @@ private:
|
||||||
QString expandAtWideGlyphs(const QString& S);
|
QString expandAtWideGlyphs(const QString& S);
|
||||||
void updateModifiedStatus();
|
void updateModifiedStatus();
|
||||||
void reparseLines(int startLine, int endLine);
|
void reparseLines(int startLine, int endLine);
|
||||||
void reparseLine(int line);
|
//void reparseLine(int line);
|
||||||
void reparseDocument();
|
void reparseDocument();
|
||||||
void uncollapse(PCodeFoldingRange FoldRange);
|
void uncollapse(PCodeFoldingRange FoldRange);
|
||||||
void collapse(PCodeFoldingRange FoldRange);
|
void collapse(PCodeFoldingRange FoldRange);
|
||||||
|
@ -657,7 +657,7 @@ private slots:
|
||||||
void onLinesCleared();
|
void onLinesCleared();
|
||||||
void onLinesDeleted(int line, int count);
|
void onLinesDeleted(int line, int count);
|
||||||
void onLinesInserted(int line, int count);
|
void onLinesInserted(int line, int count);
|
||||||
void onLinesPutted(int line, int count);
|
void onLinesPutted(int line);
|
||||||
//void onRedoAdded();
|
//void onRedoAdded();
|
||||||
void onScrollTimeout();
|
void onScrollTimeout();
|
||||||
void onDraggingScrollTimeout();
|
void onDraggingScrollTimeout();
|
||||||
|
|
|
@ -106,23 +106,18 @@ public:
|
||||||
void next() override;
|
void next() override;
|
||||||
void setLine(const QString &newLine, int lineNumber) override;
|
void setLine(const QString &newLine, int lineNumber) override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
bool isCommentNotFinished(int state) const override;
|
bool isCommentNotFinished(int state) const override;
|
||||||
bool isStringNotFinished(int state) const override;
|
bool isStringNotFinished(int state) const override;
|
||||||
SyntaxState getState() const override;
|
SyntaxState getState() const override;
|
||||||
void setState(const SyntaxState& rangeState) override;
|
void setState(const SyntaxState& rangeState) override;
|
||||||
void resetState() override;
|
void resetState() override;
|
||||||
|
|
||||||
|
bool supportFolding() override;
|
||||||
public:
|
bool needsLineState() override;
|
||||||
QSet<QString> keywords() override;
|
QSet<QString> keywords() override;
|
||||||
|
|
||||||
bool isATT() const;
|
bool isATT() const;
|
||||||
void setATT(bool newATT);
|
void setATT(bool newATT);
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QString commentSymbol() override;
|
QString commentSymbol() override;
|
||||||
QString blockCommentBeginSymbol() override;
|
QString blockCommentBeginSymbol() override;
|
||||||
QString blockCommentEndSymbol() override;
|
QString blockCommentEndSymbol() override;
|
||||||
|
|
|
@ -175,7 +175,7 @@ private:
|
||||||
PTokenAttribute mGlobalVarAttribute;
|
PTokenAttribute mGlobalVarAttribute;
|
||||||
PTokenAttribute mLocalVarAttribute;
|
PTokenAttribute mLocalVarAttribute;
|
||||||
|
|
||||||
// SynHighligterBase interface
|
// Syntaxer interface
|
||||||
public:
|
public:
|
||||||
bool isCommentNotFinished(int state) const override;
|
bool isCommentNotFinished(int state) const override;
|
||||||
bool isStringNotFinished(int state) const override;
|
bool isStringNotFinished(int state) const override;
|
||||||
|
@ -193,34 +193,21 @@ public:
|
||||||
QString languageName() override;
|
QString languageName() override;
|
||||||
ProgrammingLanguage language() override;
|
ProgrammingLanguage language() override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
SyntaxState getState() const override;
|
SyntaxState getState() const override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
bool isIdentChar(const QChar &ch) const override;
|
bool isIdentChar(const QChar &ch) const override;
|
||||||
bool isIdentStartChar(const QChar &ch) const override;
|
bool isIdentStartChar(const QChar &ch) const override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
QSet<QString> keywords() override;
|
QSet<QString> keywords() override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
QString foldString(QString startLine) override;
|
QString foldString(QString startLine) override;
|
||||||
const QSet<QString> &customTypeKeywords() const;
|
const QSet<QString> &customTypeKeywords() const;
|
||||||
void setCustomTypeKeywords(const QSet<QString> &newCustomTypeKeywords);
|
void setCustomTypeKeywords(const QSet<QString> &newCustomTypeKeywords);
|
||||||
|
|
||||||
// Highlighter interface
|
|
||||||
public:
|
|
||||||
bool supportBraceLevel() override;
|
bool supportBraceLevel() override;
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QString commentSymbol() override;
|
QString commentSymbol() override;
|
||||||
QString blockCommentBeginSymbol() override;
|
QString blockCommentBeginSymbol() override;
|
||||||
QString blockCommentEndSymbol() override;
|
QString blockCommentEndSymbol() override;
|
||||||
|
virtual bool supportFolding() override;
|
||||||
|
virtual bool needsLineState() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1446,6 +1446,6 @@ bool GLSLSyntaxer::supportFolding()
|
||||||
|
|
||||||
bool GLSLSyntaxer::needsLineState()
|
bool GLSLSyntaxer::needsLineState()
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,24 +175,14 @@ public:
|
||||||
|
|
||||||
QString languageName() override;
|
QString languageName() override;
|
||||||
ProgrammingLanguage language() override;
|
ProgrammingLanguage language() override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
SyntaxState getState() const override;
|
SyntaxState getState() const override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
QSet<QString> keywords() override;
|
QSet<QString> keywords() override;
|
||||||
|
|
||||||
// Highlighter interface
|
|
||||||
public:
|
|
||||||
bool supportBraceLevel() override;
|
bool supportBraceLevel() override;
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QString commentSymbol() override;
|
QString commentSymbol() override;
|
||||||
QString blockCommentBeginSymbol() override;
|
QString blockCommentBeginSymbol() override;
|
||||||
QString blockCommentEndSymbol() override;
|
QString blockCommentEndSymbol() override;
|
||||||
|
bool supportFolding() override;
|
||||||
|
bool needsLineState() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ private:
|
||||||
PTokenAttribute mStringEscapeSequenceAttribute;
|
PTokenAttribute mStringEscapeSequenceAttribute;
|
||||||
PTokenAttribute mCharAttribute;
|
PTokenAttribute mCharAttribute;
|
||||||
|
|
||||||
// SynHighligterBase interface
|
|
||||||
public:
|
public:
|
||||||
bool isCommentNotFinished(int state) const override;
|
bool isCommentNotFinished(int state) const override;
|
||||||
bool isStringNotFinished(int state) const override;
|
bool isStringNotFinished(int state) const override;
|
||||||
|
@ -154,41 +154,23 @@ public:
|
||||||
|
|
||||||
QString languageName() override;
|
QString languageName() override;
|
||||||
ProgrammingLanguage language() override;
|
ProgrammingLanguage language() override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
SyntaxState getState() const override;
|
SyntaxState getState() const override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
bool isIdentChar(const QChar &ch) const override;
|
bool isIdentChar(const QChar &ch) const override;
|
||||||
bool isIdentStartChar(const QChar& ch) const override;
|
bool isIdentStartChar(const QChar& ch) const override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
QSet<QString> keywords() override;
|
QSet<QString> keywords() override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
QString foldString(QString startLine) override;
|
QString foldString(QString startLine) override;
|
||||||
const QSet<QString> &customTypeKeywords() const;
|
const QSet<QString> &customTypeKeywords() const;
|
||||||
void setCustomTypeKeywords(const QSet<QString> &newCustomTypeKeywords);
|
void setCustomTypeKeywords(const QSet<QString> &newCustomTypeKeywords);
|
||||||
|
|
||||||
// Highlighter interface
|
|
||||||
public:
|
|
||||||
bool supportBraceLevel() override;
|
bool supportBraceLevel() override;
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QMap<QString, QSet<QString> > scopedKeywords() override;
|
QMap<QString, QSet<QString> > scopedKeywords() override;
|
||||||
bool useXMakeLibs() const;
|
bool useXMakeLibs() const;
|
||||||
void setUseXMakeLibs(bool newUseXMakeLibs);
|
void setUseXMakeLibs(bool newUseXMakeLibs);
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QString commentSymbol() override;
|
QString commentSymbol() override;
|
||||||
QString blockCommentBeginSymbol() override;
|
QString blockCommentBeginSymbol() override;
|
||||||
QString blockCommentEndSymbol() override;
|
QString blockCommentEndSymbol() override;
|
||||||
|
bool supportFolding() override;
|
||||||
|
bool needsLineState() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,6 @@ private:
|
||||||
return (ch>='0') && (ch<='9');
|
return (ch>='0') && (ch<='9');
|
||||||
}
|
}
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
public:
|
||||||
bool eol() const override;
|
bool eol() const override;
|
||||||
|
|
||||||
|
@ -142,23 +141,17 @@ public:
|
||||||
int getTokenPos() override;
|
int getTokenPos() override;
|
||||||
void next() override;
|
void next() override;
|
||||||
void setLine(const QString &newLine, int lineNumber) override;
|
void setLine(const QString &newLine, int lineNumber) override;
|
||||||
|
|
||||||
// SynHighlighter interface
|
|
||||||
public:
|
|
||||||
bool isCommentNotFinished(int state) const override;
|
bool isCommentNotFinished(int state) const override;
|
||||||
bool isStringNotFinished(int state) const override;
|
bool isStringNotFinished(int state) const override;
|
||||||
SyntaxState getState() const override;
|
SyntaxState getState() const override;
|
||||||
void setState(const SyntaxState& rangeState) override;
|
void setState(const SyntaxState& rangeState) override;
|
||||||
void resetState() override;
|
void resetState() override;
|
||||||
|
|
||||||
bool isIdentChar(const QChar& ch) const override;
|
bool isIdentChar(const QChar& ch) const override;
|
||||||
public:
|
|
||||||
QSet<QString> keywords() override;
|
QSet<QString> keywords() override;
|
||||||
|
|
||||||
|
|
||||||
// Syntaxer interface
|
|
||||||
public:
|
|
||||||
QString commentSymbol() override;
|
QString commentSymbol() override;
|
||||||
|
bool supportFolding() override;
|
||||||
|
bool needsLineState() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
namespace QSynedit {
|
namespace QSynedit {
|
||||||
Syntaxer::Syntaxer() :
|
Syntaxer::Syntaxer() :
|
||||||
mEnabled(true),
|
|
||||||
mWordBreakChars{ WordBreakChars }
|
mWordBreakChars{ WordBreakChars }
|
||||||
{
|
{
|
||||||
mCommentAttribute = std::make_shared<TokenAttribute>(SYNS_AttrComment,
|
mCommentAttribute = std::make_shared<TokenAttribute>(SYNS_AttrComment,
|
||||||
|
@ -42,7 +41,7 @@ Syntaxer::Syntaxer() :
|
||||||
addAttribute(mSymbolAttribute);
|
addAttribute(mSymbolAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QMap<QString, PTokenAttribute>& Syntaxer::attributes() const
|
QMap<QString, PTokenAttribute> Syntaxer::attributes() const
|
||||||
{
|
{
|
||||||
return mAttributes;
|
return mAttributes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ public:
|
||||||
Syntaxer(const Syntaxer&)=delete;
|
Syntaxer(const Syntaxer&)=delete;
|
||||||
Syntaxer& operator=(const Syntaxer&)=delete;
|
Syntaxer& operator=(const Syntaxer&)=delete;
|
||||||
|
|
||||||
virtual const QMap<QString, PTokenAttribute>& attributes() const;
|
virtual QMap<QString, PTokenAttribute> attributes() const;
|
||||||
|
|
||||||
const QSet<QChar>& wordBreakChars() const;
|
const QSet<QChar>& wordBreakChars() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue