Adaug proiectul Unity

This commit is contained in:
2026-11-01 23:39:55 +02:00
parent cb14d9d37d
commit 863eac8f2c
23463 changed files with 5412601 additions and 0 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e94d841ac526d47e18fcda89e02906be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,99 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using Unity.CodeEditor.Document;
namespace Unity.CodeEditor.Indentation.CSharp
{
/// <summary>
/// Smart indentation for C#.
/// </summary>
internal class CSharpIndentationStrategy : DefaultIndentationStrategy
{
/// <summary>
/// Creates a new CSharpIndentationStrategy.
/// </summary>
internal CSharpIndentationStrategy()
{
}
/// <summary>
/// Creates a new CSharpIndentationStrategy and initializes the settings using the text editor options.
/// </summary>
internal CSharpIndentationStrategy(TextEditorOptions options)
{
IndentationString = options.IndentationString;
}
private string _indentationString = "\t";
/// <summary>
/// Gets/Sets the indentation string.
/// </summary>
internal string IndentationString
{
get => _indentationString;
set
{
if (string.IsNullOrEmpty(value))
throw new ArgumentException("Indentation string must not be null or empty");
_indentationString = value;
}
}
/// <summary>
/// Performs indentation using the specified document accessor.
/// </summary>
/// <param name="document">Object used for accessing the document line-by-line</param>
/// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
internal void Indent(IDocumentAccessor document, bool keepEmptyLines)
{
if (document == null) throw new ArgumentNullException(nameof(document));
var settings = new IndentationSettings
{
IndentString = IndentationString,
LeaveEmptyLines = keepEmptyLines
};
var r = new IndentationReformatter();
r.Reformat(document, settings);
}
/// <inheritdoc cref="IIndentationStrategy.IndentLine"/>
public override void IndentLine(TextDocument document, DocumentLine line)
{
var lineNr = line.LineNumber;
var acc = new TextDocumentAccessor(document, lineNr, lineNr);
Indent(acc, false);
var t = acc.Text;
if (t.Length == 0)
{
// use AutoIndentation for new lines in comments / verbatim strings.
base.IndentLine(document, line);
}
}
/// <inheritdoc cref="IIndentationStrategy.IndentLines"/>
public override void IndentLines(TextDocument document, int beginLine, int endLine)
{
Indent(new TextDocumentAccessor(document, beginLine, endLine), true);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14b3605f9aeca40c1b4f815f4fb0229f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,107 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using Unity.CodeEditor.Document;
namespace Unity.CodeEditor.Indentation.CSharp
{
/// <summary>
/// Interface used for the indentation class to access the document.
/// </summary>
internal interface IDocumentAccessor
{
/// <summary>Gets if the current line is read only (because it is not in the
/// selected text region)</summary>
bool IsReadOnly { get; }
/// <summary>Gets the number of the current line.</summary>
int LineNumber { get; }
/// <summary>Gets/Sets the text of the current line.</summary>
string Text { get; set; }
/// <summary>Advances to the next line.</summary>
bool MoveNext();
}
#region TextDocumentAccessor
/// <summary>
/// Adapter IDocumentAccessor -> TextDocument
/// </summary>
internal sealed class TextDocumentAccessor : IDocumentAccessor
{
private readonly TextDocument _doc;
private readonly int _minLine;
private readonly int _maxLine;
/// <summary>
/// Creates a new TextDocumentAccessor.
/// </summary>
internal TextDocumentAccessor(TextDocument document)
{
_doc = document ?? throw new ArgumentNullException(nameof(document));
_minLine = 1;
_maxLine = _doc.LineCount;
}
/// <summary>
/// Creates a new TextDocumentAccessor that indents only a part of the document.
/// </summary>
internal TextDocumentAccessor(TextDocument document, int minLine, int maxLine)
{
_doc = document ?? throw new ArgumentNullException(nameof(document));
_minLine = minLine;
_maxLine = maxLine;
}
private int _num;
private string _text;
private DocumentLine _line;
/// <inheritdoc/>
public bool IsReadOnly => _num < _minLine;
/// <inheritdoc/>
public int LineNumber => _num;
private bool _lineDirty;
/// <inheritdoc/>
public string Text {
get => _text;
set {
if (_num < _minLine) return;
_text = value;
_lineDirty = true;
}
}
/// <inheritdoc/>
public bool MoveNext()
{
if (_lineDirty) {
_doc.Replace(_line, _text);
_lineDirty = false;
}
++_num;
if (_num > _maxLine) return false;
_line = _doc.GetLineByNumber(_num);
_text = _doc.GetText(_line);
return true;
}
}
#endregion
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4b5d1e8d707974fa7a2ab46951e4afea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,531 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace Unity.CodeEditor.Indentation.CSharp
{
internal sealed class IndentationSettings
{
internal string IndentString { get; set; } = "\t";
internal bool LeaveEmptyLines { get; set; } = true;
}
internal sealed class IndentationReformatter
{
/// <summary>
/// An indentation block. Tracks the state of the indentation.
/// </summary>
private struct Block
{
/// <summary>
/// The indentation outside of the block.
/// </summary>
internal string OuterIndent;
/// <summary>
/// The indentation inside the block.
/// </summary>
internal string InnerIndent;
/// <summary>
/// The last word that was seen inside this block.
/// Because parenthesis open a sub-block and thus don't change their parent's LastWord,
/// this property can be used to identify the type of block statement (if, while, switch)
/// at the position of the '{'.
/// </summary>
internal string LastWord;
/// <summary>
/// The type of bracket that opened this block (, [ or {
/// </summary>
internal char Bracket;
/// <summary>
/// Gets whether there's currently a line continuation going on inside this block.
/// </summary>
internal bool Continuation;
/// <summary>
/// Gets whether there's currently a 'one-line-block' going on. 'one-line-blocks' occur
/// with if statements that don't use '{}'. They are not represented by a Block instance on
/// the stack, but are instead handled similar to line continuations.
/// This property is an integer because there might be multiple nested one-line-blocks.
/// As soon as there is a finished statement, OneLineBlock is reset to 0.
/// </summary>
internal int OneLineBlock;
/// <summary>
/// The previous value of one-line-block before it was reset.
/// Used to restore the indentation of 'else' to the correct level.
/// </summary>
internal int PreviousOneLineBlock;
internal void ResetOneLineBlock()
{
PreviousOneLineBlock = OneLineBlock;
OneLineBlock = 0;
}
/// <summary>
/// Gets the line number where this block started.
/// </summary>
internal int StartLine;
internal void Indent(IndentationSettings set)
{
Indent(set.IndentString);
}
internal void Indent(string indentationString)
{
OuterIndent = InnerIndent;
InnerIndent += indentationString;
Continuation = false;
ResetOneLineBlock();
LastWord = "";
}
public override string ToString()
{
return string.Format(
CultureInfo.InvariantCulture,
"[Block StartLine={0}, LastWord='{1}', Continuation={2}, OneLineBlock={3}, PreviousOneLineBlock={4}]",
StartLine, LastWord, Continuation, OneLineBlock, PreviousOneLineBlock);
}
}
private StringBuilder _wordBuilder;
private Stack<Block> _blocks; // blocks contains all blocks outside of the current
private Block _block; // block is the current block
private bool _inString;
private bool _inChar;
private bool _verbatim;
private bool _escape;
private bool _lineComment;
private bool _blockComment;
private char _lastRealChar; // last non-comment char
internal void Reformat(IDocumentAccessor doc, IndentationSettings set)
{
Init();
while (doc.MoveNext())
{
Step(doc, set);
}
}
internal void Init()
{
_wordBuilder = new StringBuilder();
_blocks = new Stack<Block>();
_block = new Block
{
InnerIndent = "",
OuterIndent = "",
Bracket = '{',
Continuation = false,
LastWord = "",
OneLineBlock = 0,
PreviousOneLineBlock = 0,
StartLine = 0
};
_inString = false;
_inChar = false;
_verbatim = false;
_escape = false;
_lineComment = false;
_blockComment = false;
_lastRealChar = ' '; // last non-comment char
}
internal void Step(IDocumentAccessor doc, IndentationSettings set)
{
var line = doc.Text;
if (set.LeaveEmptyLines && line.Length == 0) return; // leave empty lines empty
line = line.TrimStart();
var indent = new StringBuilder();
if (line.Length == 0)
{
// Special treatment for empty lines:
if (_blockComment || (_inString && _verbatim))
return;
indent.Append(_block.InnerIndent);
indent.Append(Repeat(set.IndentString, _block.OneLineBlock));
if (doc.Text != indent.ToString())
doc.Text = indent.ToString();
return;
}
if (TrimEnd(doc))
line = doc.Text.TrimStart();
var oldBlock = _block;
var startInComment = _blockComment;
var startInString = (_inString && _verbatim);
#region Parse char by char
_lineComment = false;
_inChar = false;
_escape = false;
if (!_verbatim) _inString = false;
_lastRealChar = '\n';
var c = ' ';
var nextchar = line[0];
for (var i = 0; i < line.Length; i++)
{
if (_lineComment) break; // cancel parsing current line
var lastchar = c;
c = nextchar;
nextchar = i + 1 < line.Length ? line[i + 1] : '\n';
if (_escape)
{
_escape = false;
continue;
}
#region Check for comment/string chars
switch (c)
{
case '/':
if (_blockComment && lastchar == '*')
_blockComment = false;
if (!_inString && !_inChar)
{
if (!_blockComment && nextchar == '/')
_lineComment = true;
if (!_lineComment && nextchar == '*')
_blockComment = true;
}
break;
case '#':
if (!(_inChar || _blockComment || _inString))
_lineComment = true;
break;
case '"':
if (!(_inChar || _lineComment || _blockComment))
{
_inString = !_inString;
if (!_inString && _verbatim)
{
if (nextchar == '"')
{
_escape = true; // skip escaped quote
_inString = true;
}
else
{
_verbatim = false;
}
}
else if (_inString && lastchar == '@')
{
_verbatim = true;
}
}
break;
case '\'':
if (!(_inString || _lineComment || _blockComment))
{
_inChar = !_inChar;
}
break;
case '\\':
if ((_inString && !_verbatim) || _inChar)
_escape = true; // skip next character
break;
}
#endregion
if (_lineComment || _blockComment || _inString || _inChar)
{
if (_wordBuilder.Length > 0)
_block.LastWord = _wordBuilder.ToString();
_wordBuilder.Length = 0;
continue;
}
if (!char.IsWhiteSpace(c) && c != '[' && c != '/')
{
if (_block.Bracket == '{')
_block.Continuation = true;
}
if (char.IsLetterOrDigit(c))
{
_wordBuilder.Append(c);
}
else
{
if (_wordBuilder.Length > 0)
_block.LastWord = _wordBuilder.ToString();
_wordBuilder.Length = 0;
}
#region Push/Pop the blocks
switch (c)
{
case '{':
_block.ResetOneLineBlock();
_blocks.Push(_block);
_block.StartLine = doc.LineNumber;
if (_block.LastWord == "switch")
{
_block.Indent(set.IndentString + set.IndentString);
/* oldBlock refers to the previous line, not the previous block
* The block we want is not available anymore because it was never pushed.
* } else if (oldBlock.OneLineBlock) {
// Inside a one-line-block is another statement
// with a full block: indent the inner full block
// by one additional level
block.Indent(set, set.IndentString + set.IndentString);
block.OuterIndent += set.IndentString;
// Indent current line if it starts with the '{' character
if (i == 0) {
oldBlock.InnerIndent += set.IndentString;
}*/
}
else
{
_block.Indent(set);
}
_block.Bracket = '{';
break;
case '}':
while (_block.Bracket != '{')
{
if (_blocks.Count == 0) break;
_block = _blocks.Pop();
}
if (_blocks.Count == 0) break;
_block = _blocks.Pop();
_block.Continuation = false;
_block.ResetOneLineBlock();
break;
case '(':
case '[':
_blocks.Push(_block);
if (_block.StartLine == doc.LineNumber)
_block.InnerIndent = _block.OuterIndent;
else
_block.StartLine = doc.LineNumber;
_block.Indent(Repeat(set.IndentString, oldBlock.OneLineBlock) +
(oldBlock.Continuation ? set.IndentString : "") +
(i == line.Length - 1 ? set.IndentString : new string(' ', i + 1)));
_block.Bracket = c;
break;
case ')':
if (_blocks.Count == 0) break;
if (_block.Bracket == '(')
{
_block = _blocks.Pop();
if (IsSingleStatementKeyword(_block.LastWord))
_block.Continuation = false;
}
break;
case ']':
if (_blocks.Count == 0) break;
if (_block.Bracket == '[')
_block = _blocks.Pop();
break;
case ';':
case ',':
_block.Continuation = false;
_block.ResetOneLineBlock();
break;
case ':':
if (_block.LastWord == "case"
|| line.StartsWith("case ", StringComparison.Ordinal)
|| line.StartsWith(_block.LastWord + ":", StringComparison.Ordinal))
{
_block.Continuation = false;
_block.ResetOneLineBlock();
}
break;
}
if (!char.IsWhiteSpace(c))
{
// register this char as last char
_lastRealChar = c;
}
#endregion
}
#endregion
if (_wordBuilder.Length > 0)
_block.LastWord = _wordBuilder.ToString();
_wordBuilder.Length = 0;
if (startInString) return;
if (startInComment && line[0] != '*') return;
if (doc.Text.StartsWith("//\t", StringComparison.Ordinal) || doc.Text == "//")
return;
if (line[0] == '}')
{
indent.Append(oldBlock.OuterIndent);
oldBlock.ResetOneLineBlock();
oldBlock.Continuation = false;
}
else
{
indent.Append(oldBlock.InnerIndent);
}
if (indent.Length > 0 && oldBlock.Bracket == '(' && line[0] == ')')
{
indent.Remove(indent.Length - 1, 1);
}
else if (indent.Length > 0 && oldBlock.Bracket == '[' && line[0] == ']')
{
indent.Remove(indent.Length - 1, 1);
}
if (line[0] == ':')
{
oldBlock.Continuation = true;
}
else if (_lastRealChar == ':' && indent.Length >= set.IndentString.Length)
{
if (_block.LastWord == "case" || line.StartsWith("case ", StringComparison.Ordinal) || line.StartsWith(_block.LastWord + ":", StringComparison.Ordinal))
indent.Remove(indent.Length - set.IndentString.Length, set.IndentString.Length);
}
else if (_lastRealChar == ')')
{
if (IsSingleStatementKeyword(_block.LastWord))
{
_block.OneLineBlock++;
}
}
else if (_lastRealChar == 'e' && _block.LastWord == "else")
{
_block.OneLineBlock = Math.Max(1, _block.PreviousOneLineBlock);
_block.Continuation = false;
oldBlock.OneLineBlock = _block.OneLineBlock - 1;
}
if (doc.IsReadOnly)
{
// We can't change the current line, but we should accept the existing
// indentation if possible (=if the current statement is not a multiline
// statement).
if (!oldBlock.Continuation && oldBlock.OneLineBlock == 0 &&
oldBlock.StartLine == _block.StartLine &&
_block.StartLine < doc.LineNumber && _lastRealChar != ':')
{
// use indent StringBuilder to get the indentation of the current line
indent.Length = 0;
line = doc.Text; // get untrimmed line
foreach (var t in line)
{
if (!char.IsWhiteSpace(t))
break;
indent.Append(t);
}
// /* */ multiline comments have an extra space - do not count it
// for the block's indentation.
if (startInComment && indent.Length > 0 && indent[indent.Length - 1] == ' ')
{
indent.Length -= 1;
}
_block.InnerIndent = indent.ToString();
}
return;
}
if (line[0] != '{')
{
if (line[0] != ')' && oldBlock.Continuation && oldBlock.Bracket == '{')
indent.Append(set.IndentString);
indent.Append(Repeat(set.IndentString, oldBlock.OneLineBlock));
}
// this is only for blockcomment lines starting with *,
// all others keep their old indentation
if (startInComment)
indent.Append(' ');
if (indent.Length != (doc.Text.Length - line.Length) ||
!doc.Text.StartsWith(indent.ToString(), StringComparison.Ordinal) ||
char.IsWhiteSpace(doc.Text[indent.Length]))
{
doc.Text = indent + line;
}
}
private static string Repeat(string text, int count)
{
if (count == 0)
return string.Empty;
if (count == 1)
return text;
var b = new StringBuilder(text.Length * count);
for (var i = 0; i < count; i++)
b.Append(text);
return b.ToString();
}
private static bool IsSingleStatementKeyword(string keyword)
{
switch (keyword)
{
case "if":
case "for":
case "while":
case "do":
case "foreach":
case "using":
case "lock":
return true;
default:
return false;
}
}
private static bool TrimEnd(IDocumentAccessor doc)
{
var line = doc.Text;
if (!char.IsWhiteSpace(line[line.Length - 1])) return false;
// one space after an empty comment is allowed
if (line.EndsWith("// ", StringComparison.Ordinal) || line.EndsWith("* ", StringComparison.Ordinal))
return false;
doc.Text = line.TrimEnd();
return true;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 28b848f7720bc45fb8f8f4e51bddcfd5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,55 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using Unity.CodeEditor.Document;
namespace Unity.CodeEditor.Indentation
{
/// <summary>
/// Handles indentation by copying the indentation from the previous line.
/// Does not support indenting multiple lines.
/// </summary>
internal class DefaultIndentationStrategy : IIndentationStrategy
{
/// <inheritdoc/>
public virtual void IndentLine(TextDocument document, DocumentLine line)
{
if (document == null) throw new ArgumentNullException(nameof(document));
if (line == null) throw new ArgumentNullException(nameof(line));
var previousLine = line.PreviousLine;
if (previousLine != null)
{
var indentationSegment = TextUtilities.GetWhitespaceAfter(document, previousLine.Offset);
var indentation = document.GetText(indentationSegment);
// copy indentation to line
indentationSegment = TextUtilities.GetWhitespaceAfter(document, line.Offset);
document.Replace(indentationSegment.Offset, indentationSegment.Length, indentation,
OffsetChangeMappingType.RemoveAndInsert);
// OffsetChangeMappingType.RemoveAndInsert guarantees the caret moves behind the new indentation.
}
}
/// <summary>
/// Does nothing: indenting multiple lines is useless without a smart indentation strategy.
/// </summary>
public virtual void IndentLines(TextDocument document, int beginLine, int endLine)
{
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8b0cdc15cea7d4af08eb36490bdb68b4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,39 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using Unity.CodeEditor.Document;
namespace Unity.CodeEditor.Indentation
{
/// <summary>
/// Strategy how the text editor handles indentation when new lines are inserted.
/// </summary>
internal interface IIndentationStrategy
{
/// <summary>
/// Sets the indentation for the specified line.
/// Usually this is constructed from the indentation of the previous line.
/// </summary>
void IndentLine(TextDocument document, DocumentLine line);
/// <summary>
/// Reindents a set of lines.
/// </summary>
void IndentLines(TextDocument document, int beginLine, int endLine);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8859344300b1c42c1a8d35405d42912a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: